version:1.7.9

fix:修复竖屏报错
update:增加客服,适配不同版本ai精准学
This commit is contained in:
2024-06-11 14:49:13 +08:00
parent 53eddf9215
commit 512f2ed70c
91 changed files with 4386 additions and 789 deletions

View File

@@ -40,6 +40,46 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<!--amap-->
<!-- Normal Permissions 不需要运行时注册 -->
<!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
<!-- 用于访问wifi网络信息wifi信息会用于进行网络定位 -->
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
<!-- 这个权限用于获取wifi的获取权限wifi信息会用来进行网络定位 -->
<!-- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>-->
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<!-- 请求网络 -->
<!-- <uses-permission android:name="android.permission.INTERNET"/>-->
<!-- 不是SDK需要的权限是示例中的后台唤醒定位需要的权限 -->
<!-- <uses-permission android:name="android.permission.WAKE_LOCK"/>-->
<!-- 需要运行时注册的权限 -->
<!-- 用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- 用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- 用于提高GPS定位速度 -->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<!-- 写入扩展存储,向扩展卡写入数据,用于写入缓存定位数据 -->
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
<!-- 读取缓存数据 -->
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>-->
<!-- 用于读取手机当前的状态 -->
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
<!-- 更改设置 -->
<!-- <uses-permission android:name="android.permission.WRITE_SETTINGS"/>-->
<!--如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!--如果您的应用需要后台定位权限且有可能运行在Android Q设备上,并且设置了target>28必须增加这个权限声明-->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<application
android:name=".base.BaseApplication"
android:allowBackup="true"
@@ -77,13 +117,12 @@
android:name=".activity.NoticeActivity"
android:excludeFromRecents="true"
android:screenOrientation="portrait"
android:theme="@style/activity_styles" />
android:theme="@style/DialogCloseOnTouchOutside" />
<activity
android:name=".activity.PasswordActivity"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:screenOrientation="userLandscape"
android:theme="@style/activity_styles" />
android:screenOrientation="userLandscape" />
<activity
android:name=".activity.AddIconActivity"
android:launchMode="singleTask"
@@ -107,6 +146,10 @@
android:name=".activity.AboutActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<activity
android:name=".activity.ServiceActivity"
android:launchMode="singleTask"
android:theme="@style/DialogCloseOnTouchOutside" />
<receiver
android:name=".receiver.BootReceiver"
@@ -187,6 +230,16 @@
</intent-filter>
</receiver>
<!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location"-->
<service
android:name="com.amap.api.location.APSService"
android:foregroundServiceType="location" />
<!-- 设置key -->
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="${AMAP_KEY}" />
<!-- 请填写你自己的- appKey -->
<meta-data
android:name="com.alibaba.app.appkey"

View File

