version:1.2.1
fix:修复修改信息后不更新 update:必备组件改为接口获取
This commit is contained in:
@@ -17,8 +17,8 @@ android {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
|
||||
versionCode 21
|
||||
versionName "1.2.0"
|
||||
versionCode 22
|
||||
versionName "1.2.1"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -279,7 +279,17 @@
|
||||
<activity
|
||||
android:name=".eula.LicenseActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.download.DownloadActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|locale"
|
||||
android:exported="true"
|
||||
android:launchMode="standard"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:theme="@style/ActivityTheme2">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<receiver
|
||||
android:name=".receiver.BootReceiver"
|
||||
|
||||
@@ -192,7 +192,7 @@ public class ExitActivity extends BaseDataBindingActivity {
|
||||
} else {
|
||||
finishAffinity();
|
||||
}
|
||||
AdminManager.getInstance().killApplicationProcess(BuildConfig.APPLICATION_ID);
|
||||
// AdminManager.getInstance().killApplicationProcess(BuildConfig.APPLICATION_ID);
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
if (optional.isPresent()) {
|
||||
VipInfo vipInfo = optional.get();
|
||||
mViewDataBinding.tvPrice.setText("¥" + vipInfo.getPrice());
|
||||
mViewDataBinding.tvVipName.setText(vipInfo.getName());
|
||||
mViewDataBinding.tvVipName.setText("¥" + vipInfo.getOrigin_price());
|
||||
mViewDataBinding.tvVipPrice.setText("¥" + vipInfo.getPrice());
|
||||
mViewModel.getPayInfo(vipInfo.getId());
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (pollingDisposable != null && pollingDisposable.isDisposed()) {
|
||||
if (pollingDisposable != null && !pollingDisposable.isDisposed()) {
|
||||
pollingDisposable.dispose();
|
||||
pollingDisposable = null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.xwad.os.activity.download;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.adapter.AppInfoAdapter;
|
||||
import com.xwad.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xwad.os.bean.AppInfo;
|
||||
import com.xwad.os.databinding.ActivityDownloadBinding;
|
||||
import com.xwad.os.utils.ActivationUtil;
|
||||
import com.xwad.os.utils.ApkUtils;
|
||||
import com.xwad.os.utils.FileUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class DownloadActivity extends BaseMvvmActivity<DownloadViewModel, ActivityDownloadBinding> {
|
||||
private static final String TAG = "DownloadActivity";
|
||||
|
||||
|
||||
private AppInfoAdapter mAppInfoAdapter;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_download;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mAppInfoAdapter = new AppInfoAdapter();
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 4);
|
||||
mViewDataBinding.rvContent.setLayoutManager(gridLayoutManager);
|
||||
mViewDataBinding.rvContent.setAdapter(mAppInfoAdapter);
|
||||
|
||||
registerAppChangedReceiver();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mViewModel.mListMutableLiveData.observe(this, new Observer<List<AppInfo>>() {
|
||||
@Override
|
||||
public void onChanged(List<AppInfo> appInfos) {
|
||||
mAppInfoAdapter.setAppInfos(appInfos);
|
||||
if (appInfos == null || appInfos.isEmpty()) {
|
||||
mViewDataBinding.rvContent.setVisibility(View.GONE);
|
||||
mViewDataBinding.llNodata.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mViewDataBinding.rvContent.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.llNodata.setVisibility(View.GONE);
|
||||
if (ActivationUtil.getInstance().isActivation()) {
|
||||
appInfos.forEach(new Consumer<AppInfo>() {
|
||||
@Override
|
||||
public void accept(AppInfo appInfo) {
|
||||
if (appInfo.getIs_must_components_down() == 1) {
|
||||
if (!ApkUtils.isAvailable(DownloadActivity.this, appInfo.getApp_package())) {
|
||||
FileUtils.ariaDownload(DownloadActivity.this, appInfo.getApp_url(), appInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.getAdminApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mAppChangedReceiver != null) {
|
||||
unregisterReceiver(mAppChangedReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
private AppChangedReceiver mAppChangedReceiver;
|
||||
|
||||
private void registerAppChangedReceiver() {
|
||||
if (mAppChangedReceiver == null) {
|
||||
mAppChangedReceiver = new AppChangedReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
|
||||
filter.addDataScheme("package");
|
||||
registerReceiver(mAppChangedReceiver, filter);
|
||||
}
|
||||
|
||||
class AppChangedReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e("AppChangedReceiver", "onReceive: " + action);
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
return;
|
||||
}
|
||||
mAppInfoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
public void exit(View view) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.xwad.os.activity.download;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xwad.os.base.mvvm.BaseViewModel;
|
||||
import com.xwad.os.bean.AppInfo;
|
||||
import com.xwad.os.bean.BaseResponse;
|
||||
import com.xwad.os.databinding.ActivityDownloadBinding;
|
||||
import com.xwad.os.network.NetInterfaceManager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class DownloadViewModel extends BaseViewModel<ActivityDownloadBinding, ActivityEvent> {
|
||||
|
||||
@Override
|
||||
public ActivityDownloadBinding getVDBinding() {
|
||||
return binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MutableLiveData<List<AppInfo>> mListMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public void getAdminApp() {
|
||||
NetInterfaceManager.getInstance().getAdminAppObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAdminApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||
Log.e("getAdminApp", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AppInfo> appInfoList = listBaseResponse.data;
|
||||
List<AppInfo> forceAppInfoList = appInfoList.stream().filter(new Predicate<AppInfo>() {
|
||||
@Override
|
||||
public boolean test(AppInfo appInfo) {
|
||||
return appInfo.getIs_must_components() == 1;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
mListMutableLiveData.setValue(forceAppInfoList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAdminApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAdminApp", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
100
app/src/main/java/com/xwad/os/adapter/AppInfoAdapter.java
Normal file
100
app/src/main/java/com/xwad/os/adapter/AppInfoAdapter.java
Normal file
@@ -0,0 +1,100 @@
|
||||
package com.xwad.os.adapter;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.bean.AppInfo;
|
||||
import com.xwad.os.config.CommonConfig;
|
||||
import com.xwad.os.utils.ActivationUtil;
|
||||
import com.xwad.os.utils.ApkUtils;
|
||||
import com.xwad.os.utils.GlideLoadUtils;
|
||||
import com.xwad.os.utils.OpenApkUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeCompat;
|
||||
|
||||
public class AppInfoAdapter extends RecyclerView.Adapter<AppInfoAdapter.Holder> {
|
||||
private static final String TAG = "AppInfoAdapter";
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private FragmentActivity mContext;
|
||||
|
||||
private List<AppInfo> mAppInfos;
|
||||
|
||||
public void setAppInfos(List<AppInfo> appInfos) {
|
||||
mAppInfos = appInfos;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = (FragmentActivity) parent.getContext();
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(mContext.getResources());
|
||||
return new AppInfoAdapter.Holder(LayoutInflater.from(mContext).inflate(R.layout.item_app_info, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(mContext.getResources());
|
||||
AppInfo appInfo = mAppInfos.get(position);
|
||||
GlideLoadUtils.getInstance().glideLoad(mContext, appInfo.getApp_img(), holder.iv_app_icon, R.drawable.icon_bbx_app);
|
||||
if (!TextUtils.isEmpty(appInfo.getApp_name())) {
|
||||
holder.tv_app_name.setText(appInfo.getApp_name());
|
||||
} else {
|
||||
holder.tv_app_name.setText("未知应用");
|
||||
}
|
||||
if (ApkUtils.isAvailable(mContext, appInfo.getApp_package())) {
|
||||
holder.iv_download.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.iv_download.setVisibility(View.VISIBLE);
|
||||
}
|
||||
holder.rl_root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (ApkUtils.isAvailable(mContext, appInfo.getApp_package())) {
|
||||
ApkUtils.openPackage(mContext, appInfo.getApp_package());
|
||||
} else {
|
||||
if (ActivationUtil.getInstance().isActivation()) {
|
||||
OpenApkUtils.getInstance().showDownloadDialog(mContext, appInfo.getApp_package(), appInfo.getApp_name());
|
||||
} else {
|
||||
Toaster.show("请先激活设备");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mAppInfos == null ? 0 : mAppInfos.size();
|
||||
}
|
||||
|
||||
public class Holder extends RecyclerView.ViewHolder {
|
||||
ConstraintLayout rl_root;
|
||||
ImageView iv_app_icon, iv_download;
|
||||
TextView tv_app_name;
|
||||
|
||||
public Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
rl_root = itemView.findViewById(R.id.rl_root);
|
||||
iv_app_icon = itemView.findViewById(R.id.iv_app_icon);
|
||||
iv_download = itemView.findViewById(R.id.iv_download);
|
||||
tv_app_name = itemView.findViewById(R.id.tv_app_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,8 @@ public class AppInfo implements Serializable {
|
||||
private String use_type;
|
||||
private int is_autodown;
|
||||
private String third_url;
|
||||
private int is_must_components;
|
||||
private int is_must_components_down;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@@ -209,6 +211,22 @@ public class AppInfo implements Serializable {
|
||||
this.third_url = third_url;
|
||||
}
|
||||
|
||||
public int getIs_must_components() {
|
||||
return is_must_components;
|
||||
}
|
||||
|
||||
public void setIs_must_components(int is_must_components) {
|
||||
this.is_must_components = is_must_components;
|
||||
}
|
||||
|
||||
public int getIs_must_components_down() {
|
||||
return is_must_components_down;
|
||||
}
|
||||
|
||||
public void setIs_must_components_down(int is_must_components_down) {
|
||||
this.is_must_components_down = is_must_components_down;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.activity.ExitActivity;
|
||||
import com.xwad.os.activity.download.DownloadActivity;
|
||||
import com.xwad.os.activity.user.UserActivity;
|
||||
import com.xwad.os.base.mvvm.fragment.BaseMvvmFragment;
|
||||
import com.xwad.os.bean.SnInfo;
|
||||
@@ -27,7 +28,6 @@ import com.xwad.os.jxw.ToastUtil;
|
||||
import com.xwad.os.jxw.event.UpdateColorEvent;
|
||||
import com.xwad.os.utils.OpenApkUtils;
|
||||
import com.xwad.os.view.jxw.view.dialog.QhbzDialog;
|
||||
import com.xwad.os.view.jxw.widget.DefaultAppsDialog;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -396,14 +396,15 @@ public class MineFragment extends BaseMvvmFragment<MineViewModel, FragmentMineBi
|
||||
}
|
||||
|
||||
public void openAppsDialog(View view) {
|
||||
DefaultAppsDialog appsDialog = new DefaultAppsDialog(getActivity());
|
||||
appsDialog.show();
|
||||
appsDialog.setOnCallback(new DefaultAppsDialog.Callback() {
|
||||
@Override
|
||||
public void onCallback() {
|
||||
|
||||
}
|
||||
});
|
||||
startActivity(new Intent(mContext, DownloadActivity.class));
|
||||
// DefaultAppsDialog appsDialog = new DefaultAppsDialog(getActivity());
|
||||
// appsDialog.show();
|
||||
// appsDialog.setOnCallback(new DefaultAppsDialog.Callback() {
|
||||
// @Override
|
||||
// public void onCallback() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public void register(View view) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.activity.activation.ActivationActivity;
|
||||
import com.xwad.os.activity.download.DownloadActivity;
|
||||
import com.xwad.os.activity.login.LoginActivity;
|
||||
import com.xwad.os.base.mvvm.fragment.BaseMvvmFragment;
|
||||
import com.xwad.os.bean.UserInfo;
|
||||
@@ -28,11 +29,8 @@ import com.xwad.os.fragment.dialog.login.account.AccountLoginDialogFragment;
|
||||
import com.xwad.os.fragment.dialog.login.code.CodeLoginDialogFragment;
|
||||
import com.xwad.os.fragment.dialog.login.statu.LoginStatuDialogFragment;
|
||||
import com.xwad.os.fragment.dialog.viplist.VipListDialogFragment;
|
||||
import com.xwad.os.jxw.JxwPackageConfig;
|
||||
import com.xwad.os.utils.ActivationUtil;
|
||||
import com.xwad.os.utils.ApkUtils;
|
||||
import com.xwad.os.utils.OpenApkUtils;
|
||||
import com.xwad.os.view.jxw.widget.DefaultAppsDialog;
|
||||
|
||||
|
||||
public class AccountFragment extends BaseMvvmFragment<AccountViewModel, FragmentAccountBinding> {
|
||||
@@ -87,15 +85,16 @@ public class AccountFragment extends BaseMvvmFragment<AccountViewModel, Fragment
|
||||
if (vipLevel != null && !TextUtils.isEmpty(vipLevel.getName())) {
|
||||
mViewDataBinding.tvVipName.setText(vipLevel.getName());
|
||||
}
|
||||
if (!ApkUtils.isAvailable(getCtx(), JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME)) {
|
||||
mViewModel.getAppInfo(JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME);
|
||||
}
|
||||
if (!ApkUtils.isAvailable(getCtx(), "com.jxw.download")) {
|
||||
mViewModel.getAppInfo("com.jxw.download");
|
||||
}
|
||||
if (!ApkUtils.isAvailable(getCtx(), "com.study.flashplayer")) {
|
||||
mViewModel.getAppInfo("com.study.flashplayer");
|
||||
}
|
||||
// if (!ApkUtils.isAvailable(getCtx(), JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME)) {
|
||||
// mViewModel.getAppInfo(JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME);
|
||||
// }
|
||||
// if (!ApkUtils.isAvailable(getCtx(), "com.jxw.download")) {
|
||||
// mViewModel.getAppInfo("com.jxw.download");
|
||||
// }
|
||||
// if (!ApkUtils.isAvailable(getCtx(), "com.study.flashplayer")) {
|
||||
// mViewModel.getAppInfo("com.study.flashplayer");
|
||||
// }
|
||||
mViewModel.getAdminAppDownload();
|
||||
mViewModel.getActivation();
|
||||
} else {
|
||||
mViewDataBinding.tvVipName.setText("学王365AI旗舰版");
|
||||
@@ -104,6 +103,8 @@ public class AccountFragment extends BaseMvvmFragment<AccountViewModel, Fragment
|
||||
}
|
||||
});
|
||||
mViewModel.getUserInfo();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,8 +140,9 @@ public class AccountFragment extends BaseMvvmFragment<AccountViewModel, Fragment
|
||||
if (intent != null && result.getResultCode() == Activity.RESULT_OK) {
|
||||
mViewModel.getUserInfo();
|
||||
|
||||
DefaultAppsDialog appsDialog = new DefaultAppsDialog(getActivity());
|
||||
appsDialog.show();
|
||||
startActivity(new Intent(mContext, DownloadActivity.class));
|
||||
// DefaultAppsDialog appsDialog = new DefaultAppsDialog(getActivity());
|
||||
// appsDialog.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,13 @@ import com.xwad.os.config.CommonConfig;
|
||||
import com.xwad.os.databinding.FragmentAccountBinding;
|
||||
import com.xwad.os.network.NetInterfaceManager;
|
||||
import com.xwad.os.utils.ActivationUtil;
|
||||
import com.xwad.os.utils.ApkUtils;
|
||||
import com.xwad.os.utils.FileUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
@@ -107,6 +112,7 @@ public class AccountViewModel extends BaseViewModel<FragmentAccountBinding, Frag
|
||||
|
||||
public void getAppInfo(String pkg) {
|
||||
NetInterfaceManager.getInstance().getAdminAppObservable(pkg)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
@@ -135,4 +141,51 @@ public class AccountViewModel extends BaseViewModel<FragmentAccountBinding, Frag
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getAdminAppDownload() {
|
||||
NetInterfaceManager.getInstance().getAdminAppObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAdminAppDownload", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||
Log.e("getAdminAppDownload", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AppInfo> appInfoList = listBaseResponse.data;
|
||||
appInfoList.stream()
|
||||
.filter(new Predicate<AppInfo>() {
|
||||
@Override
|
||||
public boolean test(AppInfo appInfo) {
|
||||
return appInfo.getIs_must_components() == 1;
|
||||
}
|
||||
})
|
||||
.forEach(new Consumer<AppInfo>() {
|
||||
@Override
|
||||
public void accept(AppInfo appInfo) {
|
||||
if (appInfo.getIs_must_components_down() == 1) {
|
||||
if (!ApkUtils.isAvailable(getCtx(), appInfo.getApp_package())) {
|
||||
FileUtils.ariaDownload(getCtx(), appInfo.getApp_url(), appInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAdminAppDownload", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAdminAppDownload", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +132,11 @@ public class InfoFragment extends BaseMvvmFragment<InfoViewModel, FragmentInfoBi
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (ActivationUtil.getInstance().isLogin()) {
|
||||
mViewModel.getSnInfo();
|
||||
} else {
|
||||
getLocalData();
|
||||
}
|
||||
}
|
||||
|
||||
private void getLocalData() {
|
||||
|
||||
@@ -608,7 +608,7 @@ public class AdminManager {
|
||||
* addAlertWindowApps/
|
||||
* addDisallowCloseBootCompletedApps/
|
||||
* addDisallowBatteryOptimizeApps
|
||||
*
|
||||
* <p>
|
||||
* 几个接口任意一个调用过,都无法再次调用这个接口
|
||||
*
|
||||
* @param packageNames
|
||||
@@ -704,9 +704,14 @@ public class AdminManager {
|
||||
return;
|
||||
}
|
||||
// throw Exception the device is already hava third default launcher, you must clear it first
|
||||
clearDefaultLauncher();
|
||||
try {
|
||||
mDeviceControlManager.setDefaultLauncher(mAdminName, packageName, className);
|
||||
if (!JgyUtils.getInstance().isDefaultLauncher(packageName, className)) {
|
||||
clearDefaultLauncher();
|
||||
Log.e(TAG, "setDefaultLauncher: failed retry");
|
||||
// setDefaultLauncher(packageName, className);
|
||||
|
||||
}
|
||||
Log.e(TAG, "setDefaultLauncher: finish");
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setDefaultLauncher: " + e.getMessage());
|
||||
|
||||
@@ -465,6 +465,13 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<AppInfo>>> getTestAppObservable() {
|
||||
return getAppApi()
|
||||
.getTestApp(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getPhoneCodeObservable(String mobile) {
|
||||
return mRetrofit.create(LoginApi.class)
|
||||
.getCode(mobile)
|
||||
|
||||
@@ -39,6 +39,8 @@ public class UrlAddress {
|
||||
public final static String APP_FORCE_INSTALL = "app/force-install";
|
||||
/*根据包名获取更新*/
|
||||
public final static String GET_NEWEST_APPUPDATE = "app/newestAppUpdate";
|
||||
/*获取灰度更新*/
|
||||
public static final String GET_TEST_APP_INFO = "app/getTestAppInfo";
|
||||
/*发送卸载或者安装信息*/
|
||||
public final static String SEND_INSTALLEDORREMOVED = "app/addAppInstall";
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppApi {
|
||||
@GET(UrlAddress.GET_ADMIN_APP)
|
||||
Observable<BaseResponse<List<AppInfo>>> getAdminApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.APP_FORCE_INSTALL)
|
||||
Observable<BaseResponse<AppInfo>> getAdminApp(
|
||||
@Query("desktop_app_package") String desktop_app_package,
|
||||
@@ -27,15 +32,15 @@ public interface AppApi {
|
||||
@Query("type") int type
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TEST_APP_INFO)
|
||||
Observable<BaseResponse<List<AppInfo>>> getTestApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_INSTALLEDORREMOVED)
|
||||
Observable<BaseResponse> installorRemove(
|
||||
@Field("sn") String sn,
|
||||
@Field("app") String jsonString
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_ADMIN_APP)
|
||||
Observable<BaseResponse<List<AppInfo>>> getAdminApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.xwad.os.bean.BaseResponse;
|
||||
import com.xwad.os.bean.UserInfo;
|
||||
import com.xwad.os.config.CommonConfig;
|
||||
import com.xwad.os.gson.GsonUtils;
|
||||
import com.xwad.os.jxw.JxwPackageConfig;
|
||||
import com.xwad.os.network.NetInterfaceManager;
|
||||
import com.xwad.os.service.ManagerService;
|
||||
import com.xwad.os.utils.ActivationUtil;
|
||||
@@ -25,6 +24,8 @@ import com.xwad.os.utils.Utils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
@@ -114,15 +115,16 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
UserInfo userInfo = userInfoBaseResponse.data;
|
||||
int vip_level_id = userInfo.getVip_level_id();
|
||||
if (vip_level_id != 0) {
|
||||
if (!ApkUtils.isAvailable(mContext, JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME)) {
|
||||
getAppInfo(JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME);
|
||||
}
|
||||
if (!ApkUtils.isAvailable(mContext, "com.jxw.download")) {
|
||||
getAppInfo("com.jxw.download");
|
||||
}
|
||||
if (!ApkUtils.isAvailable(mContext, "com.study.flashplayer")) {
|
||||
getAppInfo("com.study.flashplayer");
|
||||
}
|
||||
// if (!ApkUtils.isAvailable(mContext, JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME)) {
|
||||
// getAppInfo(JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME);
|
||||
// }
|
||||
// if (!ApkUtils.isAvailable(mContext, "com.jxw.download")) {
|
||||
// getAppInfo("com.jxw.download");
|
||||
// }
|
||||
// if (!ApkUtils.isAvailable(mContext, "com.study.flashplayer")) {
|
||||
// getAppInfo("com.study.flashplayer");
|
||||
// }
|
||||
getAdminAppDownload();
|
||||
}
|
||||
|
||||
} else if (userInfoBaseResponse.code == 401) {
|
||||
@@ -143,6 +145,53 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
});
|
||||
}
|
||||
|
||||
public void getAdminAppDownload() {
|
||||
NetInterfaceManager.getInstance().getAdminAppObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAdminAppDownload", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||
Log.e("getAdminAppDownload", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AppInfo> appInfoList = listBaseResponse.data;
|
||||
appInfoList.stream()
|
||||
.filter(new Predicate<AppInfo>() {
|
||||
@Override
|
||||
public boolean test(AppInfo appInfo) {
|
||||
return appInfo.getIs_must_components() == 1;
|
||||
}
|
||||
})
|
||||
.forEach(new Consumer<AppInfo>() {
|
||||
@Override
|
||||
public void accept(AppInfo appInfo) {
|
||||
if (appInfo.getIs_must_components_down() == 1) {
|
||||
if (!ApkUtils.isAvailable(mContext, appInfo.getApp_package())) {
|
||||
FileUtils.ariaDownload(mContext, appInfo.getApp_url(), appInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAdminAppDownload", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAdminAppDownload", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getAppInfo(String pkg) {
|
||||
NetInterfaceManager.getInstance().getAdminAppObservable(pkg)
|
||||
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/icon_back1.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_back1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_btk.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_btk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_qdy.webp
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_qdy.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_qst.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_qst.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -119,7 +119,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_price"
|
||||
@@ -139,27 +140,83 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="请在15分钟内完成支付,超时二维码将失效"
|
||||
android:textColor="#9bb2cc"
|
||||
android:textSize="8sp"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="商品价格"
|
||||
android:textColor="@color/activation_text_color"
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vip_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="11sp"
|
||||
tools:text="¥980.00" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="限时优惠价格"
|
||||
android:textColor="@color/activation_text_color"
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vip_price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="14sp"
|
||||
tools:text="¥980.00" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_qrcode"
|
||||
@@ -218,12 +275,14 @@
|
||||
android:layout_marginEnd="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_alipay" />
|
||||
android:src="@drawable/icon_alipay"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
@@ -238,75 +297,19 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="160dp"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="请在15分钟内完成支付,超时二维码将失效"
|
||||
android:textColor="#9bb2cc"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="商品名称"
|
||||
android:textColor="@color/activation_text_color"
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vip_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="软件终端许可证-AI旗舰版"
|
||||
android:textColor="#000000"
|
||||
android:textSize="9sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="商品价格"
|
||||
android:textColor="@color/activation_text_color"
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vip_price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="¥980.00"
|
||||
android:textColor="#000000"
|
||||
android:textSize="9sp" />
|
||||
|
||||
</LinearLayout>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -585,9 +588,9 @@
|
||||
android:layout_marginEnd="32dp"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:gravity="center"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:inputType="text"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
91
app/src/main/res/layout/activity_download.xml
Normal file
91
app/src/main/res/layout/activity_download.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xwad.os.activity.download.DownloadActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#d4dfff"
|
||||
android:tag="layout/activity_home_0">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/x160"
|
||||
android:background="@drawable/icon_btk"
|
||||
android:tag="layout/book_layout_title_bar_0"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_back"
|
||||
android:layout_width="@dimen/y100"
|
||||
android:layout_height="@dimen/x100"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/y60"
|
||||
android:duplicateParentState="true"
|
||||
android:onClick="@{click::exit}"
|
||||
android:src="@drawable/icon_back1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingBottom="@dimen/x5"
|
||||
android:tag="binding_1"
|
||||
android:text="学王365必备组件下载"
|
||||
android:textColor="@color/res_text_color1"
|
||||
android:textSize="@dimen/x50"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_content"
|
||||
style="@style/recycler_view_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nodata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/y589"
|
||||
android:layout_height="@dimen/x524"
|
||||
android:src="@drawable/icon_qst" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/x43"
|
||||
android:text="@string/no_content_available_the_moment"
|
||||
android:textColor="@color/res_text_color1"
|
||||
android:textSize="@dimen/x36" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
35
app/src/main/res/layout/book_layout_title_bar.xml
Normal file
35
app/src/main/res/layout/book_layout_title_bar.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:binding="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/x160"
|
||||
android:background="@drawable/icon_btk"
|
||||
android:tag="layout/book_layout_title_bar_0">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_back"
|
||||
android:layout_width="@dimen/y100"
|
||||
android:layout_height="@dimen/x100"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/y60"
|
||||
android:duplicateParentState="true"
|
||||
android:src="@drawable/icon_back1"
|
||||
binding:layout_constraintBottom_toBottomOf="parent"
|
||||
binding:layout_constraintLeft_toLeftOf="parent"
|
||||
binding:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingBottom="@dimen/x5"
|
||||
android:tag="binding_1"
|
||||
android:text="学王365必备组件下载"
|
||||
android:textColor="@color/res_text_color1"
|
||||
android:textSize="@dimen/x50"
|
||||
binding:layout_constraintBottom_toBottomOf="parent"
|
||||
binding:layout_constraintLeft_toLeftOf="parent"
|
||||
binding:layout_constraintRight_toRightOf="parent"
|
||||
binding:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
43
app/src/main/res/layout/item_app_info.xml
Normal file
43
app/src/main/res/layout/item_app_info.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rl_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="69dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_app_icon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_download"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_download"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_app_icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_app_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
tools:text="当前壁纸"
|
||||
android:textColor="#333333"
|
||||
android:textSize="9sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_app_icon" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rl_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="69dp">
|
||||
@@ -31,7 +32,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="当前壁纸"
|
||||
tools:text="当前壁纸"
|
||||
android:textColor="#333333"
|
||||
android:textSize="9sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<color name="default_title_indicator_text_color">#bbffffff</color>
|
||||
<color name="default_underline_indicator_selected_color">#ff33b5e5</color>
|
||||
|
||||
<color name="res_text_color1">#333333</color>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -836,4 +836,8 @@
|
||||
<string name="wifi_set">设\t置</string>
|
||||
<string name="yxp_pag_baoxiang">pag/exp_baoxiang_ywc.pag</string>
|
||||
<string name="yxp_pag_liwuhe">pag/exp_liwuhe_ywc.pag</string>
|
||||
|
||||
<!--download-->
|
||||
<string name="no_content_available_the_moment">暂无内容,请先去下载吧!</string>
|
||||
|
||||
</resources>
|
||||
@@ -137,4 +137,24 @@
|
||||
<item name="android:windowSoftInputMode">stateVisible|adjustPan</item>
|
||||
</style>
|
||||
|
||||
<style name="recycler_view_style" parent="">
|
||||
<item name="android:scrollbars">none</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:overScrollMode">never</item>
|
||||
</style>
|
||||
|
||||
<style name="BaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="ActivityTheme2" parent="@style/BaseTheme">
|
||||
<item name="android:windowBackground">@drawable/icon_qdy</item>
|
||||
<item name="android:windowIsTranslucent">false</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user