@@ -14,12 +14,16 @@ public class AboutActivity extends BaseDataBindingActivity {
private ActivityAboutBinding mBinding;
@Override
protected void initDataBinding() {
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_about);
}
/**
* 初始化视图
*/
@Override
public void initView() {
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_about);
mBinding.ivBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@@ -12,8 +12,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.uiui.zyos.R;
import com.uiui.zyos.adapter.AddAppAdapter;
import com.uiui.zyos.adapter.AppAdapter;
import com.uiui.zyos.base.BaseActivity;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
import com.uiui.zyos.bean.DesktopIcon;
import com.uiui.zyos.manager.AppManager;
import com.uiui.zyos.view.RecyclerViewSpacesItemDecoration;
@@ -25,7 +24,7 @@ import java.util.Set;
import butterknife.BindView;
import butterknife.ButterKnife;
public class AddIconActivity extends BaseActivity {
public class AddIconActivity extends BaseMvpActivity {
@BindView(R.id.iv_back)
ImageView iv_back;

View File

@@ -18,14 +18,14 @@ import androidx.annotation.Nullable;
import com.tuo.customview.VerificationCodeView;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseActivity;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.utils.Utils;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ExitActivity extends BaseActivity {
public class ExitActivity extends BaseMvpActivity {
private static final String TAG = ExitActivity.class.getSimpleName();
@BindView(R.id.bt_0)

View File

@@ -13,12 +13,16 @@ public class ManualActivity extends BaseDataBindingActivity {
ActivityManualBinding mBinding;
@Override
protected void initDataBinding() {
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_manual);
}
/**
* 初始化视图
*/
@Override
public void initView() {
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_manual);
mBinding.clActivation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@@ -2,9 +2,6 @@ package com.uiui.zyos.activity;
import android.content.Context;
import android.content.Intent;
import android.media.AudioAttributes;
import android.media.SoundPool;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
@@ -20,16 +17,13 @@ import androidx.annotation.Nullable;
import com.tuo.customview.VerificationCodeView;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseActivity;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.manager.RemoteManager;
import com.uiui.zyos.utils.ApkUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
public class PasswordActivity extends BaseActivity {
public class PasswordActivity extends BaseMvpActivity {
private static final String TAG = PasswordActivity.class.getSimpleName();
@BindView(R.id.bt_0)

View File

@@ -1,13 +1,10 @@
package com.uiui.zyos.activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseLightActivity;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
import java.io.BufferedReader;
import java.io.IOException;
@@ -15,7 +12,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
public class PolicyActivity extends BaseLightActivity {
public class PolicyActivity extends BaseMvpActivity {
private TextView textView;
@Override

View File

@@ -0,0 +1,25 @@
package com.uiui.zyos.activity;
import androidx.databinding.DataBindingUtil;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseDataBindingActivity;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
public class ServiceActivity extends BaseDataBindingActivity {
@Override
protected void initDataBinding() {
DataBindingUtil.setContentView(this, R.layout.activity_wechat);
}
@Override
public void initView() {
}
@Override
public void initData() {
}
}

View File

@@ -32,17 +32,18 @@ import com.tencent.mmkv.MMKV;
import com.uiui.zyos.BuildConfig;
import com.uiui.zyos.R;
import com.uiui.zyos.activity.ExitActivity;
import com.uiui.zyos.base.BaseActivity;
import com.uiui.zyos.base.viewpager.BaseFragmentPagerAdapter;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
import com.uiui.zyos.view.viewpager.BaseFragmentPagerAdapter;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.dialog.PrivacyPolicyDialog;
import com.uiui.zyos.fragment.subject.SubjectFragment;
import com.uiui.zyos.fragment.user.UserFragment;
import com.uiui.zyos.jxw.JxwPackageConfig;
import com.uiui.zyos.manager.AmapManager;
import com.uiui.zyos.manager.RemoteManager;
import com.uiui.zyos.utils.ApkUtils;
import com.uiui.zyos.utils.OpenApkUtils;
import com.uiui.zyos.utils.ToastUtil;
import com.hjq.toast.Toaster;
import com.uiui.zyos.utils.Utils;
import com.uiui.zyos.view.ScaleCircleNavigator;
@@ -54,7 +55,7 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MainActivity extends BaseActivity implements MainContact.MainView, RemoteManager.ConnectedListener {
public class MainActivity extends BaseMvpActivity implements MainContact.MainView, RemoteManager.ConnectedListener {
private static final String TAG = MainActivity.class.getSimpleName();
@@ -133,7 +134,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
// toggleNotificationListenerService(this);
mPresenter = new MainAPresenter(this);
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
mPresenter.setLifecycle(getLifecycleSubject());
RemoteManager.setListener(this);
Utils.getAndroiodScreenProperty(this);
@@ -224,7 +225,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
cl_0.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openApp("com.uiui.zyappstore", "com.uiui.zyappstore.activity.MainActivity");
// OpenApkUtils.getInstance().openApp("com.uiui.zyappstore", "com.uiui.zyappstore.activity.MainActivity");
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_EXAMSYSTEM_NAME, JxwPackageConfig.JXW_EXAMSYSTEM_CLASS);
}
});
cl_1.setOnClickListener(new View.OnClickListener() {
@@ -264,7 +266,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
startActivity(intent);
} catch (Exception e) {
Log.e(TAG, "onClick: " + e.getMessage());
ToastUtil.show("应用未安装");
Toaster.show("应用未安装");
}
}
});
@@ -327,7 +329,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
@Override
public void initData() {
registmNewAppReceiver();
registmUpdateAddressReceiver();
}
@Override
@@ -425,8 +427,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
protected void onRestart() {
super.onRestart();
Log.e(TAG, "onRestart: ");
mPresenter.sendAPPUsage();
mPresenter.sendRunningInfo();
// mPresenter.sendAPPUsage();
// mPresenter.sendRunningInfo();
}
@Override
@@ -451,6 +453,10 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
if (mNewAppReceiver != null) {
unregisterReceiver(mNewAppReceiver);
}
if (mUpdateAddressReceiver != null) {
unregisterReceiver(mUpdateAddressReceiver);
}
RemoteManager.removeListener(this);
}
@@ -482,49 +488,88 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
view.setVisibility(View.VISIBLE);
}
private String[] permission = new String[]{
Permission.CALL_PHONE,
Permission.WRITE_EXTERNAL_STORAGE,
Permission.READ_PHONE_STATE,
Permission.WRITE_SETTINGS,
};
private void getPermission() {
XXPermissions.with(this)
// 申请单个权限
// .permission(Permission.RECORD_AUDIO)
.permission(permission)
// 申请多个权限
.permission(Permission.Group.STORAGE)
// .permission(Permission.Group.STORAGE)
// 设置权限请求拦截器(局部设置)
//.interceptor(new PermissionInterceptor())
// 设置不触发错误检测机制(局部设置)
//.unchecked()
.request(new OnPermissionCallback() {
@Override
public void onGranted(@NonNull List<String> permissions, boolean allGranted) {
Log.e(TAG, "onGranted: permissions = " + permissions + " allGranted = " + allGranted);
if (!allGranted) {
ToastUtil.show("获取部分权限成功,但部分权限未正常授予");
Toaster.show("获取部分权限成功,但部分权限未正常授予");
return;
}
// ToastUtil.show("获取录音和日历权限成功");
Log.e(TAG, "onGranted: 获取存储权限成功");
getData();
Log.e(TAG, "onGranted: 获取权限成功");
getLocationPermission();
}
@Override
public void onDenied(@NonNull List<String> permissions, boolean doNotAskAgain) {
Log.e(TAG, "onDenied: permissions = " + permissions + " doNotAskAgain = " + doNotAskAgain);
if (doNotAskAgain) {
ToastUtil.show("被永久拒绝授权,请手动授予存储权限");
Toaster.show("被永久拒绝授权,请手动授予权限");
// 如果是被永久拒绝就跳转到应用权限系统设置页面
XXPermissions.startPermissionActivity(MainActivity.this, permissions);
} else {
// ToastUtil.show("获取录音和日历权限失败");
Log.e(TAG, "onGranted: 获取存储权限权限失败");
Log.e(TAG, "onGranted: 获取权限失败");
}
}
});
}
private void getData() {
// if (!isNotificationListenersEnabled()) {
// ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
// gotoNotificationAccessSetting(this);
// }
// addHomeWatcher();
private String[] mLocationPermission = new String[]{
Permission.ACCESS_COARSE_LOCATION,
Permission.ACCESS_FINE_LOCATION,
Permission.ACCESS_BACKGROUND_LOCATION,
};
private void getLocationPermission() {
XXPermissions.with(this)
// 申请单个权限
.permission(mLocationPermission)
// 申请多个权限
// .permission(Permission.Group.STORAGE)
// 设置权限请求拦截器(局部设置)
//.interceptor(new PermissionInterceptor())
// 设置不触发错误检测机制(局部设置)
//.unchecked()
.request(new OnPermissionCallback() {
@Override
public void onGranted(@NonNull List<String> permissions, boolean allGranted) {
Log.e(TAG, "onGranted: permissions = " + permissions + " allGranted = " + allGranted);
if (!allGranted) {
Toaster.show("获取部分权限成功,但部分权限未正常授予");
return;
}
Log.e(TAG, "onGranted: 获取定位权限成功");
}
@Override
public void onDenied(@NonNull List<String> permissions, boolean doNotAskAgain) {
Log.e(TAG, "onDenied: permissions = " + permissions + " doNotAskAgain = " + doNotAskAgain);
if (doNotAskAgain) {
Toaster.show("被永久拒绝授权,请手动授予定位权限");
// 如果是被永久拒绝就跳转到应用权限系统设置页面
XXPermissions.startPermissionActivity(MainActivity.this, permissions);
} else {
Log.e(TAG, "onGranted: 获取定位权限失败");
}
}
});
}
PrivacyPolicyDialog privacyPolicyDialog;
@@ -543,9 +588,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
@Override
public void onConfirm() {
mMMKV.encode("AgreePrivacyPolicy", 1);
getPermission();
privacyPolicyDialog.dismiss();
getData();
getPermission();
}
});
privacyPolicyDialog.show();
@@ -610,7 +654,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
} catch (Exception e1) {
e1.printStackTrace();
}
ToastUtil.show("对不起,您的手机暂不支持");
Toaster.show("对不起,您的手机暂不支持");
e.printStackTrace();
return false;
}
@@ -642,6 +686,25 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
}
}
private void registmUpdateAddressReceiver() {
mUpdateAddressReceiver = new UpdateAddressReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(CommonConfig.IFLYTEK_UPDATE_ADDRESS_ACTION);
registerReceiver(mUpdateAddressReceiver, filter);
}
private UpdateAddressReceiver mUpdateAddressReceiver;
class UpdateAddressReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (CommonConfig.IFLYTEK_UPDATE_ADDRESS_ACTION.equals(action)) {
AmapManager.getInstance().startLocation();
}
}
}
@Override
public void sendAPPUsageFinish() {

View File

@@ -1,7 +1,7 @@
package com.uiui.zyos.activity.main;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
public class MainContact {
public interface Presenter extends BasePresenter<MainView> {

View File

@@ -17,9 +17,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.uiui.zyos.R;
import com.uiui.zyos.adapter.AppAdapter;
import com.uiui.zyos.base.BaseActivity;
import com.uiui.zyos.base.mvp.BaseMvpActivity;
import com.uiui.zyos.bean.DesktopIcon;
import com.uiui.zyos.fragment.user.UserFragment;
import com.uiui.zyos.view.RecyclerViewSpacesItemDecoration;
import java.util.HashMap;
@@ -28,7 +27,7 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MoreAppActivity extends BaseActivity implements MoreContact.MoreView {
public class MoreAppActivity extends BaseMvpActivity implements MoreContact.MoreView {
@BindView(R.id.iv_back)
ImageView iv_back;
@@ -51,7 +50,7 @@ public class MoreAppActivity extends BaseActivity implements MoreContact.MoreVie
ButterKnife.bind(this);
mPresenter = new MorePresenter(this);
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
mPresenter.setLifecycle(getLifecycleSubject());
iv_back.setOnClickListener(new View.OnClickListener() {
@Override

View File

@@ -1,7 +1,7 @@
package com.uiui.zyos.activity.more;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
import com.uiui.zyos.bean.DesktopIcon;
import java.util.List;

View File

@@ -15,7 +15,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.uiui.zyos.R;
import com.uiui.zyos.activity.PasswordActivity;
import com.uiui.zyos.bean.DesktopIcon;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.manager.AppManager;
@@ -23,7 +22,7 @@ import com.uiui.zyos.utils.ApkUtils;
import com.uiui.zyos.utils.BitmapUtils;
import com.uiui.zyos.utils.IconUtils;
import com.uiui.zyos.utils.OpenApkUtils;
import com.uiui.zyos.utils.ToastUtil;
import com.hjq.toast.Toaster;
import java.util.List;
import java.util.Set;

View File

@@ -16,9 +16,11 @@ import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.hjq.toast.Toaster;
import com.uiui.zyos.R;
import com.uiui.zyos.activity.ManualActivity;
import com.uiui.zyos.activity.PasswordActivity;
import com.uiui.zyos.activity.ServiceActivity;
import com.uiui.zyos.bean.DesktopIcon;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.manager.AppManager;
@@ -27,7 +29,6 @@ import com.uiui.zyos.utils.AppUsedTimeUtils;
import com.uiui.zyos.utils.BitmapUtils;
import com.uiui.zyos.utils.IconUtils;
import com.uiui.zyos.utils.OpenApkUtils;
import com.uiui.zyos.utils.ToastUtil;
import java.util.ArrayList;
import java.util.List;
@@ -69,6 +70,7 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.AppHolder> {
case AppManager.ADD_NAME:
case AppManager.UPDATE_NAME:
case AppManager.MANUAL_NAME:
case AppManager.SERVICE_NAME:
holder.iv_icon.setImageDrawable(desktopIcon.getIcon());
break;
default:
@@ -91,12 +93,16 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.AppHolder> {
break;
case AppManager.MANUAL_NAME:
mContext.startActivity(new Intent(mContext, ManualActivity.class));
break;
case AppManager.SERVICE_NAME:
mContext.startActivity(new Intent(mContext, ServiceActivity.class));
break;
default:
int settingOtherAppInstaller = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.SETTING_OTHER_APPINSTALLER_KEY, 1);
if (settingOtherAppInstaller == 0
&& !ApkUtils.isSystemApp(mContext, desktopIcon.getPackageName()
)) {
ToastUtil.show("已禁止应用打开");
Toaster.show("已禁止应用打开");
} else {
OpenApkUtils.getInstance().openApp(desktopIcon.getPackageName(), desktopIcon.getClassName());
}

View File

@@ -1,151 +0,0 @@
package com.uiui.zyos.base;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.CallSuper;
import androidx.annotation.CheckResult;
import androidx.annotation.ContentView;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.trello.rxlifecycle4.LifecycleProvider;
import com.trello.rxlifecycle4.LifecycleTransformer;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.ActivityEvent;
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import com.uiui.zyos.R;
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
public abstract class BaseActivity extends AppCompatActivity implements LifecycleProvider<ActivityEvent> {
public final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
public BaseActivity() {
super();
}
@ContentView
public BaseActivity(@LayoutRes int contentLayoutId) {
super(contentLayoutId);
}
@Override
@NonNull
@CheckResult
public final Observable<ActivityEvent> lifecycle() {
return lifecycleSubject.hide();
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull ActivityEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
}
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleSubject.onNext(ActivityEvent.CREATE);
// StatusBarUtil.init(this);
UltimateBarX.statusBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
// .light(true)
.apply();
UltimateBarX.navigationBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
// .light(true)
.apply();
setContentView(this.getLayoutId());
// hideStatusBar(this);
initView();
initData();
}
// public static void hideStatusBar(Activity activity) {
// if (activity == null) return;
// Window window = activity.getWindow();
// if (window == null) return;
// window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
// WindowManager.LayoutParams.FLAG_FULLSCREEN);
// window.getDecorView()
// .setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
// WindowManager.LayoutParams lp = window.getAttributes();
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
// }
// window.setAttributes(lp);
// }
/**
* 设置布局
*/
public abstract int getLayoutId();
/**
* 初始化视图
*/
public abstract void initView();
/**
* 初始化数据
*/
public abstract void initData();
@Override
@CallSuper
protected void onStart() {
super.onStart();
lifecycleSubject.onNext(ActivityEvent.START);
}
@Override
@CallSuper
protected void onResume() {
super.onResume();
lifecycleSubject.onNext(ActivityEvent.RESUME);
}
@Override
@CallSuper
protected void onPause() {
lifecycleSubject.onNext(ActivityEvent.PAUSE);
super.onPause();
}
@Override
@CallSuper
protected void onStop() {
lifecycleSubject.onNext(ActivityEvent.STOP);
super.onStop();
}
@Override
@CallSuper
protected void onDestroy() {
lifecycleSubject.onNext(ActivityEvent.DESTROY);
super.onDestroy();
}
}

View File

@@ -11,10 +11,12 @@ import android.util.Log;
import com.alibaba.sdk.android.push.CloudPushService;
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
import com.arialyy.aria.core.Aria;
import com.hjq.toast.Toaster;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.mmkv.MMKV;
import com.uiui.zyos.BuildConfig;
import com.uiui.zyos.alarm.AlarmUtils;
import com.uiui.zyos.manager.AmapManager;
import com.uiui.zyos.manager.AppManager;
import com.uiui.zyos.manager.ConnectManager;
import com.uiui.zyos.manager.RemoteManager;
@@ -52,7 +54,9 @@ public class BaseApplication extends Application {
if (SystemUtils.isMainProcessName(this, android.os.Process.myPid())) {
String rootDir = MMKV.initialize(this);
Log.e(TAG, "mmkv root: " + rootDir);
// 初始化 Toast 框架
Toaster.init(this);
AmapManager.init(this);
AppManager.init(this);
PushManager.init(this);
RemoteManager.init(this);

View File

@@ -3,121 +3,66 @@ package com.uiui.zyos.base;
import android.os.Bundle;
import androidx.annotation.CallSuper;
import androidx.annotation.CheckResult;
import androidx.annotation.ContentView;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.trello.rxlifecycle4.LifecycleProvider;
import com.trello.rxlifecycle4.LifecycleTransformer;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.ActivityEvent;
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import com.uiui.zyos.R;
import com.uiui.zyos.base.rx.BaseRxActivity;
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
public abstract class BaseDataBindingActivity extends AppCompatActivity implements LifecycleProvider<ActivityEvent> {
public final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
public abstract class BaseDataBindingActivity extends BaseRxActivity {
public BaseDataBindingActivity() {
super();
}
@ContentView
public BaseDataBindingActivity(@LayoutRes int contentLayoutId) {
super(contentLayoutId);
}
@Override
@NonNull
@CheckResult
public final Observable<ActivityEvent> lifecycle() {
return lifecycleSubject.hide();
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull ActivityEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
}
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleSubject.onNext(ActivityEvent.CREATE);
// StatusBarUtil.init(this);
UltimateBarX.statusBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
.light(true)
.light(setNightMode())
.fitWindow(setfitWindow())
.apply();
UltimateBarX.navigationBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
.light(true)
.light(setNightMode())
.fitWindow(setfitWindow())
.apply();
initDataBinding();
initView();
initData();
}
/**
* @return 是否是黑色状态栏
*/
// protected abstract boolean setNightMode();
public boolean setNightMode() {
return false;
}
/**
* @return 是否是入侵
*/
// protected abstract boolean setNightMode();
public boolean setfitWindow() {
return false;
}
protected abstract void initDataBinding();
/**
* 初始化视图
*/
public abstract void initView();
protected abstract void initView();
/**
* 初始化数据
*/
public abstract void initData();
@Override
@CallSuper
protected void onStart() {
super.onStart();
lifecycleSubject.onNext(ActivityEvent.START);
}
@Override
@CallSuper
protected void onResume() {
super.onResume();
lifecycleSubject.onNext(ActivityEvent.RESUME);
}
@Override
@CallSuper
protected void onPause() {
lifecycleSubject.onNext(ActivityEvent.PAUSE);
super.onPause();
}
@Override
@CallSuper
protected void onStop() {
lifecycleSubject.onNext(ActivityEvent.STOP);
super.onStop();
}
@Override
@CallSuper
protected void onDestroy() {
lifecycleSubject.onNext(ActivityEvent.DESTROY);
super.onDestroy();
}
}
protected abstract void initData();
}

View File

@@ -1,72 +1,15 @@
package com.uiui.zyos.base;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.CallSuper;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.uiui.zyos.base.rx.BaseRxFragment;
import com.trello.rxlifecycle4.LifecycleProvider;
import com.trello.rxlifecycle4.LifecycleTransformer;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.FragmentEvent;
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
public abstract class BaseFragment extends Fragment implements LifecycleProvider<FragmentEvent> {
public final BehaviorSubject<FragmentEvent> lifecycleSubject = BehaviorSubject.create();
public abstract class BaseFragment extends BaseRxFragment {
protected boolean isViewInitiated;
protected boolean isVisibleToUser;
protected boolean isDataInitiated;
@Override
@NonNull
@CheckResult
public final Observable<FragmentEvent> lifecycle() {
return lifecycleSubject.hide();
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull FragmentEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindFragment(lifecycleSubject);
}
@Override
@CallSuper
public void onAttach(android.app.Activity activity) {
super.onAttach(activity);
lifecycleSubject.onNext(FragmentEvent.ATTACH);
}
@Override
@CallSuper
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleSubject.onNext(FragmentEvent.CREATE);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
@@ -91,65 +34,11 @@ public abstract class BaseFragment extends Fragment implements LifecycleProvider
public boolean prepareFetchData(boolean forceUpdate) {
if (isVisibleToUser && isViewInitiated && (!isDataInitiated || forceUpdate)) {
fetchData();
//注释掉保证每次都更新数据
isDataInitiated = true;
return true;
}
return false;
}
@Override
@CallSuper
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
lifecycleSubject.onNext(FragmentEvent.CREATE_VIEW);
}
@Override
@CallSuper
public void onStart() {
super.onStart();
lifecycleSubject.onNext(FragmentEvent.START);
}
@Override
@CallSuper
public void onResume() {
super.onResume();
lifecycleSubject.onNext(FragmentEvent.RESUME);
}
@Override
@CallSuper
public void onPause() {
lifecycleSubject.onNext(FragmentEvent.PAUSE);
super.onPause();
}
@Override
@CallSuper
public void onStop() {
lifecycleSubject.onNext(FragmentEvent.STOP);
super.onStop();
}
@Override
@CallSuper
public void onDestroyView() {
lifecycleSubject.onNext(FragmentEvent.DESTROY_VIEW);
super.onDestroyView();
}
@Override
@CallSuper
public void onDestroy() {
lifecycleSubject.onNext(FragmentEvent.DESTROY);
super.onDestroy();
}
@Override
@CallSuper
public void onDetach() {
lifecycleSubject.onNext(FragmentEvent.DETACH);
super.onDetach();
}
}

View File

@@ -0,0 +1,57 @@
package com.uiui.zyos.base;
import android.os.Bundle;
import androidx.annotation.CallSuper;
import androidx.annotation.Nullable;
import com.uiui.zyos.R;
import com.uiui.zyos.base.rx.BaseRxActivity;
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
public abstract class BaseTransparentActivity extends BaseRxActivity {
public BaseTransparentActivity() {
super();
}
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// StatusBarUtil.init(this);
UltimateBarX.statusBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
.light(setNightMode())
.fitWindow(setfitWindow())
.apply();
UltimateBarX.navigationBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
.light(setNightMode())
.fitWindow(setfitWindow())
.apply();
}
/**
* 设置布局
*/
protected abstract int getLayoutId();
/**
* @return 是否是黑色状态栏
*/
// protected abstract boolean setNightMode();
public boolean setNightMode() {
return false;
}
/**
* @return 是否是入侵
*/
// protected abstract boolean setNightMode();
public boolean setfitWindow() {
return false;
}
}

View File

@@ -1,4 +0,0 @@
package com.uiui.zyos.base;
public interface BaseView {
}

View File

@@ -0,0 +1,34 @@
package com.uiui.zyos.base.mvp;
import android.os.Bundle;
import androidx.annotation.CallSuper;
import androidx.annotation.Nullable;
import com.uiui.zyos.base.BaseTransparentActivity;
public abstract class BaseMvpActivity extends BaseTransparentActivity {
public BaseMvpActivity() {
super();
}
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getLayoutId());
initView();
initData();
}
/**
* 初始化视图
*/
protected abstract void initView();
/**
* 初始化数据
*/
protected abstract void initData();
}

View File

@@ -1,4 +1,4 @@
package com.uiui.zyos.base;
package com.uiui.zyos.base.mvp;
import androidx.annotation.NonNull;

View File

@@ -0,0 +1,4 @@
package com.uiui.zyos.base.mvp;
public interface BaseView {
}

View File

@@ -0,0 +1,54 @@
package com.uiui.zyos.base.mvvm;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.uiui.zyos.base.BaseTransparentActivity;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
public abstract class BaseMvvmActivity<VM extends ViewModel, VDB extends ViewDataBinding> extends BaseTransparentActivity {
private static final String TAG = BaseMvvmActivity.class.getSimpleName();
protected VM mViewModel;
protected VDB mViewDataBinding;
protected Class<VM> vmClass;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//ViewDataBinding
mViewDataBinding = DataBindingUtil.setContentView(this, getLayoutId());
mViewDataBinding.setLifecycleOwner(this);
//ViewModel
vmClass = (Class<VM>) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
boolean isAbstract = Modifier.isAbstract(vmClass.getModifiers());
Log.e(TAG, "isLocalClass:" + vmClass.getSimpleName().equals(ViewModel.class.getSimpleName()) + " isAbstract:" + isAbstract);
if (!isAbstract) {//不是一个抽象类
mViewModel = new ViewModelProvider(this).get(vmClass);
}
initDataBinding();
initView();
initData();
}
protected abstract void initDataBinding();
/**
* 初始化视图
*/
protected abstract void initView();
/**
* 初始化数据
*/
protected abstract void initData();
}

View File

@@ -0,0 +1,71 @@
package com.uiui.zyos.base.mvvm;
import android.content.Context;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModel;
import java.lang.ref.WeakReference;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
/**
* 所有viewmodel的基类
*/
public abstract class BaseViewModel<VDB extends ViewDataBinding, T> extends ViewModel implements ViewDataBindingCallback {
/**
* 当前viewmodel对应的页面binding
*/
protected VDB binding;
@Override
public void setVDBinding(ViewDataBinding vdBinding) {
binding = (VDB) vdBinding;
}
@Override
public VDB getVDBinding() {
if (binding == null) {
throw new NullPointerException("BaseViewModel >> getVDBinding >> null!!!");
}
return binding;
}
/**
* 上下文
*/
private WeakReference<Context> ctx;
@Override
public void setCtx(Context context) {
if (ctx == null) {
ctx = new WeakReference<>(context);
}
}
@Override
public Context getCtx() {
if (ctx == null) {
throw new NullPointerException("BaseViewModel >> getCtx >> null!!!");
}
return ctx.get();
}
public abstract void onDestroy();
private BehaviorSubject<T> mBehaviorSubject;
@Override
public void setLifecycle(BehaviorSubject subject) {
this.mBehaviorSubject = (BehaviorSubject<T>) subject;
}
@Override
public BehaviorSubject<T> getLifecycle() {
return mBehaviorSubject;
}
}

View File

@@ -0,0 +1,26 @@
package com.uiui.zyos.base.mvvm;
import android.content.Context;
import androidx.databinding.ViewDataBinding;
import com.trello.rxlifecycle4.android.ActivityEvent;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
public interface ViewDataBindingCallback<VDB extends ViewDataBinding> {
void setVDBinding(VDB binding);
VDB getVDBinding() throws NullPointerException;
void setCtx(Context context);
Context getCtx() throws NullPointerException;
void setLifecycle(BehaviorSubject<ActivityEvent> subject);
BehaviorSubject<ActivityEvent> getLifecycle();
}

View File

@@ -1,11 +1,9 @@
package com.uiui.zyos.base;
package com.uiui.zyos.base.rx;
import android.os.Bundle;
import androidx.annotation.CallSuper;
import androidx.annotation.CheckResult;
import androidx.annotation.ContentView;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@@ -15,23 +13,19 @@ import com.trello.rxlifecycle4.LifecycleTransformer;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.ActivityEvent;
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import com.uiui.zyos.R;
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
/**
* {@link com.trello.rxlifecycle4.components.RxActivity}
* copied form RxActivity}
*/
public abstract class BaseRxActivity extends AppCompatActivity implements LifecycleProvider<ActivityEvent> {
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
public abstract class BaseLightActivity extends AppCompatActivity implements LifecycleProvider<ActivityEvent> {
public final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
public BaseLightActivity() {
super();
}
@ContentView
public BaseLightActivity(@LayoutRes int contentLayoutId) {
super(contentLayoutId);
public BehaviorSubject<ActivityEvent> getLifecycleSubject() {
return lifecycleSubject;
}
@Override
@@ -60,38 +54,8 @@ public abstract class BaseLightActivity extends AppCompatActivity implements Lif
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleSubject.onNext(ActivityEvent.CREATE);
// StatusBarUtil.init(this);
UltimateBarX.statusBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
.light(true)
.apply();
UltimateBarX.navigationBar(this)
.transparent()
.colorRes(R.color.colorPrimaryDark)
.light(true)
.apply();
setContentView(this.getLayoutId());
initView();
initData();
}
/**
* 设置布局
*/
public abstract int getLayoutId();
/**
* 初始化视图
*/
public abstract void initView();
/**
* 初始化数据
*/
public abstract void initData();
@Override
@CallSuper
protected void onStart() {
@@ -127,3 +91,4 @@ public abstract class BaseLightActivity extends AppCompatActivity implements Lif
super.onDestroy();
}
}

View File

@@ -0,0 +1,123 @@
package com.uiui.zyos.base.rx;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.CallSuper;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.trello.rxlifecycle4.LifecycleProvider;
import com.trello.rxlifecycle4.LifecycleTransformer;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.FragmentEvent;
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
/**
* {@link com.trello.rxlifecycle4.components.RxFragment}
* copied form RxFragment}
*/
public class BaseRxFragment extends Fragment implements LifecycleProvider<FragmentEvent> {
private final BehaviorSubject<FragmentEvent> lifecycleSubject = BehaviorSubject.create();
public BehaviorSubject<FragmentEvent> getLifecycleSubject() {
return lifecycleSubject;
}
@Override
@NonNull
@CheckResult
public final Observable<FragmentEvent> lifecycle() {
return lifecycleSubject.hide();
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull FragmentEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindFragment(lifecycleSubject);
}
@Override
@CallSuper
public void onAttach(android.app.Activity activity) {
super.onAttach(activity);
lifecycleSubject.onNext(FragmentEvent.ATTACH);
}
@Override
@CallSuper
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleSubject.onNext(FragmentEvent.CREATE);
}
@Override
@CallSuper
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
lifecycleSubject.onNext(FragmentEvent.CREATE_VIEW);
}
@Override
@CallSuper
public void onStart() {
super.onStart();
lifecycleSubject.onNext(FragmentEvent.START);
}
@Override
@CallSuper
public void onResume() {
super.onResume();
lifecycleSubject.onNext(FragmentEvent.RESUME);
}
@Override
@CallSuper
public void onPause() {
lifecycleSubject.onNext(FragmentEvent.PAUSE);
super.onPause();
}
@Override
@CallSuper
public void onStop() {
lifecycleSubject.onNext(FragmentEvent.STOP);
super.onStop();
}
@Override
@CallSuper
public void onDestroyView() {
lifecycleSubject.onNext(FragmentEvent.DESTROY_VIEW);
super.onDestroyView();
}
@Override
@CallSuper
public void onDestroy() {
lifecycleSubject.onNext(FragmentEvent.DESTROY);
super.onDestroy();
}
@Override
@CallSuper
public void onDetach() {
lifecycleSubject.onNext(FragmentEvent.DETACH);
super.onDetach();
}
}

View File

@@ -1,8 +1,9 @@
package com.uiui.zyos.base;
package com.uiui.zyos.base.rx;
import android.app.Service;
import android.content.Intent;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.trello.rxlifecycle4.LifecycleProvider;
@@ -14,25 +15,31 @@ import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
public abstract class BaseRxService extends Service implements LifecycleProvider<ActivityEvent> {
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
public abstract class BaseService extends Service implements LifecycleProvider<ActivityEvent> {
public final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
public BaseService() {
super();
public BehaviorSubject<ActivityEvent> getLifecycleSubject() {
return lifecycleSubject;
}
@Override
@NonNull
@CheckResult
public final Observable<ActivityEvent> lifecycle() {
return lifecycleSubject.hide();
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull ActivityEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
}

View File

@@ -22,6 +22,9 @@ public class CommonConfig {
/*是否显示返回Android按钮*/
public static final String UIUI_RETURN_ANDROID_KEY = "iflytek_uiui_is_return_android";
/*让桌面更新定位信息*/
public static final String IFLYTEK_UPDATE_ADDRESS_ACTION = "IFLYTEK_UPDATE_ADDRESS";
public static final String MAP_LOCATION_JSON_KEY = "MAPLOCATION_JSON_STRING";
public static final String MAP_LONGITUDE_KEY = "map_longitude_key";
public static final String MAP_LATITUDE_KEY = "map_latitude_key";
@@ -31,4 +34,10 @@ public class CommonConfig {
public static final String SETTING_OTHER_APPINSTALLER_KEY = "iflytek_setting_other_appInstaller";
/*应用市场的app列表*/
public final static String ADMIN_APP_LIST = "only_admin_app_list";
/*默认地址北京*/
public static final String DEFAULT_LOCATION_DISTRICT = "北京";
/*手动选择位置 经纬度*/
public static final String MANUALLY_SELECT_LOCATION_TUDE = "map_manually_select_tude";
/*默认北京原点*/
public static final String DEFAULT_LOCATION_TUDE = "116.40529,39.90499";
}

View File

@@ -1,7 +1,7 @@
package com.uiui.zyos.fragment.app;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
import com.uiui.zyos.bean.DesktopIcon;
import java.util.ArrayList;

View File

@@ -109,7 +109,7 @@ public class AppFragment extends BaseFragment implements AppContact.AppView {
mContext = (FragmentActivity) rootView.getContext();
mPresenter = new AppPresenter(mContext);
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
mPresenter.setLifecycle(getLifecycleSubject());
ButterKnife.bind(this, rootView);
initView();
}

View File

@@ -44,17 +44,31 @@ public class AppPresenter implements AppContact.AppPresenter {
@Override
public void getInstalledApp() {
ArrayList<DesktopIcon> desktopIcons = AppManager.getInstance().getFilterAppList();
DesktopIcon appstoreDesktopIcon = new DesktopIcon();
appstoreDesktopIcon.setLable("应用市场");
appstoreDesktopIcon.setPackageName(AppManager.APPSTORE_PACKAGE_NAME);
appstoreDesktopIcon.setClassName(AppManager.APPSTORE_CLASS_NAME);
appstoreDesktopIcon.setIcon(mContext.getDrawable(R.drawable.com_android_appstore));
desktopIcons.add(desktopIcons.size(), appstoreDesktopIcon);
DesktopIcon updateDesktopIcon = new DesktopIcon();
updateDesktopIcon.setLable("应用更新");
updateDesktopIcon.setPackageName(AppManager.UPDATE_NAME);
updateDesktopIcon.setIcon(mContext.getDrawable(R.drawable.icon_update));
desktopIcons.add(desktopIcons.size(), updateDesktopIcon);
DesktopIcon manualIcon = new DesktopIcon();
manualIcon.setLable("使用手册");
manualIcon.setPackageName(AppManager.MANUAL_NAME);
manualIcon.setIcon(mContext.getDrawable(R.drawable.icon_manual));
desktopIcons.add(desktopIcons.size(), manualIcon);
// DesktopIcon manualIcon = new DesktopIcon();
// manualIcon.setLable("使用手册");
// manualIcon.setPackageName(AppManager.MANUAL_NAME);
// manualIcon.setIcon(mContext.getDrawable(R.drawable.icon_manual));
// desktopIcons.add(desktopIcons.size(), manualIcon);
DesktopIcon serviceIcon = new DesktopIcon();
serviceIcon.setIcon(mContext.getDrawable(R.drawable.service_icon));
serviceIcon.setLable("联系客服");
serviceIcon.setPackageName(AppManager.SERVICE_NAME);
desktopIcons.add(serviceIcon);
DesktopIcon desktopIcon = new DesktopIcon();
desktopIcon.setLable("添加应用");

View File

@@ -49,7 +49,7 @@ public class BiologyFragment extends BaseFragment {
public BiologyFragment() {
// Required empty public constructor
Log.e(TAG, "BiologyFragment: " );
Log.e(TAG, "BiologyFragment: ");
}
/**
@@ -110,7 +110,7 @@ public class BiologyFragment extends BaseFragment {
rootView = null;
}
private void initView(){
private void initView() {
imageView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -132,7 +132,11 @@ public class BiologyFragment extends BaseFragment {
imageView4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("1");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "生物");
} else {
OpenApkUtils.getInstance().openPrecision("1");
}
}
});

View File

@@ -133,7 +133,11 @@ public class ChemicalFragment extends BaseFragment {
imageView4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("1");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "化学");
} else {
OpenApkUtils.getInstance().openPrecision("1");
}
}
});

View File

@@ -1,8 +1,8 @@
package com.uiui.zyos.fragment.chinese;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
public class ChineseContact {
public interface Presenter extends BasePresenter<ChineseView> {

View File

@@ -25,6 +25,7 @@ import com.uiui.zyos.base.BaseFragment;
import com.uiui.zyos.dialog.ChineseDialog;
import com.uiui.zyos.dialog.FoundationDialog;
import com.uiui.zyos.jxw.JxwPackageConfig;
import com.uiui.zyos.manager.AmapManager;
import com.uiui.zyos.manager.RemoteManager;
import com.uiui.zyos.utils.OpenApkUtils;
import com.uiui.zyos.utils.Utils;
@@ -137,7 +138,7 @@ public class ChineseFragment extends BaseFragment implements ChineseContact.Chin
@Override
public void fetchData() {
Log.e(TAG, "fetchData: ");
RemoteManager.getInstance().getLocation();
AmapManager.getInstance().startLocation();
initData();
}
@@ -155,7 +156,7 @@ public class ChineseFragment extends BaseFragment implements ChineseContact.Chin
mContext = (Activity) rootView.getContext();
mChinesePresenter = new ChinesePresenter(mContext);
mChinesePresenter.attachView(this);
mChinesePresenter.setLifecycle(lifecycleSubject);
mChinesePresenter.setLifecycle(getLifecycleSubject());
ButterKnife.bind(this, rootView);
initView();
}
@@ -258,7 +259,11 @@ public class ChineseFragment extends BaseFragment implements ChineseContact.Chin
iv_dictation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("1");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "语文");
} else {
OpenApkUtils.getInstance().openPrecision("1");
}
}
});
iv_character.setOnClickListener(new View.OnClickListener() {

View File

@@ -202,7 +202,11 @@ public class EnglishFragment extends BaseFragment {
imageView11.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("1");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "英语");
} else {
OpenApkUtils.getInstance().openPrecision("1");
}
}
});
}

View File

@@ -1,7 +1,7 @@
package com.uiui.zyos.fragment.main;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
public class MainContact {
public interface Presenter extends BasePresenter<MainView> {

View File

@@ -18,7 +18,7 @@ import android.view.ViewGroup;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseFragment;
import com.uiui.zyos.base.viewpager.BaseFragmentPagerAdapter;
import com.uiui.zyos.view.viewpager.BaseFragmentPagerAdapter;
import com.uiui.zyos.fragment.subject.SubjectFragment;
import com.uiui.zyos.fragment.user.UserFragment;
import com.uiui.zyos.utils.OpenApkUtils;
@@ -133,7 +133,7 @@ public class MainFragment extends BaseFragment implements MainContact.MainView {
mContext = (FragmentActivity) rootView.getContext();
mPresenter = new MainFPresenter(mContext);
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
mPresenter.setLifecycle(getLifecycleSubject());
ButterKnife.bind(this, rootView);
initView();
}

View File

@@ -170,7 +170,7 @@ public class MathFragment extends BaseFragment {
cl_classical.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_ARITHMETIC_PACKAGE_NAME,JxwPackageConfig.JXW_ARITHMETIC_CLASS_NAME);
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_ARITHMETIC_PACKAGE_NAME, JxwPackageConfig.JXW_ARITHMETIC_CLASS_NAME);
}
});
@@ -183,7 +183,7 @@ public class MathFragment extends BaseFragment {
cl_number.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_KNOW_MATHEMATICS_PACKAGE_NAME,JxwPackageConfig.JXW_KNOW_MATHEMATICS_CLASS_NAME);
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_KNOW_MATHEMATICS_PACKAGE_NAME, JxwPackageConfig.JXW_KNOW_MATHEMATICS_CLASS_NAME);
}
});
cl_formula.setOnClickListener(new View.OnClickListener() {
@@ -196,7 +196,11 @@ public class MathFragment extends BaseFragment {
iv_precision_learning.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("2");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "数学");
} else {
OpenApkUtils.getInstance().openPrecision("2");
}
}
});
}

View File

@@ -2,15 +2,14 @@ package com.uiui.zyos.fragment.physics;
import android.app.Activity;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseFragment;
import com.uiui.zyos.utils.OpenApkUtils;
@@ -49,7 +48,7 @@ public class PhysicsFragment extends BaseFragment {
public PhysicsFragment() {
// Required empty public constructor
Log.e(TAG, "PhysicsFragment: " );
Log.e(TAG, "PhysicsFragment: ");
}
/**
@@ -110,7 +109,7 @@ public class PhysicsFragment extends BaseFragment {
rootView = null;
}
private void initView(){
private void initView() {
imageView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -132,7 +131,11 @@ public class PhysicsFragment extends BaseFragment {
imageView4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("1");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "物理");
} else {
OpenApkUtils.getInstance().openPrecision("1");
}
}
});

View File

@@ -118,15 +118,16 @@ public class PrecisionFragment extends BaseFragment {
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
Log.e(TAG, "setUserVisibleHint: isVisibleToUser = " + isVisibleToUser);
if (isVisibleToUser){
if (mUserVisibleHintCallback!=null) {
if (isVisibleToUser) {
if (mUserVisibleHintCallback != null) {
mUserVisibleHintCallback.onUserVisibleHint();
}
}
}
private ARStudyFragment.UserVisibleHintCallback mUserVisibleHintCallback;
public interface UserVisibleHintCallback{
public interface UserVisibleHintCallback {
void onUserVisibleHint();
}
@@ -138,31 +139,51 @@ public class PrecisionFragment extends BaseFragment {
iv_bunk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("1");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(0, "语文");
} else {
OpenApkUtils.getInstance().openPrecision("1");
}
}
});
iv_paper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("3");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(5, "语文");
} else {
OpenApkUtils.getInstance().openPrecision("3");
}
}
});
iv_test.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("2");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(1, "语文");
} else {
OpenApkUtils.getInstance().openPrecision("2");
}
}
});
iv_book.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("4");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(4, "语文");
} else {
OpenApkUtils.getInstance().openPrecision("4");
}
}
});
iv_favorites.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
OpenApkUtils.getInstance().openPrecision("5");
if (OpenApkUtils.getInstance().isNewAiApp()) {
OpenApkUtils.getInstance().openAiPrecision(3, "语文");
} else {
OpenApkUtils.getInstance().openPrecision("5");
}
}
});
}

View File

@@ -15,7 +15,7 @@ import android.view.ViewGroup;
import com.flyco.tablayout.SlidingTabLayout;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseFragment;
import com.uiui.zyos.base.viewpager.BaseFragmentPagerAdapter;
import com.uiui.zyos.view.viewpager.BaseFragmentPagerAdapter;
import com.uiui.zyos.fragment.app.AppFragment;
import com.uiui.zyos.fragment.ar.ARStudyFragment;
import com.uiui.zyos.fragment.biology.BiologyFragment;

View File

@@ -2,8 +2,8 @@ package com.uiui.zyos.fragment.user;
import android.graphics.Bitmap;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
import com.uiui.zyos.bean.BaseResponse;
import com.uiui.zyos.bean.DesktopIcon;
import com.uiui.zyos.bean.SnInfo;

View File

@@ -179,7 +179,7 @@ public class UserFragment extends BaseFragment implements UserContact.UserView {
mContext = (FragmentActivity) rootView.getContext();
mPresenter = new UserPresenter(mContext);
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
mPresenter.setLifecycle(getLifecycleSubject());
ButterKnife.bind(this, rootView);
initView();
}
@@ -318,7 +318,7 @@ public class UserFragment extends BaseFragment implements UserContact.UserView {
// passwordDialog.dismiss();
// exitDesktop();
// } else {
// ToastUtil.show("密码错误");
// Toaster.show("密码错误");
// }
// }
//
@@ -414,7 +414,7 @@ public class UserFragment extends BaseFragment implements UserContact.UserView {
cl_usedata.setVisibility(View.GONE);
iv_bind.setImageDrawable(mContext.getDrawable(R.drawable.icon_device_unbind));
break;
// ToastUtil.show(getString(R.string.device_unauthorized));
// Toaster.show(getString(R.string.device_unauthorized));
// Log.e(TAG, "setSnInfo: " + getString(R.string.device_unauthorized));
// tv_name.setText(getString(R.string.device_unauthorized));
// tv_grade.setText(getString(R.string.device_unauthorized));

View File

@@ -144,6 +144,14 @@ public class UserPresenter implements UserContact.Presenter {
@Override
public void getInstalledApp() {
ArrayList<DesktopIcon> desktopIcons = AppManager.getInstance().getFilterAppList();
DesktopIcon appstoreDesktopIcon = new DesktopIcon();
appstoreDesktopIcon.setLable("应用市场");
appstoreDesktopIcon.setPackageName(AppManager.APPSTORE_PACKAGE_NAME);
appstoreDesktopIcon.setPackageName(AppManager.APPSTORE_CLASS_NAME);
appstoreDesktopIcon.setIcon(mContext.getDrawable(R.drawable.com_android_appstore));
desktopIcons.add(desktopIcons.size(), appstoreDesktopIcon);
DesktopIcon updateDesktopIcon = new DesktopIcon();
updateDesktopIcon.setLable("应用更新");
updateDesktopIcon.setPackageName(AppManager.UPDATE_NAME);

View File

@@ -30,7 +30,8 @@ public class JxwPackageConfig {
public static final String JXW_CHARACTER_CLASS_NAME = "com.jxw.characterlearning.MainActivity";
/*Ai精准学*/
public static final String JXW_PRECISION_PACKAGE_NAME = "com.jxw.question";
public static final String JXW_PRECISION_CLASS_NAME = "com.jxw.question.activity.SplashActivity";
public static final String JXW_PRECISION_CLASS_NAME_85 = "com.jxw.question.activity.SplashActivity";
public static final String JXW_PRECISION_CLASS_NAME_1 = "com.jxw.question.module.ui.activity.ProgramEntryActivity";
/*拼音学习*/
public static final String JXW_PINYIN_PACKAGE_NAME = "com.jxw.learnchinesepinyin";
public static final String JXW_PINYIN_CLASS_NAME = "com.jxw.learnchinesepinyin.activity.MainActivity";
@@ -90,5 +91,7 @@ public class JxwPackageConfig {
/*幼儿平台*/
public static final String JXW_YOUER_PACKAGE_NAME = "com.jxw.youer.video";
public static final String JXW_YOUER_CLASS_NAME = "com.jxw.youer.activity.MainActivity";
/*模拟考场*/
public static final String JXW_EXAMSYSTEM_NAME ="com.jxw.examsystem";
public static final String JXW_EXAMSYSTEM_CLASS ="com.jxw.examsystem.StartExamActivity";
}

View File

@@ -0,0 +1,216 @@
package com.uiui.zyos.manager;
import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.tencent.mmkv.MMKV;
import com.uiui.zyos.bean.BaseResponse;
import com.uiui.zyos.bean.MapBean;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.gson.GsonUtils;
import com.uiui.zyos.network.NetInterfaceManager;
import com.uiui.zyos.utils.ActivationUtil;
import java.lang.reflect.Type;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
public class AmapManager {
private static final String TAG = AmapManager.class.getSimpleName();
MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
@SuppressLint("StaticFieldLeak")
private static AmapManager sInstance;
private Context mContext;
private AMapLocationClient mAMapLocationClient;
private AMapLocationClientOption mAMapLocationClientOption;
private MapBean mMapBean;
private AmapManager(Context context) {
this.mContext = context;
initAmap();
}
public static void init(Context context) {
if (context == null) {
throw new RuntimeException("Context is NULL");
}
if (sInstance == null) {
sInstance = new AmapManager(context);
}
}
public static AmapManager getInstance() {
if (sInstance == null) {
throw new IllegalStateException("You must be init AmapManager first");
}
return sInstance;
}
private AMapLocationClientOption getDefaultOption() {
if (mAMapLocationClientOption == null) {
mAMapLocationClientOption = new AMapLocationClientOption();
}
mAMapLocationClientOption.setLocationPurpose(AMapLocationClientOption.AMapLocationPurpose.SignIn);
//设置定位模式为AMapLocationMode.Hight_Accuracy高精度模式。
mAMapLocationClientOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
mAMapLocationClientOption.setNeedAddress(true);
//获取一次定位结果:
//该方法默认为false。
mAMapLocationClientOption.setOnceLocation(true);
//获取最近3s内精度最高的一次定位结果
//设置setOnceLocationLatest(boolean b)接口为true启动定位时SDK会返回最近3s内精度最高的一次定位结果。
// 如果设置其为truesetOnceLocation(boolean b)接口也会被设置为true反之不会默认为false。
mAMapLocationClientOption.setOnceLocationLatest(true);
return mAMapLocationClientOption;
}
public void initAmap() {
if (mAMapLocationClient == null) {
mAMapLocationClient = new AMapLocationClient(mContext);
}
mAMapLocationClient.setLocationOption(getDefaultOption());
//设置定位监听
mAMapLocationClient.setLocationListener(mAMapLocationListener);
//设置场景模式后最好调用一次stop再调用start以保证场景模式生效
startLocation();
String jsonString = mMMKV.decodeString(CommonConfig.MAP_LOCATION_JSON_KEY, "");
if (!TextUtils.isEmpty(jsonString)) {
Gson gson = new Gson();
Type type = new TypeToken<MapBean>() {
}.getType();
mMapBean = gson.fromJson(jsonString, type);
} else {
Log.e(TAG, "initAmap: jsonString is empty");
}
}
public void startLocation() {
boolean activation = ActivationUtil.isActivation(mContext);
if (!activation) {
return;
}
mAMapLocationClient.stopLocation();
mAMapLocationClient.startLocation();
Log.e(TAG, "initAmap: " + "startLocation");
}
private AMapLocationListener mAMapLocationListener = new AMapLocationListener() {
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
StringBuilder sb = new StringBuilder();
//errCode等于0代表定位成功其他的为定位失败具体的可以参照官网定位错误码说明
if (aMapLocation.getErrorCode() == 0) {
Log.e(TAG, "onLocationChanged: " + "定位成功");
updateAddress(aMapLocation);
mMapBean = getMapBean(aMapLocation);
saveMapResult(mMapBean);
LiveEventBus.get("MapBean")
.post(mMapBean);
Log.e(TAG, "onLocationChanged: " + aMapLocation.getAddress());
sb.append(aMapLocation.getAddress()).append("\n");
} else {
//定位失败
sb.append("定位失败" + "\n");
sb.append(aMapLocation.getErrorInfo());
Log.e(TAG, "onLocationChanged: " + "定位失败");
}
Log.e(TAG, "amap: " + sb.toString());
}
};
private void updateAddress(AMapLocation aMapLocation) {
boolean activation = ActivationUtil.isActivation(mContext);
if (!activation) {
return;
}
NetInterfaceManager.getInstance().getUpdateAddressObservable(aMapLocation.getAddress()
, aMapLocation.getLongitude(), aMapLocation.getLatitude()
)
.subscribe(new Observer<BaseResponse>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("updateAddress", "onSubscribe: ");
}
@Override
public void onNext(@NonNull BaseResponse baseResponse) {
Log.e("updateAddress", "onNext: " + baseResponse);
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("updateAddress", "onError: " + e.getMessage());
}
@Override
public void onComplete() {
Log.e("updateAddress", "onComplete: ");
}
});
}
public String getLocationTude() {
if (mMapBean != null) {
return mMapBean.getLongitude() + "," + mMapBean.getLatitude();
} else {
startLocation();
return CommonConfig.DEFAULT_LOCATION_TUDE;
}
}
public String getDistrict() {
if (mMapBean != null) {
return mMapBean.getDistrict();
} else {
startLocation();
return CommonConfig.DEFAULT_LOCATION_DISTRICT;
}
}
private MapBean getMapBean(AMapLocation location) {
MapBean mapBean = new MapBean();
mapBean.setLongitude(location.getLongitude());
mapBean.setLatitude(location.getLatitude());
mapBean.setAdcode(location.getAdCode());
mapBean.setAddress(location.getAddress());
mapBean.setCity(location.getCity());
mapBean.setCityCode(location.getCityCode());
mapBean.setCountry(location.getCountry());
mapBean.setCountryCode(location.getAdCode());
mapBean.setDistrict(location.getDistrict());
mapBean.setProvince(location.getProvince());
mapBean.setStreet(location.getStreet());
mapBean.setStreetNumber(location.getStreetNum());
mapBean.setTown(location.getStreet());
mapBean.setLocationDescribe(location.getLocationDetail());
Log.e(TAG, "getMapBean: " + GsonUtils.toJSONString(mapBean));
return mapBean;
}
private void saveMapResult(MapBean mapBean) {
Log.e(TAG, "saveMapResult: " + GsonUtils.toJSONString(mapBean));
mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, GsonUtils.toJSONString(mapBean));
}
}

View File

@@ -30,8 +30,11 @@ public class AppManager {
private static final String TAG = AppManager.class.getSimpleName();
public static final String ADD_NAME = "com.zyos.add";
public static final String APPSTORE_PACKAGE_NAME = "com.uiui.zyappstore";
public static final String APPSTORE_CLASS_NAME = "com.uiui.zyappstore.activity.MainActivity";
public static final String UPDATE_NAME = "com.zyos.update";
public static final String MANUAL_NAME = "com.zyos.manual";
public static final String SERVICE_NAME = "com.zyos.service";
private static final String SHOW_PACKAGE_KEY = "SHOW_PACKAGE_KEY";
@SuppressLint("StaticFieldLeak")

View File

@@ -60,7 +60,6 @@ public class RemoteManager {
for (ConnectedListener listener : mListeners) {
listener.onConnected();
}
getLocation();
try {
String sn = mGetInfoInterface.getSerial();
CrashReport.setDeviceId(mContext, sn);
@@ -197,19 +196,6 @@ public class RemoteManager {
return mMMKV.decodeString(SN_KEY, "");
}
public void getLocation() {
if (mGetInfoInterface != null) {
try {
String jsonString = mGetInfoInterface.getMapResult();
mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, jsonString);
} catch (Exception e) {
Log.e(TAG, "getMapResult: " + e.getMessage());
}
} else {
bindInfoService();
}
}
public String getAppUsedStatistics() {
if (mGetInfoInterface != null) {
try {
@@ -224,72 +210,6 @@ public class RemoteManager {
return null;
}
public MapBean getMapBean() {
String jsonString = mMMKV.decodeString(CommonConfig.MAP_LOCATION_JSON_KEY);
if (TextUtils.isEmpty(jsonString)) {
return null;
} else {
Gson gson = new Gson();
Type type = new TypeToken<MapBean>() {
}.getType();
MapBean mapBean = gson.fromJson(jsonString, type);
mMMKV.encode(CommonConfig.MAP_ADDRESS_KEY, mapBean.getAddress() + mapBean.getLocationDescribe());
mMMKV.encode(CommonConfig.MAP_LONGITUDE_KEY, mapBean.getLongitude());
mMMKV.encode(CommonConfig.MAP_LATITUDE_KEY, mapBean.getLatitude());
return mapBean;
}
}
public String getCity() {
MapBean mapBean = getMapBean();
if (mapBean == null) {
getLocation();
return "北京";
} else {
return mapBean.getCity();
}
}
public String getCityDistrict() {
MapBean mapBean = getMapBean();
if (mapBean == null) {
getLocation();
return "北京";
} else {
return mapBean.getCity() + "\t" + mapBean.getDistrict();
}
}
public double getLongitude() {
MapBean mapBean = getMapBean();
if (mapBean == null) {
getLocation();
return 0.0;
} else {
return mapBean.getLongitude();
}
}
public double getLatitude() {
MapBean mapBean = getMapBean();
if (mapBean == null) {
getLocation();
return 0.0;
} else {
return mapBean.getLatitude();
}
}
public String getLocationTude() {
MapBean mapBean = getMapBean();
if (mapBean == null) {
getLocation();
return "0.0";
} else {
return mapBean.getLongitude() + "," + mapBean.getLatitude();
}
}
public boolean getSnIsActivation() {
try {
return mGetInfoInterface.SnIsActivation();

View File

@@ -31,6 +31,7 @@ import com.uiui.zyos.network.api.CloudLessonAppApi;
import com.uiui.zyos.network.api.RunNewApp;
import com.uiui.zyos.network.api.SNInfoApi;
import com.uiui.zyos.network.api.StudyStatApi;
import com.uiui.zyos.network.api.UpdateAddressApi;
import com.uiui.zyos.network.api.UpdateAlarmClockApi;
import com.uiui.zyos.network.api.UserInfoControl;
import com.uiui.zyos.network.interceptor.RepeatRequestInterceptor;
@@ -216,6 +217,14 @@ public class NetInterfaceManager {
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse> getUpdateAddressObservable(String address, double longitude, double latitude) {
return mRetrofit.create(UpdateAddressApi.class)
.updateAddress(RemoteManager.getInstance().getSerial(), address, longitude, latitude)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
/*
*
* execution

View File

@@ -9,6 +9,8 @@ public class UrlAddress {
public static final String GET_USER_AVATAR_INFO = "sn/getUserAvatarInfo";
/*获取统计*/
public static final String GET_STUDY_STAT = "Sn/getStudyStat";
/*上传地址信息*/
public static final String UPDATE_ADDRESS = "sn/update-address";
/*应用使用记录*/
public static final String APP_USAGE_RECORD = "appUsageRecord";
@@ -19,6 +21,7 @@ public class UrlAddress {
/*爱心提醒通知成功*/
public static final String UPDATE_ALARM_CLOCK = "updateAlarmClock";
/*网课模式*/
public final static String GET_CLOUD_LESSON = "Control/getCloudLessonSetting";
public final static String GET_CLOUD_LESSON_APP = "Control/getCloudLessonApp";

View File

@@ -0,0 +1,20 @@
package com.uiui.zyos.network.api;
import com.uiui.zyos.bean.BaseResponse;
import com.uiui.zyos.network.UrlAddress;
import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
public interface UpdateAddressApi {
@FormUrlEncoded
@POST(UrlAddress.UPDATE_ADDRESS)
Observable<BaseResponse> updateAddress(
@Field("sn") String sn,
@Field("address") String address,
@Field("longitude") double longitude,
@Field("latitude") double latitude
);
}

View File

@@ -7,7 +7,7 @@ import android.content.Intent;
import com.uiui.zyos.disklrucache.CacheHelper;
import com.uiui.zyos.network.NetInterfaceManager;
import com.uiui.zyos.utils.ToastUtil;
import com.hjq.toast.Toaster;
public class PushManager {
private static final String TAG = PushManager.class.getSimpleName();
@@ -51,13 +51,13 @@ public class PushManager {
public void setPushContent(String title, String extras) {
switch (title) {
case JIGUANG_ALARM_CLOCK:
ToastUtil.betaShow("收到推送消息: 设置闹钟");
Toaster.debugShow("收到推送消息: 设置闹钟");
NetInterfaceManager.getInstance().getAlarmClock();
Intent intent = new Intent(SET_ALARMCLOCK);
mContext.sendBroadcast(intent);
break;
case ONLINE_COURSE_MODE:
ToastUtil.betaShow("收到推送消息: 网课模式");
Toaster.debugShow("收到推送消息: 网课模式");
NetInterfaceManager.getInstance().getCloudLessonSettings();
break;
default:

View File

@@ -6,7 +6,6 @@ import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import com.uiui.zyos.service.main.MainService;
import java.util.concurrent.TimeUnit;
@@ -18,7 +17,7 @@ import io.reactivex.rxjava3.disposables.Disposable;
public class BootReceiver extends BroadcastReceiver {
private static final String TAG = BootReceiver.class.getSimpleName();
public static final String BOOT_COMPLETED = "zuoyeos.action.BOOT_COMPLETED";
public static final String SOS = "zuoyeos.action.SOS";
public static final String SOS = "zyos.action.SOS";
static {
getLockedState();
@@ -72,7 +71,7 @@ public class BootReceiver extends BroadcastReceiver {
// Intent alarmIntent = new Intent(MessageReceiver.SET_ALARMCLOCK);
// context.sendBroadcast(alarmIntent);
case Intent.ACTION_BOOT_COMPLETED:
context.startService(new Intent(context, MainService.class));
// context.startService(new Intent(context, MainService.class));
break;
// TODO: 2023/6/17 频繁唤醒耗电
// case Intent.ACTION_BATTERY_CHANGED:

View File

@@ -50,7 +50,7 @@ public class InstallResultReceiver extends BroadcastReceiver {
// Log.e("fht", LEGACY_STATUS);
// Log.e("fht", STATUS_MESSAGE);
if (STATUS_MESSAGE != null && "INSTALL_SUCCEEDED".equals(STATUS_MESSAGE)) {
// ToastUtil.show(PACKAGE_NAME + "安装成功");
// Toaster.show(PACKAGE_NAME + "安装成功");
}
}
}

View File

@@ -1,7 +1,7 @@
package com.uiui.zyos.service.main;
import com.uiui.zyos.base.BasePresenter;
import com.uiui.zyos.base.BaseView;
import com.uiui.zyos.base.mvp.BasePresenter;
import com.uiui.zyos.base.mvp.BaseView;
import com.uiui.zyos.bean.AlarmClockData;
import java.util.List;

View File

@@ -1,11 +1,9 @@
package com.uiui.zyos.service.main;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.IBinder;
import android.text.TextUtils;
import android.util.Log;
@@ -13,16 +11,15 @@ import android.util.Log;
import com.blankj.utilcode.util.NetworkUtils;
import com.uiui.zyos.activity.NoticeActivity;
import com.uiui.zyos.alarm.AlarmUtils;
import com.uiui.zyos.base.BaseService;
import com.uiui.zyos.base.rx.BaseRxService;
import com.uiui.zyos.bean.AlarmClockData;
import com.uiui.zyos.jxw.JxwPackageConfig;
import com.uiui.zyos.utils.Utils;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
public class MainService extends BaseService implements MainSContact.MainSView, NetworkUtils.OnNetworkStatusChangedListener {
public class MainService extends BaseRxService implements MainSContact.MainSView, NetworkUtils.OnNetworkStatusChangedListener {
private static final String TAG = MainService.class.getSimpleName();
public MainSPresenter mPresenter;
@@ -56,7 +53,7 @@ public class MainService extends BaseService implements MainSContact.MainSView,
Log.e(TAG, "onCreate: ");
mPresenter = new MainSPresenter(this);
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
mPresenter.setLifecycle(getLifecycleSubject());
mPresenter.getCloudLessonSettings();
// registerAlarmReceiver();
NetworkUtils.registerNetworkStatusChangedListener(this);

View File

@@ -0,0 +1,90 @@
package com.uiui.zyos.utils;
import android.content.Context;
import android.provider.Settings;
import com.uiui.zyos.config.CommonConfig;
public class ActivationUtil {
/*写入1为激活*/
private static final int ACTIVATED_KEY = 1;
private static final int INACTIVATED_KEY = 0;
/*默认激活码类型*/
private static final int DEFAULT_CODE_TYPE = -1;
/*默认过期时间*/
private static final int DEFAULT_EXPIRE_TIME = -1;
/**
* 获取激活状态
*
* @param context
* @return
*/
public static int getActivationStateCode(Context context) {
int activation = Settings.Global.getInt(context.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, INACTIVATED_KEY);
return activation;
}
/**
* 是否激活
*
* @param context
* @return
*/
public static boolean isActivation(Context context) {
return getActivationStateCode(context) == ACTIVATED_KEY;
}
/**
* 设置激活状态
*
* @param context
* @param code
*/
public static void setActivation(Context context, int code) {
Settings.Global.putInt(context.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, code);
}
/**
* 设置激活码类型
*
* @param context
* @param code
*/
public static void setActivationCodeType(Context context, int code) {
Settings.Global.putInt(context.getContentResolver(), CommonConfig.UIUI_CODE_TYPE_KEY, code);
}
/**
* 获取激活码类型
*
* @param context
* @return
*/
public static int getActivationCodeType(Context context) {
return Settings.Global.getInt(context.getContentResolver(), CommonConfig.UIUI_CODE_TYPE_KEY, DEFAULT_CODE_TYPE);
}
/**
* 设置过期时间
*
* @param context
* @param expireTime
*/
public static void setActivationExpireTime(Context context, long expireTime) {
Settings.Global.putLong(context.getContentResolver(), CommonConfig.UIUI_EXPIRE_TIME_KEY, expireTime);
}
/**
* 获取过期时间
*
* @param context
* @return
*/
public static long getActivationExpireTime(Context context) {
return Settings.Global.getLong(context.getContentResolver(), CommonConfig.UIUI_EXPIRE_TIME_KEY, DEFAULT_EXPIRE_TIME);
}
}

View File

@@ -5,12 +5,16 @@ import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.hjq.toast.Toaster;
import com.tencent.mmkv.MMKV;
import com.uiui.zyos.bean.LessonJson;
import com.uiui.zyos.config.CommonConfig;
@@ -61,14 +65,14 @@ public class OpenApkUtils {
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
if (is_activation != 1) {
ApkUtils.openPackage(mContext, "com.uiui.zy", "com.uiui.zy.activity.main.MainActivity");
ToastUtil.show("请激活设备后使用");
Toaster.show("请激活设备后使用");
}
return is_activation == 1;
}
public boolean openPackageWithArgs(String packageName, String className, String name, String args) {
if (!ApkUtils.isAvailable(mContext, packageName)) {
ToastUtil.show("应用未安装");
Toaster.show("应用未安装");
return false;
}
ComponentName cn = new ComponentName(packageName, className);
@@ -181,35 +185,35 @@ public class OpenApkUtils {
}};
private void sendRuningApp(String packageName) {
AppUsedTimeUtils.getInstance().setAppPackageName(packageName);
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
AppUsedTimeUtils.getInstance().sendRunningApp(() -> {
});
// AppUsedTimeUtils.getInstance().setAppPackageName(packageName);
// AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
// AppUsedTimeUtils.getInstance().sendRunningApp(() -> {
// });
}
public void openApp(String packageName) {
if (!ApkUtils.isAvailable(mContext, packageName)) {
ToastUtil.show("应用未安装");
Toaster.show("应用未安装");
return;
}
if (isCloudLessonMod(packageName)) {
ApkUtils.openPackage(mContext, packageName);
sendRuningApp(packageName);
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
public void openApp(String packageName, String className) {
if (!ApkUtils.isAvailable(mContext, packageName)) {
ToastUtil.show("应用未安装");
Toaster.show("应用未安装");
return;
}
if (isCloudLessonMod(packageName)) {
ApkUtils.openPackage(mContext, packageName, className);
sendRuningApp(packageName);
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -224,7 +228,7 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -239,7 +243,7 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -254,7 +258,7 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -269,7 +273,7 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -282,9 +286,35 @@ public class OpenApkUtils {
if (isCloudLessonMod(packageName)) {
if (openPackageWithArgs(packageName, className, "StartArgs", "中华文化")) {
sendRuningApp(packageName);
} else {
Toaster.show("打开失败:应用未安装");
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
public boolean isNewAiApp() {
PackageManager pm = mContext.getPackageManager();
PackageInfo packageInfo = null;
try {
packageInfo = pm.getPackageInfo(JxwPackageConfig.JXW_PRECISION_PACKAGE_NAME, 0);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
if (packageInfo == null) {
return false;
}
long appVersionCode;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
appVersionCode = packageInfo.getLongVersionCode();
} else {
appVersionCode = packageInfo.versionCode;
}
if (appVersionCode == 85) {
return false;
} else {
return true;
}
}
@@ -293,16 +323,79 @@ public class OpenApkUtils {
return;
}
String packageName = JxwPackageConfig.JXW_PRECISION_PACKAGE_NAME;
String className = JxwPackageConfig.JXW_PRECISION_CLASS_NAME;
String className = JxwPackageConfig.JXW_PRECISION_CLASS_NAME_85;
if (isCloudLessonMod(packageName)) {
if (openPackageWithArgs(packageName, className, "tiku_func_type", args)) {
sendRuningApp(packageName);
} else {
Toaster.show("打开失败:应用未安装");
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
public void openAiPrecision(int page, String subject) {
if (!checkActivation()) {
return;
}
String packageName = JxwPackageConfig.JXW_PRECISION_PACKAGE_NAME;
String className = JxwPackageConfig.JXW_PRECISION_CLASS_NAME_1;
if (isCloudLessonMod(packageName)) {
if (openAiWithArgs(packageName, className, page, subject)) {
sendRuningApp(packageName);
} else {
Toaster.show("打开失败:应用未安装");
}
} else {
Toaster.show("专注模式只允许使用指定应用");
}
}
public static final String NAME_PRIMARY_SCHOOL = "小学";
public static final String NAME_MIDDLE_SCHOOL = "初中";
public static final String NAME_HIGH_SCHOOL = "高中";
/**
* page_navigate 写死传0
* appoint_subject_list 不需要传
* appoint_period_name 这个是学段,一定要传
* <p>
* public static final String NAME_PRIMARY_SCHOOL = "小学";
* public static final String NAME_MIDDLE_SCHOOL = "初中";
* public static final String NAME_HIGH_SCHOOL = "高中";
* <p>
* appoint_period_name字段的值是上面这三个之一
*
* @param packageName
* @param className
* @param page
* @param subject
* @return
*/
public boolean openAiWithArgs(String packageName, String className, int page, String subject) {
if (!ApkUtils.isAvailable(mContext, packageName)) {
Toaster.show("应用未安装");
return false;
}
ComponentName cn = new ComponentName(packageName, className);
Intent intent = new Intent();
intent.setComponent(cn);
intent.putExtra("page_navigate", page);
intent.putExtra("appoint_subject_name", subject);
intent.putExtra("appoint_period_name", NAME_HIGH_SCHOOL);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
try {
mContext.startActivity(intent);
return true;
} catch (Exception e) {
Log.e(TAG, "openPackageWithArgs: " + e.getMessage());
}
return false;
}
public void openAppWithoutArgs(String packageName, String className) {
if (!checkActivation()) {
return;
@@ -310,7 +403,7 @@ public class OpenApkUtils {
if (isCloudLessonMod(packageName)) {
openApp(packageName, className);
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -325,7 +418,7 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
@@ -340,13 +433,13 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}
public boolean openLetterApp(String packageName, String className) {
if (!ApkUtils.isAvailable(mContext, packageName)) {
ToastUtil.show("应用未安装");
Toaster.show("应用未安装");
return false;
}
ComponentName cn = new ComponentName(packageName, className);
@@ -377,7 +470,7 @@ public class OpenApkUtils {
sendRuningApp(packageName);
}
} else {
ToastUtil.show("专注模式只允许使用指定应用");
Toaster.show("专注模式只允许使用指定应用");
}
}

View File

@@ -1,93 +0,0 @@
package com.uiui.zyos.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.Toast;
import com.blankj.utilcode.util.ToastUtils;
import com.uiui.zyos.BuildConfig;
/**
* Created by haoge on 2017/3/2.
*/
public class ToastUtil {
private static final String TAG = ToastUtil.class.getSimpleName();
@SuppressLint("StaticFieldLeak")
private static Context mContext;
private static Handler mainHandler = new Handler(Looper.getMainLooper());
private static Toast debugToast;
private static Toast toast;
@SuppressLint("ShowToast")
public static void init(Context context) {
mContext = context;
toast = Toast.makeText(mContext, "", Toast.LENGTH_SHORT);
debugToast = Toast.makeText(mContext, "", Toast.LENGTH_SHORT);
}
private static long time1 = 0L;
private static long time2 = 0L;
public static void show(final String msg) {
ToastUtils.make()
// .setBgColor(ColorUtils.getColor(R.color.toast_color))
.setTextColor(Color.DKGRAY)
// .setGravity(Gravity.CENTER, 0, 0)
.setNotUseSystemToast()
.show(msg);
}
public static void betaShow(final String msg) {
if (BuildConfig.DEBUG) {
ToastUtils.make()
// .setBgColor(ColorUtils.getColor(R.color.toast_color))
.setTextColor(Color.RED)
// .setGravity(Gravity.CENTER, 0, 0)
.setNotUseSystemToast()
.setDurationIsLong(true)
.show(msg);
} else {
Log.e(TAG, "debugShow: " + msg);
}
}
private static Toast mToast = null;
//android 8.0以后限制
//https://www.jianshu.com/p/d9813ad03d59
//https://www.jianshu.com/p/050ce052b873
public static void showToast(Context context, String text, int duration) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.P) {
Toast.makeText(context, text, duration).show();
} else {
if (mToast == null) {
mToast = Toast.makeText(context, text, duration);
} else {
mToast.setText(text);
mToast.setDuration(duration);
}
mToast.show();
}
}
// public static void showInCenter(String msg) {
// mainHandler.post(() -> {
// if (toast != null) {
// toast.setGravity(Gravity.CENTER, 0, 0);
// toast.setText(msg);
// toast.show();
// }
// });
// }
}

View File

@@ -1,4 +1,4 @@
package com.uiui.zyos.base;
package com.uiui.zyos.view;
import android.content.Context;
import android.util.AttributeSet;

View File

@@ -1,4 +1,4 @@
package com.uiui.zyos.base;
package com.uiui.zyos.view;
// add by codemx.cn ---- 20190712 ---plus- start

View File

@@ -1,4 +1,4 @@
package com.uiui.zyos.base.viewpager;
package com.uiui.zyos.view.viewpager;
import android.util.SparseArray;

View File

@@ -1,4 +1,4 @@
package com.uiui.zyos.base.viewpager;
package com.uiui.zyos.view.viewpager;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

View File

@@ -1,4 +1,4 @@
package com.uiui.zyos.base.viewpager;
package com.uiui.zyos.view.viewpager;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.uiui.zyos.base.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
<com.uiui.zyos.view.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@@ -462,4 +462,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.uiui.zyos.base.CustomContent>
</com.uiui.zyos.view.CustomContent>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.uiui.zyos.base.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
<com.uiui.zyos.view.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@@ -439,4 +439,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.uiui.zyos.base.CustomContent>
</com.uiui.zyos.view.CustomContent>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.uiui.zyos.base.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
<com.uiui.zyos.view.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@@ -462,4 +462,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.uiui.zyos.base.CustomContent>
</com.uiui.zyos.view.CustomContent>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.uiui.zyos.base.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
<com.uiui.zyos.view.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@@ -439,4 +439,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.uiui.zyos.base.CustomContent>
</com.uiui.zyos.view.CustomContent>

View File

@@ -68,8 +68,6 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_0"
android:layout_width="wrap_content"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:layout_height="match_parent">
<ImageView
@@ -80,16 +78,16 @@
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_android_appstore"
android:src="@drawable/com_jxw_examsystem"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname0"
android:id="@+id/tv_appname10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="应用市场"
android:text="模拟考场"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon0"
@@ -97,6 +95,38 @@
app:layout_constraintTop_toBottomOf="@+id/iv_icon0" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/cl_0"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_marginStart="@dimen/dp_4"-->
<!-- android:layout_marginEnd="@dimen/dp_4"-->
<!-- android:layout_height="match_parent">-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_icon0"-->
<!-- android:layout_width="@dimen/dp_32"-->
<!-- android:layout_height="@dimen/dp_32"-->
<!-- android:layout_marginStart="@dimen/dp_4"-->
<!-- android:layout_marginEnd="@dimen/dp_4"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:scaleType="centerCrop"-->
<!-- android:src="@drawable/com_android_appstore"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_appname0"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="应用市场"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_7"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_icon0"-->
<!-- app:layout_constraintStart_toStartOf="@+id/iv_icon0"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/iv_icon0" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_1"
android:layout_width="wrap_content"

View File

@@ -0,0 +1,27 @@
<?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.ServiceActivity">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="@dimen/dp_270"
android:layout_height="@dimen/dp_270"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/wechat_service"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.app.AppFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_510"
android:layout_height="@dimen/dp_210"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_app"
android:layout_width="match_parent"
android:layout_height="0dp"
android:fadeScrollbars="false"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_nodata"
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/nodata"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/rv_app" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.ar.ARStudyFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/ar_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_app"
android:layout_width="@dimen/dp_328"
android:layout_height="@dimen/dp_163"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_marginTop="@dimen/dp_8"
android:src="@drawable/ar_study_module"
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="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_209"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/ar_homework_box"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" >
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_28"
android:layout_marginBottom="@dimen/dp_8"
tools:listitem="@layout/item_homework"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.biology.BiologyFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/biology_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="同步学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/imageView1"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginStart="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/biology_synchronous_explanation"
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="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/imageView2"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginEnd="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/biology_unit_testing"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<ImageView
android:id="@+id/imageView3"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/biology_laboratory"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/biological_fine_volume"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragment.chemical.ChemicalFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintVertical_bias="0.35"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/chemical_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="同步学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/imageView1"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginStart="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chemical_synchronous_explanation"
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="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/imageView2"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginEnd="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chemical_synchronous_tutoring"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<ImageView
android:id="@+id/imageView3"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chemical_lab"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chemical_fine_volume"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,465 @@
<?xml version="1.0" encoding="utf-8"?>
<com.uiui.zyos.view.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.chinese.ChineseFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/chinese_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="人教版"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView2" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="同步学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_sync_video"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginStart="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chinese_synchronous_explanation"
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="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginEnd="@dimen/dp_6"
android:background="@drawable/chinese_card_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_more_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="查看更多…"
android:textColor="@color/black"
android:textSize="@dimen/sp_7"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_8"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_more_app"
tools:layout_editor_absoluteX="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_tutoring"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView4"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_synchronous_tutoring"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_near_antonyms"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView5"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_near_antonyms"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_composition"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView6"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_read_composition"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_read"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView7"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_featured_reading"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_character"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView8"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_character"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_classical"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView9"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_classical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_rhetoric"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView10"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_rhetoric"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_treasure"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView11"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_treasure"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_punctuation"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView12"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/chinese_punctuation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<ImageView
android:id="@+id/iv_dictation"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_96"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chinese_precision_science"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_character"
android:layout_width="@dimen/dp_67"
android:layout_height="@dimen/dp_105"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chinese_excellent_volume"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/iv_foundation"
android:layout_width="@dimen/dp_67"
android:layout_height="@dimen/dp_105"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/chinese_poetry_world"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.uiui.zyos.view.CustomContent>

View File

@@ -0,0 +1,442 @@
<?xml version="1.0" encoding="utf-8"?>
<com.uiui.zyos.view.CustomContent xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.complex.ComplexFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout6"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/complex_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:text="综合学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView7">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_16"
android:layout_marginBottom="@dimen/dp_16"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_66"
android:background="@drawable/complex_politics_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_19"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_politics_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="0dp">
<ImageView
android:id="@+id/imageView14"
android:layout_width="@dimen/dp_36"
android:layout_height="@dimen/dp_36"
android:src="@drawable/complex_video"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_politics_coach"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView15"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_book"
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>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_66"
android:background="@drawable/complex_geography_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_19"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_geography_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView16"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_video"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_geography_coach"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView17"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_book"
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>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_66"
android:background="@drawable/complex_history_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_19"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_history_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView18"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_video"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_history_coach"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView19"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_book"
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>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_66"
android:background="@drawable/complex_science_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_19"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_science_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView20"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_video"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_science_coach"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView21"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:src="@drawable/complex_book"
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>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_210"
android:layout_marginStart="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="@id/constraintLayout6"
app:layout_constraintStart_toEndOf="@id/constraintLayout6"
app:layout_constraintTop_toTopOf="@id/constraintLayout6">
<ImageView
android:id="@+id/iv_video"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/complex_knowledge_video"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_famous_teacher"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/complex_famous_teacher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.uiui.zyos.view.CustomContent>

View File

@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.english.EnglishFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintVertical_bias="0.35"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/english_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="同步学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="@dimen/dp_214"
android:layout_height="@dimen/dp_163"
android:layout_marginStart="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_8"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_explanation"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/imageView6"
android:layout_width="@dimen/dp_101"
android:layout_height="@dimen/dp_47"
android:layout_marginStart="@dimen/dp_9"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_synchronous_vocabulary"
app:layout_constraintStart_toEndOf="@+id/imageView5"
app:layout_constraintTop_toTopOf="@+id/imageView5" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="@dimen/dp_101"
android:layout_height="@dimen/dp_47"
android:layout_marginStart="@dimen/dp_9"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_listen_read"
app:layout_constraintBottom_toTopOf="@+id/imageView8"
app:layout_constraintStart_toEndOf="@+id/imageView5"
app:layout_constraintTop_toBottomOf="@+id/imageView6" />
<ImageView
android:id="@+id/imageView8"
android:layout_width="@dimen/dp_101"
android:layout_height="@dimen/dp_47"
android:layout_marginStart="@dimen/dp_9"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_unit_practice"
app:layout_constraintBottom_toBottomOf="@+id/imageView5"
app:layout_constraintStart_toEndOf="@+id/imageView5" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_209"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/math_excellent_volume"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView9"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_64"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_remember_words"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView10"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_64"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_listen_and_speak_special"
app:layout_constraintBottom_toTopOf="@+id/imageView11"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView9" />
<ImageView
android:id="@+id/imageView11"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_64"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/english_precision_learning"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,297 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.main.MainFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/magicIndicator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/magicIndicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_16"
android:layout_centerHorizontal="true"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/constraintLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:background="@drawable/custom_bg_ai"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginEnd="@dimen/dp_4"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginBottom="@dimen/dp_4"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_0"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon0"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_android_appstore"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="应用市场"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon0"
app:layout_constraintStart_toStartOf="@+id/iv_icon0"
app:layout_constraintTop_toBottomOf="@+id/iv_icon0" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon1"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_android_browser"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浏览器"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon1"
app:layout_constraintStart_toStartOf="@+id/iv_icon1"
app:layout_constraintTop_toBottomOf="@+id/iv_icon1" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_2"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon2"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_mediatek_filemanager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="文件"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon2"
app:layout_constraintStart_toStartOf="@+id/iv_icon2"
app:layout_constraintTop_toBottomOf="@+id/iv_icon2" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_3"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon3"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_android_camera"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="相机"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon3"
app:layout_constraintStart_toStartOf="@+id/iv_icon3"
app:layout_constraintTop_toBottomOf="@+id/iv_icon3" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_4"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon4"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_android_settings"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon4"
app:layout_constraintStart_toStartOf="@+id/iv_icon4"
app:layout_constraintTop_toBottomOf="@+id/iv_icon4" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_5"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon5"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_android_gallery3d_app"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图库"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon5"
app:layout_constraintStart_toStartOf="@+id/iv_icon5"
app:layout_constraintTop_toBottomOf="@+id/iv_icon5" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_6"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon6"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/icon_video"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="视频百科"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon6"
app:layout_constraintStart_toStartOf="@+id/iv_icon6"
app:layout_constraintTop_toBottomOf="@+id/iv_icon6" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_7"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_icon7"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_8"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/icon_dict"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_appname7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="字典"
android:textColor="@color/white"
android:textSize="@dimen/sp_7"
app:layout_constraintEnd_toEndOf="@+id/iv_icon7"
app:layout_constraintStart_toStartOf="@+id/iv_icon7"
app:layout_constraintTop_toBottomOf="@+id/iv_icon7" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,418 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.math.MathFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/math_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="同步学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_sync_video"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginStart="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/math_synchronous_explanation"
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="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginEnd="@dimen/dp_6"
android:background="@drawable/chinese_card_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_8"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_tutoring"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView4"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_synchronous_tutoring"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_near_antonyms"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView5"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_problem_training"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_composition"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView6"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_olympiad_training"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_read"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView7"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_equation_solution"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_character"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView8"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/mathematical_basis"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_classical"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView9"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_arithmetic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_encyclopedia"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView10"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_encyclopedia"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_number"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView11"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_number"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_formula"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView12"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/math_formula"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<ImageView
android:id="@+id/iv_precision_learning"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_209"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/math_excellent_volume"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.physics.PhysicsFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintVertical_bias="0.35"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/physical_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="同步学习"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/imageView1"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginStart="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/physical_synchronous_explanation"
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="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/imageView2"
android:layout_width="@dimen/dp_159"
android:layout_height="@dimen/dp_163"
android:layout_marginEnd="@dimen/dp_6"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/physical_unit_tests"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="@+id/constraintLayout3">
<ImageView
android:id="@+id/imageView3"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/physical_lab"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/physical_fine_volume"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.precision.PrecisionFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.35"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_210"
android:background="@drawable/precision_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="人教版"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView2" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="AI精准学"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
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="wrap_content"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<ImageView
android:id="@+id/iv_bunk"
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_163"
android:src="@drawable/precision_question_bank"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_paper"
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_77"
android:layout_marginStart="@dimen/dp_9"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/precision_test_paper"
app:layout_constraintStart_toEndOf="@+id/iv_bunk"
app:layout_constraintTop_toTopOf="@+id/iv_bunk" />
<ImageView
android:id="@+id/iv_test"
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_77"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/precision_stage_test"
app:layout_constraintBottom_toBottomOf="@+id/iv_bunk"
app:layout_constraintStart_toStartOf="@+id/iv_paper" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/iv_book"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:layout_marginStart="@dimen/dp_10"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/precision_wrong_book"
app:layout_constraintStart_toEndOf="@+id/constraintLayout3"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_favorites"
android:layout_width="@dimen/dp_141"
android:layout_height="@dimen/dp_100"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/precision_favorites"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout3"
app:layout_constraintStart_toStartOf="@+id/iv_book" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.subject.SubjectFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.flyco.tablayout.SlidingTabLayout
android:id="@+id/main_sliding_tab_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_24"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginEnd="@dimen/dp_32"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tl_indicator_color="#FFFFFF"
app:tl_indicator_style="NORMAL"
app:tl_tab_space_equal="true"
app:tl_indicator_width_equal_title="true"
app:tl_textBold="SELECT"
app:tl_textSelectSize="@dimen/sp_13"
app:tl_textSize="@dimen/sp_11"
app:tl_textUnSelectSize="@dimen/sp_11" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/main_sliding_tab_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -0,0 +1,535 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.user.UserFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout4"
android:layout_width="0dp"
android:layout_height="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_8"
app:layout_constraintEnd_toEndOf="@+id/constraintLayout7"
app:layout_constraintStart_toStartOf="@+id/constraintLayout7"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.shehuan.niv.NiceImageView
android:id="@+id/iv_avatar"
android:layout_width="@dimen/dp_28"
android:layout_height="@dimen/dp_28"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/default_avatar"
app:is_circle="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:maxLines="1"
android:text="@string/default_nickname"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintStart_toEndOf="@+id/iv_avatar"
app:layout_constraintTop_toTopOf="@+id/iv_avatar" />
<TextView
android:id="@+id/tv_grade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="@string/default_grade"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintBottom_toBottomOf="@+id/iv_avatar"
app:layout_constraintStart_toStartOf="@+id/tv_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:background="@drawable/bt_checkupdate_selector"
android:paddingStart="@dimen/dp_8"
android:paddingTop="@dimen/dp_2"
android:paddingEnd="@dimen/dp_8"
android:paddingBottom="@dimen/dp_2"
android:text="退出系统"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/constraintLayout5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.476" />
<ImageView
android:id="@+id/iv_speaker"
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:layout_marginStart="@dimen/dp_12"
android:src="@drawable/user_speaker"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/tv_exit"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_4"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="@string/tips"
android:textColor="@color/lightGray"
android:textSize="@dimen/sp_8"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bind_statu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tv_notification"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView15"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/com_uiui_sn"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_bind"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_16"
android:layout_marginStart="@dimen/dp_4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/icon_device_unbind"
app:layout_constraintBottom_toBottomOf="@+id/imageView15"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView15"
app:layout_constraintTop_toTopOf="@+id/imageView15" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_36"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="@dimen/dp_205"
android:layout_height="@dimen/dp_211"
android:background="@drawable/user_center_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_nodata"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<TextView
android:id="@+id/tv_activated2"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_8"
android:background="@drawable/activation_bg"
android:gravity="center"
android:text="学习资源下载"
android:textColor="@color/white"
android:textSize="@dimen/sp_6"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_applet"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_8"
android:background="@drawable/activation_bg"
android:gravity="center"
android:text="小程序绑定"
android:textColor="@color/white"
android:textSize="@dimen/sp_6"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView12"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_82"
android:layout_marginTop="@dimen/dp_32"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/user_trophy"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:text="暂无数据"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintEnd_toEndOf="@+id/imageView12"
app:layout_constraintStart_toStartOf="@+id/imageView12"
app:layout_constraintTop_toBottomOf="@+id/imageView12" />
<TextView
android:id="@+id/tv_activation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bt_checkupdate_selector"
android:paddingStart="@dimen/dp_8"
android:paddingTop="@dimen/dp_4"
android:paddingEnd="@dimen/dp_8"
android:paddingBottom="@dimen/dp_4"
android:text="点击激活学习系统"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView8" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_usedata"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<TextView
android:id="@+id/tv_activated"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_8"
android:background="@drawable/activation_bg"
android:gravity="center"
android:text="学习资源下载"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView17"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_82"
android:layout_marginTop="@dimen/dp_32"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/user_trophy"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="80%"
android:textColor="@color/percent_color"
android:textSize="@dimen/sp_25"
app:layout_constraintEnd_toEndOf="@+id/imageView17"
app:layout_constraintStart_toStartOf="@+id/imageView17"
app:layout_constraintTop_toBottomOf="@+id/imageView17" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="学习时长超过同用户"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_percent" />
<TextView
android:id="@+id/tv_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView5"
tools:text="@string/today_study_time" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_293"
android:layout_height="@dimen/dp_211"
android:layout_marginStart="@dimen/dp_21"
android:background="@drawable/user_app_box"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_activation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<TextView
android:id="@+id/tv_date1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="2月14日 星期二"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_8"
android:background="@drawable/bt_checkupdate_selector"
android:paddingStart="@dimen/dp_8"
android:paddingTop="@dimen/dp_2"
android:paddingEnd="@dimen/dp_8"
android:paddingBottom="@dimen/dp_2"
android:text="输入激活码"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:text="设备绑定流程"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_date1" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3">
<com.shehuan.niv.NiceImageView
android:id="@+id/iv_applet_qrcode"
android:layout_width="@dimen/dp_88"
android:layout_height="@dimen/dp_88"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/applet_qrcode"
app:corner_radius="@dimen/dp_8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:gravity="center_horizontal"
android:text="第一步\n扫码注册小程序"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintEnd_toEndOf="@+id/iv_applet_qrcode"
app:layout_constraintStart_toStartOf="@+id/iv_applet_qrcode"
app:layout_constraintTop_toBottomOf="@+id/iv_applet_qrcode" />
<ImageView
android:id="@+id/iv_progress"
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:layout_marginStart="@dimen/dp_16"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/user_progress"
app:layout_constraintBottom_toBottomOf="@+id/iv_applet_qrcode"
app:layout_constraintStart_toEndOf="@+id/iv_applet_qrcode"
app:layout_constraintTop_toTopOf="@+id/iv_applet_qrcode" />
<com.shehuan.niv.NiceImageView
android:id="@+id/iv_device_qrcode"
android:layout_width="@dimen/dp_88"
android:layout_height="@dimen/dp_88"
android:layout_marginStart="@dimen/dp_16"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@color/white"
app:corner_radius="@dimen/dp_8"
app:layout_constraintStart_toEndOf="@+id/iv_progress"
app:layout_constraintTop_toTopOf="@+id/iv_applet_qrcode" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:gravity="center_horizontal"
android:text="第二步\n扫码绑定设备"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintEnd_toEndOf="@+id/iv_device_qrcode"
app:layout_constraintStart_toStartOf="@+id/iv_device_qrcode"
app:layout_constraintTop_toBottomOf="@+id/iv_device_qrcode" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_app"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<TextView
android:id="@+id/tv_date2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_8"
android:maxLines="1"
android:text="2月14日 星期二"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/tv_date2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_date2">
<ImageView
android:id="@+id/imageView13"
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_8"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/user_more"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_4"
android:text="更多应用"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="@+id/imageView13"
app:layout_constraintEnd_toStartOf="@+id/imageView13"
app:layout_constraintTop_toTopOf="@+id/imageView13" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_app"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="@dimen/dp_8"
android:fadeScrollbars="false"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_date2" />
<ImageView
android:id="@+id/iv_nodata"
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/nodata"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/rv_app" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -19,7 +19,7 @@
<item name="android:fitsSystemWindows">true</item>
</style>
<style name="activity_styles" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="DialogCloseOnTouchOutside" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- <item name="android:windowFullscreen">true</item>-->
<!--设置dialog的背景-->
<item name="android:windowBackground">@android:color/transparent</item>
@@ -28,15 +28,38 @@
<!--设置无标题-->
<item name="windowNoTitle">true</item>
<!--是否浮现在activity之上-->
<item name="android:windowIsFloating">false</item>
<!--为false会导致windowCloseOnTouchOutside 失效-->
<item name="android:windowIsFloating">true</item>
<!--是否半透明-->
<!-- <item name="android:windowIsTranslucent">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>
<style name="DialogStyle" 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之上-->
<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">false</item>
</style>
<style name="CustomDialog" parent="Theme.AppCompat.Dialog.Alert">