version:1.6.9
fix: add:
This commit is contained in:
@@ -18,8 +18,8 @@ android {
|
|||||||
applicationId "com.info.sn"
|
applicationId "com.info.sn"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 61
|
versionCode 69
|
||||||
versionName "1.6.1"
|
versionName "1.6.9"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
ndk {
|
ndk {
|
||||||
@@ -32,7 +32,6 @@ android {
|
|||||||
JPUSH_APPKEY : "edf9cec22731b8b2fed56ee6", //JPush 上注册的包名对应的 Appkey.
|
JPUSH_APPKEY : "edf9cec22731b8b2fed56ee6", //JPush 上注册的包名对应的 Appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
]
|
]
|
||||||
buildConfigField "String", "SCREEN_URL", '"https://homework.uiuios.com:3018/wm/is_online"'
|
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions {
|
annotationProcessorOptions {
|
||||||
includeCompileClasspath true
|
includeCompileClasspath true
|
||||||
@@ -94,6 +93,7 @@ android {
|
|||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
AMAP_KEY: "8c4e1d478cb91e6b5713562bc424efba"
|
AMAP_KEY: "8c4e1d478cb91e6b5713562bc424efba"
|
||||||
]
|
]
|
||||||
|
buildConfigField "String", "SCREEN_URL", '"https://homework.uiuios.com:3018/wm/is_online"'
|
||||||
}
|
}
|
||||||
|
|
||||||
zhanRuiDebug.initWith(debug)
|
zhanRuiDebug.initWith(debug)
|
||||||
@@ -105,6 +105,7 @@ android {
|
|||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
AMAP_KEY: "8c4e1d478cb91e6b5713562bc424efba"
|
AMAP_KEY: "8c4e1d478cb91e6b5713562bc424efba"
|
||||||
]
|
]
|
||||||
|
buildConfigField "String", "SCREEN_URL", '"https://homework.uiuios.com:3018/wm/is_online"'
|
||||||
}
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
@@ -125,6 +126,7 @@ android {
|
|||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
AMAP_KEY: "83869aed8624eb00615c2b6d3d15d777"
|
AMAP_KEY: "83869aed8624eb00615c2b6d3d15d777"
|
||||||
]
|
]
|
||||||
|
buildConfigField "String", "SCREEN_URL", '"https://homework.uiuios.com:3018/wm/is_online"'
|
||||||
}
|
}
|
||||||
|
|
||||||
release {
|
release {
|
||||||
@@ -150,6 +152,7 @@ android {
|
|||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
AMAP_KEY: "83869aed8624eb00615c2b6d3d15d777"
|
AMAP_KEY: "83869aed8624eb00615c2b6d3d15d777"
|
||||||
]
|
]
|
||||||
|
buildConfigField "String", "SCREEN_URL", '"https://homework.uiuios.com:3018/wm/is_online"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,6 +172,7 @@ dependencies {
|
|||||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||||
//implementation 'com.android.support:multidex:1.0.3'
|
//implementation 'com.android.support:multidex:1.0.3'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||||
@@ -187,7 +191,7 @@ dependencies {
|
|||||||
//RxJava
|
//RxJava
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
//声明周期管理
|
//生命周期管理
|
||||||
implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.2'
|
implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.2'
|
||||||
implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.2'
|
implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.2'
|
||||||
implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
|
implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
|
||||||
@@ -212,6 +216,8 @@ dependencies {
|
|||||||
//implementation 'me.jessyan:autosize:1.2.1'
|
//implementation 'me.jessyan:autosize:1.2.1'
|
||||||
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
|
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
|
||||||
|
|
||||||
|
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
||||||
|
|
||||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
||||||
|
|
||||||
@@ -219,6 +225,7 @@ dependencies {
|
|||||||
// If you are using Kotlin, replace annotationProcessor with kapt.
|
// If you are using Kotlin, replace annotationProcessor with kapt.
|
||||||
// annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]
|
// annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]
|
||||||
kapt 'com.jakewharton:butterknife-compiler:10.2.1'
|
kapt 'com.jakewharton:butterknife-compiler:10.2.1'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preBuild {
|
preBuild {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.info.sn"
|
package="com.info.sn"
|
||||||
android:sharedUserId="android.uid.system">
|
android:sharedUserId="android.uid.system">
|
||||||
|
|
||||||
<!-- 系统权限,有系统签名可以使用 -->
|
<!-- 系统权限,有系统签名可以使用 -->
|
||||||
<uses-permission android:name="android.permission.ACTION_SCREEN_ON" />
|
<uses-permission android:name="android.permission.ACTION_SCREEN_ON" />
|
||||||
<uses-permission android:name="android.permission.ACTION_SCREEN_OFF" />
|
<uses-permission android:name="android.permission.ACTION_SCREEN_OFF" />
|
||||||
@@ -60,11 +59,25 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher"
|
android:roundIcon="@mipmap/ic_launcher"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
|
<activity
|
||||||
|
android:name=".activity.SNUidActivity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:theme="@style/activity_styles" />
|
||||||
|
<activity
|
||||||
|
android:name=".activity.selectegrade.SelecteGradeActivity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:theme="@style/activity_styles" />
|
||||||
|
<activity
|
||||||
|
android:name=".activity.GuideActivity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:theme="@style/activity_styles" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".service.RemoteService"
|
android:name=".service.RemoteService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:process=":remote"/>
|
android:process=":remote" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.main.MainActivity"
|
android:name=".activity.main.MainActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import android.content.Context;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
|
|
||||||
|
import com.info.sn.utils.ApkUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -46,6 +48,9 @@ public class StatisticsInfo {
|
|||||||
this.add("com.android.launcher3");
|
this.add("com.android.launcher3");
|
||||||
this.add("com.android.settings");
|
this.add("com.android.settings");
|
||||||
this.add("com.appstore.uiui");
|
this.add("com.appstore.uiui");
|
||||||
|
this.add("com.gankao.gkwxhd");
|
||||||
|
this.add("com.jiaoguanyi.os");
|
||||||
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//将次数和时间为0的应用信息过滤掉
|
//将次数和时间为0的应用信息过滤掉
|
||||||
@@ -58,6 +63,7 @@ public class StatisticsInfo {
|
|||||||
if (AppInfoList.get(i).getUsedTimebyDay() > 0
|
if (AppInfoList.get(i).getUsedTimebyDay() > 0
|
||||||
&& AppInfoList.get(i).getTimes() > 0
|
&& AppInfoList.get(i).getTimes() > 0
|
||||||
// && !AppUtil.isSystemApp(mContext, AppInfoList.get(i).getPackageName())
|
// && !AppUtil.isSystemApp(mContext, AppInfoList.get(i).getPackageName())
|
||||||
|
&& ApkUtils.getIsCanStart(mContext, AppInfoList.get(i).getPackageName())
|
||||||
&& !packageList.contains(AppInfoList.get(i).getPackageName())
|
&& !packageList.contains(AppInfoList.get(i).getPackageName())
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -170,8 +176,10 @@ public class StatisticsInfo {
|
|||||||
|
|
||||||
//再计算一次当前应用的运行时间,因为当前应用,最后得不到MOVE_TO_BACKGROUND 的timeStamp
|
//再计算一次当前应用的运行时间,因为当前应用,最后得不到MOVE_TO_BACKGROUND 的timeStamp
|
||||||
AppInformation information = mapData.get(context.getPackageName());
|
AppInformation information = mapData.get(context.getPackageName());
|
||||||
|
if (information!=null){
|
||||||
information.setTimeStampMoveToBackGround(now);
|
information.setTimeStampMoveToBackGround(now);
|
||||||
information.calculateRunningTime();
|
information.calculateRunningTime();
|
||||||
|
}
|
||||||
|
|
||||||
return new ArrayList<>(mapData.values());
|
return new ArrayList<>(mapData.values());
|
||||||
}
|
}
|
||||||
|
|||||||
93
app/src/main/java/com/info/sn/activity/GuideActivity.java
Normal file
93
app/src/main/java/com/info/sn/activity/GuideActivity.java
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
package com.info.sn.activity;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.github.chrisbanes.photoview.PhotoView;
|
||||||
|
import com.info.sn.R;
|
||||||
|
import com.info.sn.base.BaseActivity;
|
||||||
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
|
import com.info.sn.manager.NetInterfaceManager;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
|
||||||
|
public class GuideActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private PhotoView mPhotoView;
|
||||||
|
private ConstraintLayout root;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLayoutId() {
|
||||||
|
return R.layout.activity_guide;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView() {
|
||||||
|
mPhotoView = findViewById(R.id.photoView);
|
||||||
|
root = findViewById(R.id.root);
|
||||||
|
root.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mPhotoView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
getGuidePic();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getGuidePic() {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getGetGuideControl()
|
||||||
|
.compose(this.bindToLifecycle())
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e("getGuidePic", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse baseResponse) {
|
||||||
|
Log.e("getGuidePic", "onNext: ");
|
||||||
|
int code = baseResponse.code;
|
||||||
|
if (code == 200) {
|
||||||
|
JSONObject jsonObject = JSON.parseObject(JSONObject.toJSONString(baseResponse.data));
|
||||||
|
String file = jsonObject.getString("file");
|
||||||
|
if (!TextUtils.isEmpty(file)) {
|
||||||
|
Log.e("getGuidePic", "onNext: " + file);
|
||||||
|
Glide.with(GuideActivity.this).load(file).into(mPhotoView);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("getGuidePic", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getGuidePic", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
71
app/src/main/java/com/info/sn/activity/SNUidActivity.java
Normal file
71
app/src/main/java/com/info/sn/activity/SNUidActivity.java
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package com.info.sn.activity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.info.sn.R;
|
||||||
|
import com.info.sn.adapter.SNUidAdapter;
|
||||||
|
import com.info.sn.base.BaseActivity;
|
||||||
|
import com.info.sn.bean.zuoye.SNUidBean;
|
||||||
|
import com.info.sn.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
|
public class SNUidActivity extends BaseActivity {
|
||||||
|
@BindView(R.id.recyclerView)
|
||||||
|
RecyclerView mRecyclerView;
|
||||||
|
@BindView(R.id.root)
|
||||||
|
ConstraintLayout root;
|
||||||
|
private SNUidAdapter mAdapter = new SNUidAdapter();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLayoutId() {
|
||||||
|
return R.layout.activity_sn_uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView() {
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(SNUidActivity.this));
|
||||||
|
mRecyclerView.setAdapter(mAdapter);
|
||||||
|
root.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
Intent intent = getIntent();
|
||||||
|
String jsonString = intent.getStringExtra("json");
|
||||||
|
Log.e("TAG", "initData: " + jsonString);
|
||||||
|
if (TextUtils.isEmpty(jsonString)) {
|
||||||
|
ToastUtil.show("暂未获取到信息");
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
|
JSONArray jsonArray = jsonObject.getJSONArray("card_info");
|
||||||
|
List<SNUidBean> snUidBeads = JSON.parseArray(jsonArray.toJSONString(), SNUidBean.class);
|
||||||
|
if (snUidBeads == null) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
mAdapter.setSnUidBeans(snUidBeads);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -29,6 +29,9 @@ import com.blankj.utilcode.util.NetworkUtils;
|
|||||||
import com.flyco.tablayout.SlidingTabLayout;
|
import com.flyco.tablayout.SlidingTabLayout;
|
||||||
import com.info.sn.BuildConfig;
|
import com.info.sn.BuildConfig;
|
||||||
import com.info.sn.R;
|
import com.info.sn.R;
|
||||||
|
import com.info.sn.activity.GuideActivity;
|
||||||
|
import com.info.sn.activity.SNUidActivity;
|
||||||
|
import com.info.sn.activity.selectegrade.SelecteGradeActivity;
|
||||||
import com.info.sn.base.BaseActivity;
|
import com.info.sn.base.BaseActivity;
|
||||||
import com.info.sn.bean.gankao.AvailableProduct;
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
import com.info.sn.bean.zuoye.BaseResponse;
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
@@ -60,7 +63,9 @@ import com.info.sn.utils.Utils;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -84,6 +89,9 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
@BindView(R.id.cl_update)
|
@BindView(R.id.cl_update)
|
||||||
ConstraintLayout cl_update;
|
ConstraintLayout cl_update;
|
||||||
|
|
||||||
|
@BindView(R.id.cl_vip)
|
||||||
|
ConstraintLayout cl_vip;
|
||||||
|
|
||||||
@BindView(R.id.tv_exit)
|
@BindView(R.id.tv_exit)
|
||||||
TextView iv_exit;
|
TextView iv_exit;
|
||||||
|
|
||||||
@@ -111,6 +119,9 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
@BindView(R.id.tv_grade)
|
@BindView(R.id.tv_grade)
|
||||||
TextView tv_grade;
|
TextView tv_grade;
|
||||||
|
|
||||||
|
@BindView(R.id.tv_vip)
|
||||||
|
TextView tv_vip;
|
||||||
|
|
||||||
@BindView(R.id.tv_version)
|
@BindView(R.id.tv_version)
|
||||||
TextView tv_version;
|
TextView tv_version;
|
||||||
|
|
||||||
@@ -120,6 +131,15 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
@BindView(R.id.bt_activation)
|
@BindView(R.id.bt_activation)
|
||||||
TextView bt_activation;
|
TextView bt_activation;
|
||||||
|
|
||||||
|
@BindView(R.id.bt_repurchase)
|
||||||
|
TextView bt_repurchase;
|
||||||
|
|
||||||
|
@BindView(R.id.tv_guide)
|
||||||
|
TextView tv_guide;
|
||||||
|
|
||||||
|
@BindView(R.id.tv_activate)
|
||||||
|
TextView tv_activate;
|
||||||
|
|
||||||
@BindView(R.id.viewPager)
|
@BindView(R.id.viewPager)
|
||||||
ViewPager viewPager;
|
ViewPager viewPager;
|
||||||
|
|
||||||
@@ -133,7 +153,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||||
mPresenter.getInfo();
|
mPresenter.getSnInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -184,6 +204,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
Log.e(TAG, "getWeekDay: " + TimeUtils.inWeekDay(1627702095000L));
|
Log.e(TAG, "getWeekDay: " + TimeUtils.inWeekDay(1627702095000L));
|
||||||
Log.e(TAG, "getWeekDayString: " + new TimeUtils().getWeekDayString());
|
Log.e(TAG, "getWeekDayString: " + new TimeUtils().getWeekDayString());
|
||||||
Log.e(TAG, "getWeekDayString: " + new TimeUtils().getWeekDayString(1627702095000L));
|
Log.e(TAG, "getWeekDayString: " + new TimeUtils().getWeekDayString(1627702095000L));
|
||||||
|
// DeviceManager.doMasterClear();
|
||||||
}
|
}
|
||||||
JPushInterface.init(this);
|
JPushInterface.init(this);
|
||||||
if (DeviceManager.isDebugMode()) {
|
if (DeviceManager.isDebugMode()) {
|
||||||
@@ -200,6 +221,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
mPresenter.getQRCode();
|
mPresenter.getQRCode();
|
||||||
// mPresenter.getInfo();
|
// mPresenter.getInfo();
|
||||||
mPresenter.getUserInfo();
|
mPresenter.getUserInfo();
|
||||||
|
mPresenter.queryPowerUserList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -213,7 +235,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
setClickable();
|
setClickable();
|
||||||
mPresenter.getInfo();
|
mPresenter.getUserInfo();
|
||||||
|
mPresenter.getSnInfo();
|
||||||
isForeground = true;
|
isForeground = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +259,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
if (REFRESHACTION.equals(intent.getAction())) {
|
if (REFRESHACTION.equals(intent.getAction())) {
|
||||||
mPresenter.getInfo();
|
mPresenter.getSnInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,10 +389,20 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
continuousClick(COUNTS, DURATION);
|
continuousClick(COUNTS, DURATION);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
cl_vip.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra("json", SnUidJSON);
|
||||||
|
intent.setClass(MainActivity.this, SNUidActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
bt_activation.setOnClickListener(new View.OnClickListener() {
|
bt_activation.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
showActivationDialog();
|
startActivity(new Intent(MainActivity.this, SelecteGradeActivity.class));
|
||||||
|
// showActivationDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
iv_exit.setOnClickListener(new View.OnClickListener() {
|
iv_exit.setOnClickListener(new View.OnClickListener() {
|
||||||
@@ -389,6 +422,12 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
tv_guide.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startActivity(new Intent(MainActivity.this, GuideActivity.class));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -401,7 +440,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
.setOnClickBottomListener(new ActivationDialog.OnClickBottomListener() {
|
.setOnClickBottomListener(new ActivationDialog.OnClickBottomListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPositiveClick() {
|
public void onPositiveClick() {
|
||||||
mPresenter.checkSN();
|
// mPresenter.checkSN();
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,12 +465,18 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPowerUserList(String date) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkSNFinish(int code) {
|
public void checkSNFinish(int code) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 200:
|
case 200:
|
||||||
case 300:
|
case 300:
|
||||||
mPresenter.getGankaoUID();
|
mPresenter.getGankaoUID();
|
||||||
|
ToastUtil.show("设备验证成功");
|
||||||
break;
|
break;
|
||||||
case 400:
|
case 400:
|
||||||
ToastUtil.show("此设备未经授权,禁止激活");
|
ToastUtil.show("此设备未经授权,禁止激活");
|
||||||
@@ -450,19 +495,19 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
ToastUtil.show("用户注册失败");
|
ToastUtil.show("用户注册失败");
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show("用户注册成功");
|
ToastUtil.show("用户注册成功");
|
||||||
mPresenter.queryAvailableProduct();
|
mPresenter.queryAvailableProduct(gankaoUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAvailableProduct(@NotNull List<AvailableProduct> availableProductList) {
|
public void setAvailableProduct(@NotNull List<AvailableProduct> availableProductList, String gankaoUID) {
|
||||||
setGrade(availableProductList);
|
setGrade(availableProductList, gankaoUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param list 通过年纪获取对应的产品id
|
* @param list 通过年纪获取对应的产品id
|
||||||
*/
|
*/
|
||||||
private void setGrade(List<AvailableProduct> list) {
|
private void setGrade(List<AvailableProduct> list, String gankaoUID) {
|
||||||
if (list == null || list.size() == 0) {
|
if (list == null || list.size() == 0) {
|
||||||
ToastUtil.show("获取激活套餐失败");
|
ToastUtil.show("获取激活套餐失败");
|
||||||
} else {
|
} else {
|
||||||
@@ -490,7 +535,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
}
|
}
|
||||||
switch (grade) {
|
switch (grade) {
|
||||||
default:
|
default:
|
||||||
activeUser(defaultProduct);
|
activeUser(defaultProduct, gankaoUID);
|
||||||
break;
|
break;
|
||||||
// case "一年级":
|
// case "一年级":
|
||||||
// case "二年级":
|
// case "二年级":
|
||||||
@@ -514,8 +559,19 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param product 通过产品id激活设备
|
||||||
|
*/
|
||||||
|
private void activeUser(AvailableProduct product, String gankaoUID) {
|
||||||
|
if (product == null) {
|
||||||
|
ToastUtil.show("获取激活套餐失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mPresenter.activeUser(product, gankaoUID);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void activeUser(int code) {
|
public void activeUserFinish(int code) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 10000:
|
case 10000:
|
||||||
ToastUtil.show("授权成功");
|
ToastUtil.show("授权成功");
|
||||||
@@ -553,17 +609,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param product 通过产品id激活设备
|
|
||||||
*/
|
|
||||||
private void activeUser(AvailableProduct product) {
|
|
||||||
if (product == null) {
|
|
||||||
ToastUtil.show("获取激活套餐失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mPresenter.activeUser(product);
|
|
||||||
}
|
|
||||||
|
|
||||||
private final int COUNTS = 4; // 点击次数
|
private final int COUNTS = 4; // 点击次数
|
||||||
private final long DURATION = 2 * 1000; // 规定有效时间
|
private final long DURATION = 2 * 1000; // 规定有效时间
|
||||||
private long[] mHits = new long[COUNTS];
|
private long[] mHits = new long[COUNTS];
|
||||||
@@ -584,13 +629,22 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
private void setClickable() {
|
private void setClickable() {
|
||||||
int isEnabled = Settings.System.getInt(getContentResolver(), activation, 0);
|
int isEnabled = Settings.System.getInt(getContentResolver(), activation, 0);
|
||||||
if (isEnabled == 0) {
|
if (isEnabled == 0) {
|
||||||
|
bt_activation.setVisibility(View.VISIBLE);
|
||||||
|
bt_repurchase.setVisibility(View.GONE);
|
||||||
|
tv_vip.setVisibility(View.GONE);
|
||||||
bt_activation.setEnabled(true);
|
bt_activation.setEnabled(true);
|
||||||
bt_activation.setText("激活学习系统");
|
bt_activation.setText("激活学习系统");
|
||||||
} else {
|
} else {
|
||||||
|
bt_activation.setVisibility(View.GONE);
|
||||||
|
bt_repurchase.setVisibility(View.VISIBLE);
|
||||||
|
tv_vip.setVisibility(View.VISIBLE);
|
||||||
bt_activation.setEnabled(false);
|
bt_activation.setEnabled(false);
|
||||||
bt_activation.setText("已激活学习系统");
|
bt_activation.setText("已激活学习系统");
|
||||||
}
|
}
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
|
bt_activation.setVisibility(View.VISIBLE);
|
||||||
|
bt_repurchase.setVisibility(View.GONE);
|
||||||
|
tv_vip.setVisibility(View.VISIBLE);
|
||||||
bt_activation.setEnabled(true);
|
bt_activation.setEnabled(true);
|
||||||
bt_activation.setText("激活学习系统");
|
bt_activation.setText("激活学习系统");
|
||||||
}
|
}
|
||||||
@@ -625,7 +679,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (REFRESHACTION.equals(intent.getAction())) {
|
if (REFRESHACTION.equals(intent.getAction())) {
|
||||||
mPresenter.getInfo();
|
mPresenter.getSnInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -667,10 +721,14 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInfo(BaseResponse<UserInfo> response) {
|
public void setSnInfo(BaseResponse<UserInfo> response) {
|
||||||
|
if (response != null) {
|
||||||
int code = response.code;
|
int code = response.code;
|
||||||
|
//设备已经绑定
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
UserInfo userInfo = response.data;
|
UserInfo userInfo = response.data;
|
||||||
|
boolean username = Settings.System.putString(getContentResolver(), "UserInfo_username", userInfo.getSn_name());
|
||||||
|
boolean gread = Settings.System.putString(getContentResolver(), "UserInfo_grade", userInfo.getGrade());
|
||||||
SPUtils.put(this, Configs.isLogined, 1);
|
SPUtils.put(this, Configs.isLogined, 1);
|
||||||
SPUtils.put(this, "member_id", userInfo.getMember_id());
|
SPUtils.put(this, "member_id", userInfo.getMember_id());
|
||||||
SPUtils.put(this, "sn_id", userInfo.getId());
|
SPUtils.put(this, "sn_id", userInfo.getId());
|
||||||
@@ -687,17 +745,53 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
tv_grade.setText(userInfo.getGrade());
|
tv_grade.setText(userInfo.getGrade());
|
||||||
}
|
}
|
||||||
mPresenter.getLocked();
|
mPresenter.getLocked();
|
||||||
} else if (code == 300) {
|
}
|
||||||
|
//设备没有绑定
|
||||||
|
else if (code == 300) {
|
||||||
tv_username.setText(defaultText);
|
tv_username.setText(defaultText);
|
||||||
tv_school.setText(defaultText);
|
tv_school.setText(defaultText);
|
||||||
tv_grade.setText(defaultText);
|
tv_grade.setText(defaultText);
|
||||||
ControlManager.getInstance().setDisableSetting();
|
ControlManager.getInstance().setDisableSetting();
|
||||||
} else if (code == 400) {
|
}
|
||||||
|
//没有授权的设备
|
||||||
|
else if (code == 400) {
|
||||||
ToastUtil.show("设备未经授权");
|
ToastUtil.show("设备未经授权");
|
||||||
Log.e(TAG, "setInfo: " + "设备未经授权");
|
Log.e(TAG, "setInfo: " + "设备未经授权");
|
||||||
ControlManager.getInstance().setDisableSetting();
|
ControlManager.getInstance().setDisableSetting();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Log.e(TAG, "setInfo: " + (System.currentTimeMillis() - time0) + "ms");
|
Log.e(TAG, "setInfo: " + (System.currentTimeMillis() - time0) + "ms");
|
||||||
|
mPresenter.getSnUid();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String SnUidJSON;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSnUid(JSONObject jsonObject) {
|
||||||
|
if (jsonObject != null) {
|
||||||
|
this.SnUidJSON = jsonObject.toJSONString();
|
||||||
|
String uid = jsonObject.getString("uid");
|
||||||
|
if (!TextUtils.isEmpty(uid)) {
|
||||||
|
Settings.System.putString(getContentResolver(), "gankaoUID", uid);
|
||||||
|
}
|
||||||
|
// long activate_time = jsonObject.getLong("activate_time");
|
||||||
|
// String card_info = jsonObject.getString("card_info");
|
||||||
|
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// Date d1 = new Date(activate_time * 1000);
|
||||||
|
// int grade = jsonObject.getIntValue("grade");
|
||||||
|
// SPUtils.put(MainActivity.this, "int_grade", grade);
|
||||||
|
// String t1 = format.format(d1);
|
||||||
|
// tv_vip.setText(card_info);
|
||||||
|
// tv_activate.setText(t1 + " 激活");
|
||||||
|
} else {
|
||||||
|
mPresenter.registerGankao();
|
||||||
|
}
|
||||||
|
setClickable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGankao(String gankaoUID) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.info.sn.activity.main;
|
|||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.info.sn.bean.zuoye.BaseResponse;
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
import com.info.sn.bean.zuoye.UserInfo;
|
import com.info.sn.bean.zuoye.UserInfo;
|
||||||
import com.info.sn.bean.gankao.AvailableProduct;
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
@@ -12,13 +13,16 @@ import java.util.List;
|
|||||||
|
|
||||||
public class MainContact {
|
public class MainContact {
|
||||||
public interface MainView extends BaseView {
|
public interface MainView extends BaseView {
|
||||||
|
void setPowerUserList(String date);
|
||||||
void checkSNFinish(int code);
|
void checkSNFinish(int code);
|
||||||
void setGankaoUID(String gankaoUID);
|
void setGankaoUID(String gankaoUID);
|
||||||
void setAvailableProduct( List<AvailableProduct> availableProductList);
|
void setAvailableProduct(List<AvailableProduct> availableProductList, String gankaoUID);
|
||||||
void activeUser( int code);
|
void activeUserFinish(int code);
|
||||||
|
|
||||||
void setQRCode(Bitmap bitmap);
|
void setQRCode(Bitmap bitmap);
|
||||||
void setInfo(BaseResponse<UserInfo> response);
|
void setSnInfo(BaseResponse<UserInfo> response);
|
||||||
|
void setSnUid(JSONObject jsonObject);
|
||||||
|
void setGankao(String gankaoUID);
|
||||||
void setUserInfo();
|
void setUserInfo();
|
||||||
void setLocked(int lockedStatus);
|
void setLocked(int lockedStatus);
|
||||||
void onLocationChanged();
|
void onLocationChanged();
|
||||||
@@ -34,15 +38,20 @@ public class MainContact {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Presenter extends BasePresenter<MainView> {
|
interface Presenter extends BasePresenter<MainView> {
|
||||||
|
void queryPowerUserList();
|
||||||
void checkSN();
|
void checkSN();
|
||||||
void getGankaoUID();
|
void getGankaoUID();
|
||||||
void queryAvailableProduct();
|
void queryAvailableProduct(String gankaoUID);
|
||||||
void activeUser(AvailableProduct product);
|
void activeUser(AvailableProduct product, String gankaoUID);
|
||||||
|
|
||||||
//获取二维码
|
//获取二维码
|
||||||
void getQRCode();
|
void getQRCode();
|
||||||
//获取设备信息
|
//获取设备信息
|
||||||
void getInfo();
|
void getSnInfo();
|
||||||
|
//获取激活时间
|
||||||
|
void getSnUid();
|
||||||
|
//注册赶考账号
|
||||||
|
void registerGankao();
|
||||||
//获取头像昵称
|
//获取头像昵称
|
||||||
void getUserInfo();
|
void getUserInfo();
|
||||||
//获取锁定状态
|
//获取锁定状态
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ import com.amap.api.location.AMapLocation;
|
|||||||
import com.amap.api.location.AMapLocationClient;
|
import com.amap.api.location.AMapLocationClient;
|
||||||
import com.amap.api.location.AMapLocationListener;
|
import com.amap.api.location.AMapLocationListener;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.info.sn.bean.gankao.AvailableProduct;
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
import com.info.sn.bean.gankao.CreateUserBean;
|
import com.info.sn.bean.gankao.CreateUserBean;
|
||||||
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.bean.gankao.PowerUser;
|
||||||
import com.info.sn.bean.zuoye.AppInfo;
|
import com.info.sn.bean.zuoye.AppInfo;
|
||||||
import com.info.sn.bean.zuoye.AppStart;
|
import com.info.sn.bean.zuoye.AppStart;
|
||||||
import com.info.sn.bean.zuoye.BaseResponse;
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
@@ -35,6 +38,7 @@ import com.info.sn.manager.ControlManager;
|
|||||||
import com.info.sn.manager.NetInterfaceManager;
|
import com.info.sn.manager.NetInterfaceManager;
|
||||||
import com.info.sn.network.HTTPInterface;
|
import com.info.sn.network.HTTPInterface;
|
||||||
import com.info.sn.service.ManagerService;
|
import com.info.sn.service.ManagerService;
|
||||||
|
import com.info.sn.service.RemoteService;
|
||||||
import com.info.sn.utils.ApkUtils;
|
import com.info.sn.utils.ApkUtils;
|
||||||
import com.info.sn.utils.CXAESUtil;
|
import com.info.sn.utils.CXAESUtil;
|
||||||
import com.info.sn.utils.JGYUtils;
|
import com.info.sn.utils.JGYUtils;
|
||||||
@@ -95,6 +99,65 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void queryPowerUserList() {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getQueryPowerUserListControl()
|
||||||
|
.queryPowerUserList(appid, timestamp, LaunchTools.getToken(params))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e("queryPowerUserList", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e("queryPowerUserList", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
int code = gankaoBaseResponse.code;
|
||||||
|
if (code == 10000) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type type = new TypeToken<List<PowerUser>>() {
|
||||||
|
}.getType();
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(gson.toJson(gankaoBaseResponse.data)).getAsJsonObject();
|
||||||
|
JsonArray jsonArray = jsonObject.getAsJsonArray("powerlist");
|
||||||
|
List<PowerUser> powerUserList = gson.fromJson(gson.toJson(jsonArray), type);
|
||||||
|
HashMap<String, PowerUser> hashMap = new HashMap<>();
|
||||||
|
for (PowerUser powerUser : powerUserList) {
|
||||||
|
hashMap.put(powerUser.getUserID(), powerUser);
|
||||||
|
}
|
||||||
|
PowerUser powerUser = hashMap.get(Utils.getSerial());
|
||||||
|
if (powerUser != null) {
|
||||||
|
String date = powerUser.getAuthorizationDate();
|
||||||
|
mView.setPowerUserList(date);
|
||||||
|
} else {
|
||||||
|
mView.setPowerUserList("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("queryPowerUserList", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("queryPowerUserList", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkSN() {
|
public void checkSN() {
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
@@ -136,12 +199,319 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
String appid = Scheme.partner_id;
|
String appid = Scheme.partner_id;
|
||||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
String uid = Utils.getSerial();
|
String uid = Utils.getSerial();
|
||||||
Log.e(TAG + TAG, "getGankaoUID: uid: $uid");
|
Log.e(TAG + TAG, "getGankaoUID: uid: " + uid);
|
||||||
if (TextUtils.isEmpty(uid) || "0".equals(uid)) {
|
if (TextUtils.isEmpty(uid) || "0".equals(uid)) {
|
||||||
ToastUtil.show("设备未绑定账号,请绑定后重试");
|
ToastUtil.show("设备未绑定账号,请绑定后重试");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
String token = LaunchTools.getToken(params);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getCreateUserControl()
|
||||||
|
.createUser(appid, timestamp, uid, token)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "getGankaoUID", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + "getGankaoUID", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
if (gankaoBaseResponse.code == 10002) {
|
||||||
|
Type type = new TypeToken<CreateUserBean>() {
|
||||||
|
}.getType();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
CreateUserBean userBean = gson.fromJson(gson.toJson(gankaoBaseResponse.data), type);
|
||||||
|
String gankaoPartnerUID = userBean.getGankaoPartnerUID();
|
||||||
|
int gankaoUIDint = userBean.getGankaoUID();
|
||||||
|
String gankaoUID = String.valueOf(gankaoUIDint);
|
||||||
|
Log.e(TAG + "getGankaoUID", "onNext: gankaoUID: " + gankaoUID);
|
||||||
|
SPUtils.put(mContext, "gankaoUID", gankaoUID);
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "gankaoUID", gankaoUID);
|
||||||
|
int isNew = userBean.getIsNew();
|
||||||
|
mView.setGankaoUID(gankaoUID);
|
||||||
|
} else {
|
||||||
|
mView.setGankaoUID("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
mView.setGankaoUID("");
|
||||||
|
Log.e(TAG + "getGankaoUID", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "getGankaoUID", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void queryAvailableProduct(String gankaoUID) {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getQueryProductControl()
|
||||||
|
.activeUser(appid, timestamp, LaunchTools.getToken(params))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
if (gankaoBaseResponse.code == 10000) {
|
||||||
|
Type type = new TypeToken<List<AvailableProduct>>() {
|
||||||
|
}.getType();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
List<AvailableProduct> availableProductList = gson.fromJson(gson.toJson(gankaoBaseResponse.data), type);
|
||||||
|
mView.setAvailableProduct(availableProductList, gankaoUID);
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("获取激活套餐失败");
|
||||||
|
mView.setAvailableProduct(new ArrayList(), gankaoUID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onError: " + e.getMessage());
|
||||||
|
mView.setAvailableProduct(new ArrayList(), gankaoUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void activeUser(@NotNull AvailableProduct product, String gankaoUID) {
|
||||||
|
String specification_id = product.getSpecification_id();
|
||||||
|
Log.e(TAG, "activeUser: specification_id: " + specification_id);
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
params.put("specification_id", String.valueOf(specification_id));
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getActiveUserControl()
|
||||||
|
.activeUser(appid, timestamp, LaunchTools.getToken(params), uid, specification_id)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "activeUser", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + "activeUser", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
switch (gankaoBaseResponse.code) {
|
||||||
|
case 10000:
|
||||||
|
case 50000:
|
||||||
|
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 1);
|
||||||
|
// sendUid(product, gankaoUID);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
mView.activeUserFinish(gankaoBaseResponse.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "activeUser", "onError: ");
|
||||||
|
mView.activeUserFinish(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "activeUser", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param gankaoUID 发送赶考uid到后台
|
||||||
|
*/
|
||||||
|
// private void sendUid(AvailableProduct product, String gankaoUID) {
|
||||||
|
// NetInterfaceManager.getInstance()
|
||||||
|
// .getSaveSnUidApiControl()
|
||||||
|
// .saveSnUid(Utils.getSerial(), gankaoUID, System.currentTimeMillis() / 1000, product.getDuration())
|
||||||
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
// .subscribe(new Observer<Response>() {
|
||||||
|
// @Override
|
||||||
|
// public void onSubscribe(Disposable d) {
|
||||||
|
// Log.e(TAG + "sendUid", "onSubscribe: ");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onNext(Response response) {
|
||||||
|
// Log.e(TAG + "sendUid", "onNext: " + JSONObject.toJSONString(response));
|
||||||
|
// if (response.code == 200) {
|
||||||
|
// Log.e(TAG + "sendUid", "onNext: " + response.msg);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onError(Throwable e) {
|
||||||
|
// Log.e(TAG + "sendUid", "onError: " + e.getMessage());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onComplete() {
|
||||||
|
// Log.e(TAG + "sendUid", "onComplete: ");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
@Override
|
||||||
|
public void getQRCode() {
|
||||||
|
String encryptString = CXAESUtil.encrypt(Configs.AES_KEY, Utils.getSerial());
|
||||||
|
Log.e(TAG + TAG, "setImageAndText: " + encryptString);
|
||||||
|
Bitmap bitmap = Utils.createQRImage(encryptString, 400, 400);
|
||||||
|
mView.setQRCode(bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String UPDATE_USER_INFO = "UPDATE_USER_INFO";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSnInfo() {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getsnInfoControl()
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<BaseResponse<UserInfo>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "getInfo", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<UserInfo> userInfoBaseResponse) {
|
||||||
|
Log.e(TAG + "getInfo", "onNext: ");
|
||||||
|
mView.setSnInfo(userInfoBaseResponse);
|
||||||
|
int code = userInfoBaseResponse.code;
|
||||||
|
if (code == 200) {
|
||||||
|
UserInfo userInfo = userInfoBaseResponse.data;
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "UserInfo_username", userInfo.getSn_name());
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "UserInfo_grade", userInfo.getGrade());
|
||||||
|
SPUtils.put(mContext, Configs.isLogined, 1);
|
||||||
|
SPUtils.put(mContext, "member_id", userInfo.getMember_id());
|
||||||
|
SPUtils.put(mContext, "sn_id", userInfo.getId());
|
||||||
|
if (!TextUtils.isEmpty(userInfo.getSn_name())) {
|
||||||
|
SPUtils.put(mContext, "USERINFO_NAME", userInfo.getSn_name());
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(userInfo.getSchool())) {
|
||||||
|
SPUtils.put(mContext, "USERINFO_SCHOOL", userInfo.getSchool());
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(userInfo.getGrade())) {
|
||||||
|
SPUtils.put(mContext, "USERINFO_GRADE", userInfo.getGrade());
|
||||||
|
}
|
||||||
|
String gankaoUID = Settings.System.getString(mContext.getContentResolver(), "gankaoUID");
|
||||||
|
String avatar = Settings.System.getString(mContext.getContentResolver(), "UserInfo_avatar");
|
||||||
|
int gread = (int) SPUtils.get(mContext,"int_grade",0);
|
||||||
|
|
||||||
|
JsonObject jsonObject = new JsonObject();
|
||||||
|
jsonObject.addProperty("username", userInfo.getSn_name());
|
||||||
|
jsonObject.addProperty("avatar", avatar);
|
||||||
|
jsonObject.addProperty("grade", gread);
|
||||||
|
jsonObject.addProperty("userid", gankaoUID);
|
||||||
|
jsonObject.addProperty("sn", Utils.getSerial());
|
||||||
|
Log.e(TAG, "getUserInfo:" + jsonObject.toString());
|
||||||
|
Intent intent = new Intent(UPDATE_USER_INFO);
|
||||||
|
intent.putExtra("user_info", jsonObject.toString());
|
||||||
|
intent.setPackage("com.jiaoguanyi.os");
|
||||||
|
intent.setPackage("com.tt.ttutils");
|
||||||
|
mContext.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "getInfo", "onError: " + e.getMessage());
|
||||||
|
mView.setSnInfo(null);
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "getInfo", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSnUid() {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getSnUidApiControl()
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e("getSnUid", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse baseResponse) {
|
||||||
|
Log.e("getSnUid", "onNext: "+JSONObject.toJSONString(baseResponse));
|
||||||
|
int code = baseResponse.code;
|
||||||
|
if (code == 200) {
|
||||||
|
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 1);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(JSONObject.toJSONString(baseResponse.data));
|
||||||
|
mView.setSnUid(jsonObject);
|
||||||
|
} else {
|
||||||
|
mView.setSnUid(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("getSnUid", "onError: " + e.getMessage());
|
||||||
|
mView.setSnUid(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getSnUid", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerGankao() {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
|
||||||
HashMap<String, String> params = new HashMap<>();
|
HashMap<String, String> params = new HashMap<>();
|
||||||
params.put("appid", appid);
|
params.put("appid", appid);
|
||||||
params.put("timestamp", timestamp);
|
params.put("timestamp", timestamp);
|
||||||
@@ -170,21 +540,19 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
String gankaoPartnerUID = userBean.getGankaoPartnerUID();
|
String gankaoPartnerUID = userBean.getGankaoPartnerUID();
|
||||||
int gankaoUIDint = userBean.getGankaoUID();
|
int gankaoUIDint = userBean.getGankaoUID();
|
||||||
String gankaoUID = String.valueOf(gankaoUIDint);
|
String gankaoUID = String.valueOf(gankaoUIDint);
|
||||||
sendUid(gankaoUID);
|
Log.e(TAG + "getGankaoUID", "onNext: gankaoUID: " + gankaoUID);
|
||||||
Log.e(TAG + "getGankaoUID", "onNext: gankaoUID: $gankaoUID");
|
|
||||||
SPUtils.put(mContext, "gankaoUID", gankaoUID);
|
SPUtils.put(mContext, "gankaoUID", gankaoUID);
|
||||||
Settings.System.putString(mContext.getContentResolver(), "gankaoUID", gankaoUID);
|
Settings.System.putString(mContext.getContentResolver(), "gankaoUID", gankaoUID);
|
||||||
int isNew = userBean.getIsNew();
|
int isNew = userBean.getIsNew();
|
||||||
mView.setGankaoUID(gankaoUID);
|
mView.setGankao(gankaoUID);
|
||||||
} else {
|
} else {
|
||||||
mView.setGankaoUID("");
|
mView.setGankao("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
mView.setGankaoUID("");
|
mView.setGankao("");
|
||||||
Log.e(TAG + "getGankaoUID", "onError: " + e.getMessage());
|
Log.e(TAG + "getGankaoUID", "onError: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,183 +563,6 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param gankaoUID 发送赶考uid到后台
|
|
||||||
*/
|
|
||||||
private void sendUid(String gankaoUID) {
|
|
||||||
NetInterfaceManager.getInstance()
|
|
||||||
.getSaveSnUidApiControl(gankaoUID)
|
|
||||||
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
|
||||||
.subscribe(new Observer<Response>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
Log.e(TAG + "sendUid", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(Response response) {
|
|
||||||
Log.e(TAG + "sendUid", "onNext: " + response);
|
|
||||||
if (response.code == 200) {
|
|
||||||
Log.e(TAG + "sendUid", "onNext: " + response.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
Log.e(TAG + "sendUid", "onError: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e(TAG + "sendUid", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void queryAvailableProduct() {
|
|
||||||
String appid = Scheme.partner_id;
|
|
||||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
|
||||||
HashMap<String, String> params = new HashMap<>();
|
|
||||||
params.put("appid", appid);
|
|
||||||
params.put("timestamp", timestamp);
|
|
||||||
NetInterfaceManager.getInstance()
|
|
||||||
.getQueryProductControl()
|
|
||||||
.activeUser(appid, timestamp, LaunchTools.getToken(params))
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
|
||||||
.subscribe(new Observer<GankaoBaseResponse>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
Log.e(TAG + "queryAvailableProduct", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
|
||||||
Log.e(TAG + "queryAvailableProduct", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
|
||||||
if (gankaoBaseResponse.code == 10000) {
|
|
||||||
Type type = new TypeToken<List<AvailableProduct>>() {
|
|
||||||
}.getType();
|
|
||||||
Gson gson = new Gson();
|
|
||||||
List<AvailableProduct> availableProductList = gson.fromJson(gson.toJson(gankaoBaseResponse.data), type);
|
|
||||||
mView.setAvailableProduct(availableProductList);
|
|
||||||
} else {
|
|
||||||
ToastUtil.show("获取激活套餐失败");
|
|
||||||
mView.setAvailableProduct(new ArrayList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
Log.e(TAG + "queryAvailableProduct", "onError: " + e.getMessage());
|
|
||||||
mView.setAvailableProduct(new ArrayList());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e(TAG + "queryAvailableProduct", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void activeUser(@NotNull AvailableProduct product) {
|
|
||||||
int specification_id = product.getSpecification_id();
|
|
||||||
Log.e(TAG, "activeUser: specification_id: " + specification_id);
|
|
||||||
String appid = Scheme.partner_id;
|
|
||||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
|
||||||
String uid = Utils.getSerial();
|
|
||||||
HashMap<String, String> params = new HashMap<>();
|
|
||||||
params.put("appid", appid);
|
|
||||||
params.put("timestamp", timestamp);
|
|
||||||
params.put("uid", uid);
|
|
||||||
params.put("specification_id", String.valueOf(specification_id));
|
|
||||||
|
|
||||||
NetInterfaceManager.getInstance()
|
|
||||||
.getActiveUserControl()
|
|
||||||
.activeUser(appid, timestamp, LaunchTools.getToken(params), uid, specification_id)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
|
||||||
.subscribe(new Observer<GankaoBaseResponse>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
Log.e(TAG + "activeUser", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
|
||||||
Log.e(TAG + "activeUser", "onNext: ");
|
|
||||||
switch (gankaoBaseResponse.code) {
|
|
||||||
case 10000:
|
|
||||||
case 50000:
|
|
||||||
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
mView.activeUser(gankaoBaseResponse.code);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
Log.e(TAG + "activeUser", "onError: ");
|
|
||||||
mView.activeUser(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e(TAG + "activeUser", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getQRCode() {
|
|
||||||
String encryptString = CXAESUtil.encrypt(Configs.AES_KEY, Utils.getSerial());
|
|
||||||
Log.e(TAG + TAG, "setImageAndText: " + encryptString);
|
|
||||||
Bitmap bitmap = Utils.createQRImage(encryptString, 300, 300);
|
|
||||||
mView.setQRCode(bitmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getInfo() {
|
|
||||||
NetInterfaceManager.getInstance()
|
|
||||||
.getsnInfoControl()
|
|
||||||
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
|
||||||
.subscribe(new Observer<BaseResponse<UserInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
Log.e(TAG + "getInfo", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(BaseResponse<UserInfo> userInfoBaseResponse) {
|
|
||||||
Log.e(TAG + "getInfo", "onNext: ");
|
|
||||||
if (userInfoBaseResponse.code == 200) {
|
|
||||||
UserInfo userInfo = userInfoBaseResponse.data;
|
|
||||||
boolean username = Settings.System.putString(mContext.getContentResolver(), "UserInfo_username", userInfo.getSn_name());
|
|
||||||
boolean gread = Settings.System.putString(mContext.getContentResolver(), "UserInfo_grade", userInfo.getGrade());
|
|
||||||
mView.setInfo(userInfoBaseResponse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
Log.e(TAG + "getInfo", "onError: " + e.getMessage());
|
|
||||||
onComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e(TAG + "getInfo", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getUserInfo() {
|
public void getUserInfo() {
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
@@ -411,6 +602,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
Log.e(TAG + "getUserInfo", "onComplete: ");
|
Log.e(TAG + "getUserInfo", "onComplete: ");
|
||||||
|
mView.setUserInfo();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -578,18 +770,22 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
@Override
|
@Override
|
||||||
public void onNext(BaseResponse<SystemSettings> systemSettingsBaseResponse) {
|
public void onNext(BaseResponse<SystemSettings> systemSettingsBaseResponse) {
|
||||||
Log.e(TAG + "getSystemSettings", "onNext: ");
|
Log.e(TAG + "getSystemSettings", "onNext: ");
|
||||||
|
SPUtils.put(mContext, "is_first_connection", 0);
|
||||||
int code = systemSettingsBaseResponse.code;
|
int code = systemSettingsBaseResponse.code;
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
JSONObject jsonObject = (JSONObject) JSON.toJSON(systemSettingsBaseResponse.data);
|
JSONObject jsonObject = (JSONObject) JSON.toJSON(systemSettingsBaseResponse.data);
|
||||||
Log.e(TAG + "getSystemSettings", "onNext: settings: " + jsonObject.toString());
|
Log.e(TAG + "getSystemSettings", "onNext: settings: " + jsonObject.toString());
|
||||||
ControlManager.getInstance().setSystemSetting(mContext, jsonObject.toJSONString());
|
ControlManager.getInstance().setSystemSetting(mContext, jsonObject.toJSONString());
|
||||||
} else {
|
} else {
|
||||||
|
ControlManager.getInstance().setDisableSetting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
|
if ((int) SPUtils.get(mContext, "is_first_connection", 1) == 1) {
|
||||||
|
ControlManager.getInstance().setDisableSetting();
|
||||||
|
}
|
||||||
Log.e(TAG + "getSystemSettings", "onError: " + e.getMessage());
|
Log.e(TAG + "getSystemSettings", "onError: " + e.getMessage());
|
||||||
onComplete();
|
onComplete();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,371 @@
|
|||||||
|
package com.info.sn.activity.selectegrade;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.info.sn.R;
|
||||||
|
import com.info.sn.activity.main.MainActivity;
|
||||||
|
import com.info.sn.base.BaseActivity;
|
||||||
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
|
import com.info.sn.bean.gankao.PowerUser;
|
||||||
|
import com.info.sn.config.Scheme;
|
||||||
|
import com.info.sn.utils.LaunchTools;
|
||||||
|
import com.info.sn.utils.SPUtils;
|
||||||
|
import com.info.sn.utils.ToastUtil;
|
||||||
|
import com.info.sn.utils.Utils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
|
|
||||||
|
public class SelecteGradeActivity extends BaseActivity implements SelecteGradeContact.MainView {
|
||||||
|
@BindView(R.id.radioGroup1)
|
||||||
|
RadioGroup radioGroup1;
|
||||||
|
@BindView(R.id.radioGroup2)
|
||||||
|
RadioGroup radioGroup2;
|
||||||
|
@BindView(R.id.radioGroup3)
|
||||||
|
RadioGroup radioGroup3;
|
||||||
|
@BindView(R.id.radioGroup4)
|
||||||
|
RadioGroup radioGroup4;
|
||||||
|
@BindView(R.id.radioButton1)
|
||||||
|
RadioButton radioButton1;
|
||||||
|
@BindView(R.id.radioButton2)
|
||||||
|
RadioButton radioButton2;
|
||||||
|
@BindView(R.id.radioButton3)
|
||||||
|
RadioButton radioButton3;
|
||||||
|
@BindView(R.id.radioButton4)
|
||||||
|
RadioButton radioButton4;
|
||||||
|
@BindView(R.id.radioButton5)
|
||||||
|
RadioButton radioButton5;
|
||||||
|
@BindView(R.id.radioButton6)
|
||||||
|
RadioButton radioButton6;
|
||||||
|
@BindView(R.id.radioButton7)
|
||||||
|
RadioButton radioButton7;
|
||||||
|
@BindView(R.id.radioButton8)
|
||||||
|
RadioButton radioButton8;
|
||||||
|
@BindView(R.id.radioButton9)
|
||||||
|
RadioButton radioButton9;
|
||||||
|
@BindView(R.id.radioButton10)
|
||||||
|
RadioButton radioButton10;
|
||||||
|
@BindView(R.id.radioButton11)
|
||||||
|
RadioButton radioButton11;
|
||||||
|
@BindView(R.id.radioButton12)
|
||||||
|
RadioButton radioButton12;
|
||||||
|
|
||||||
|
@BindView(R.id.bt_unactivation)
|
||||||
|
Button bt_unactivation;
|
||||||
|
@BindView(R.id.bt_activation)
|
||||||
|
Button bt_activation;
|
||||||
|
|
||||||
|
|
||||||
|
@OnClick({R.id.radioButton1, R.id.radioButton2, R.id.radioButton3, R.id.radioButton4, R.id.radioButton5, R.id.radioButton6,
|
||||||
|
R.id.radioButton7, R.id.radioButton8, R.id.radioButton9, R.id.radioButton10, R.id.radioButton11, R.id.radioButton12})
|
||||||
|
public void onClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
case R.id.radioButton1:
|
||||||
|
showGroup1();
|
||||||
|
grade = 1;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton2:
|
||||||
|
showGroup1();
|
||||||
|
grade = 2;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton3:
|
||||||
|
showGroup1();
|
||||||
|
grade = 3;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton4:
|
||||||
|
showGroup2();
|
||||||
|
grade = 4;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton5:
|
||||||
|
showGroup2();
|
||||||
|
grade = 5;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton6:
|
||||||
|
showGroup2();
|
||||||
|
grade = 6;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton7:
|
||||||
|
showGroup3();
|
||||||
|
grade = 7;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton8:
|
||||||
|
showGroup3();
|
||||||
|
grade = 8;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton9:
|
||||||
|
showGroup3();
|
||||||
|
grade = 9;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton10:
|
||||||
|
showGroup4();
|
||||||
|
grade = 10;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton11:
|
||||||
|
showGroup4();
|
||||||
|
grade = 11;
|
||||||
|
break;
|
||||||
|
case R.id.radioButton12:
|
||||||
|
showGroup4();
|
||||||
|
grade = 12;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int grade;
|
||||||
|
private SelecteGradePresenter mPresenter = new SelecteGradePresenter(this);
|
||||||
|
|
||||||
|
private void showGroup1() {
|
||||||
|
radioGroup2.clearCheck();
|
||||||
|
radioGroup3.clearCheck();
|
||||||
|
radioGroup4.clearCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showGroup2() {
|
||||||
|
radioGroup1.clearCheck();
|
||||||
|
radioGroup3.clearCheck();
|
||||||
|
radioGroup4.clearCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showGroup3() {
|
||||||
|
radioGroup1.clearCheck();
|
||||||
|
radioGroup2.clearCheck();
|
||||||
|
radioGroup4.clearCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showGroup4() {
|
||||||
|
radioGroup1.clearCheck();
|
||||||
|
radioGroup2.clearCheck();
|
||||||
|
radioGroup3.clearCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLayoutId() {
|
||||||
|
return R.layout.activity_selecte_grade;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView() {
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
mPresenter.setProvider(this);
|
||||||
|
mPresenter.attachView(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
setOnclick();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
mPresenter.detachView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setOnclick() {
|
||||||
|
bt_unactivation.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
bt_activation.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
checkGrade();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkGrade() {
|
||||||
|
if (grade == 0) {
|
||||||
|
ToastUtil.show("请选择激活年级");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mPresenter.checkSN();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkSNResult(int code) {
|
||||||
|
switch (code) {
|
||||||
|
case 200:
|
||||||
|
case 300:
|
||||||
|
mPresenter.getGankaoUID();
|
||||||
|
ToastUtil.show("设备验证成功");
|
||||||
|
break;
|
||||||
|
case 400:
|
||||||
|
ToastUtil.show("此设备未经授权,禁止激活");
|
||||||
|
break;
|
||||||
|
case 404:
|
||||||
|
ToastUtil.show("网络连接失败,稍后重试");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGankaoUID(String gankaoUID) {
|
||||||
|
if (TextUtils.isEmpty(gankaoUID)) {
|
||||||
|
ToastUtil.show("用户注册失败");
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("用户注册成功");
|
||||||
|
mPresenter.queryAvailableProduct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, String> mAvailableProductHashMap = new HashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAvailableProduct(List<AvailableProduct> availableProductList) {
|
||||||
|
for (AvailableProduct product : availableProductList) {
|
||||||
|
mAvailableProductHashMap.put(product.getDuration(), product.getSpecification_id());
|
||||||
|
}
|
||||||
|
setGrade(availableProductList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setGrade(List<AvailableProduct> list) {
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
ToastUtil.show("获取激活套餐失败");
|
||||||
|
} else {
|
||||||
|
AvailableProduct defaultProduct = null;
|
||||||
|
AvailableProduct primary = null;
|
||||||
|
AvailableProduct junior = null;
|
||||||
|
AvailableProduct high = null;
|
||||||
|
for (AvailableProduct product : list) {
|
||||||
|
if (product.getDuration().contains("全学段")) {
|
||||||
|
defaultProduct = product;
|
||||||
|
}
|
||||||
|
if (product.getDuration().contains("小学")) {
|
||||||
|
primary = product;
|
||||||
|
}
|
||||||
|
if (product.getDuration().contains("初中")) {
|
||||||
|
junior = product;
|
||||||
|
}
|
||||||
|
if (product.getDuration().contains("高中")) {
|
||||||
|
high = product;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (grade) {
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 6:
|
||||||
|
activeUser(primary, grade);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
case 9:
|
||||||
|
activeUser(junior, grade);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
case 11:
|
||||||
|
case 12:
|
||||||
|
activeUser(high, grade);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SPUtils.put(SelecteGradeActivity.this, "int_grade", grade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param product 通过产品id激活设备
|
||||||
|
*/
|
||||||
|
private void activeUser(AvailableProduct product, int grade) {
|
||||||
|
if (product == null) {
|
||||||
|
ToastUtil.show("获取激活套餐失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mPresenter.activeUser(product, grade);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void activeUserFinish(int code, int grade) {
|
||||||
|
switch (code) {
|
||||||
|
case 10000:
|
||||||
|
ToastUtil.show("授权成功");
|
||||||
|
break;
|
||||||
|
case 50000:
|
||||||
|
ToastUtil.show("已经授权");
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
ToastUtil.show("授权失败");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
mPresenter.queryPowerUserList(grade);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void queryPowerUserListFinish(List<PowerUser> powerUserList, int grade) {
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
if (powerUserList != null && powerUserList.size() != 0) {
|
||||||
|
for (PowerUser powerUser : powerUserList) {
|
||||||
|
if (powerUser.getUserID().equals(Utils.getSerial())) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("card_info", powerUser.getAuthorityName());
|
||||||
|
jsonObject.put("grade", powerUser.getGrade());
|
||||||
|
jsonObject.put("activate_time", powerUser.getAuthorizationDate());
|
||||||
|
jsonObject.put("user_power_id", powerUser.getAuthorizationNumber());
|
||||||
|
jsonObject.put("specification_id", mAvailableProductHashMap.get(powerUser.getAuthorityName()));
|
||||||
|
jsonArray.add(jsonObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mPresenter.sendUid(jsonArray.toJSONString(), grade);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendUidFinish(int code) {
|
||||||
|
if (code == 200) {
|
||||||
|
toGankaoApp();
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("保存信息失败请重试");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toGankaoApp() {
|
||||||
|
String gankaoUID = (String) SPUtils.get(SelecteGradeActivity.this, "gankaoUID", "");
|
||||||
|
if (TextUtils.isEmpty(gankaoUID)) {
|
||||||
|
ToastUtil.show("获取用户信息失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HashMap keys = new HashMap();
|
||||||
|
//device_id 传入赶考 UID 可实现账户公用,不会创建新账号
|
||||||
|
keys.put("device_id", Uri.encode(gankaoUID));
|
||||||
|
keys.put("partner_id", Scheme.partner_id);
|
||||||
|
keys.put("macaddr", Uri.encode(Utils.getAndroid7MAC()));
|
||||||
|
try {
|
||||||
|
String uri = LaunchTools.toUserCenter(SelecteGradeActivity.this, keys, Uri.encode(Scheme.ownCenter));
|
||||||
|
// Scheme.openScheme(MainActivity.this, Scheme.getLogin(MainActivity.this));
|
||||||
|
Scheme.openScheme(SelecteGradeActivity.this, uri);
|
||||||
|
// LaunchTools.goGankao(MainActivity.this, "", "");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.info.sn.activity.selectegrade;
|
||||||
|
|
||||||
|
import com.info.sn.activity.main.MainContact;
|
||||||
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
|
import com.info.sn.bean.gankao.PowerUser;
|
||||||
|
import com.info.sn.mvp.BasePresenter;
|
||||||
|
import com.info.sn.mvp.BaseView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SelecteGradeContact {
|
||||||
|
public interface MainView extends BaseView {
|
||||||
|
void checkSNResult(int code);
|
||||||
|
void setGankaoUID(String gankaoUID);
|
||||||
|
void setAvailableProduct(List<AvailableProduct> availableProductList);
|
||||||
|
void activeUserFinish(int code,int grade);
|
||||||
|
void queryPowerUserListFinish(List<PowerUser> powerUserList, int grade);
|
||||||
|
void sendUidFinish(int code);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Presenter extends BasePresenter<SelecteGradeContact.MainView> {
|
||||||
|
void checkSN();
|
||||||
|
void getGankaoUID();
|
||||||
|
void queryAvailableProduct();
|
||||||
|
void activeUser(AvailableProduct product,int grade);
|
||||||
|
void queryPowerUserList(int grade);
|
||||||
|
void sendUid(String jsonString,int grade);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,357 @@
|
|||||||
|
package com.info.sn.activity.selectegrade;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.info.sn.activity.main.MainActivity;
|
||||||
|
import com.info.sn.activity.main.MainPresenter;
|
||||||
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
|
import com.info.sn.bean.gankao.CreateUserBean;
|
||||||
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.bean.gankao.PowerUser;
|
||||||
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
|
import com.info.sn.bean.zuoye.Response;
|
||||||
|
import com.info.sn.bean.zuoye.UserInfo;
|
||||||
|
import com.info.sn.config.Scheme;
|
||||||
|
import com.info.sn.manager.NetInterfaceManager;
|
||||||
|
import com.info.sn.utils.LaunchTools;
|
||||||
|
import com.info.sn.utils.SPUtils;
|
||||||
|
import com.info.sn.utils.ToastUtil;
|
||||||
|
import com.info.sn.utils.Utils;
|
||||||
|
import com.trello.rxlifecycle2.LifecycleProvider;
|
||||||
|
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class SelecteGradePresenter implements SelecteGradeContact.Presenter {
|
||||||
|
private String TAG;
|
||||||
|
|
||||||
|
private SelecteGradeContact.MainView mView;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
SelecteGradePresenter(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
TAG = context.getClass().getSimpleName() + "." + MainPresenter.class.getSimpleName() + ":";
|
||||||
|
}
|
||||||
|
|
||||||
|
private LifecycleProvider<ActivityEvent> provider;
|
||||||
|
|
||||||
|
public void setProvider(LifecycleProvider<ActivityEvent> provider) {
|
||||||
|
this.provider = provider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LifecycleProvider<ActivityEvent> getProvider() {
|
||||||
|
return provider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attachView(SelecteGradeContact.MainView view) {
|
||||||
|
this.mView = view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detachView() {
|
||||||
|
this.mView = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkSN() {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getsnInfoControl()
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<BaseResponse<UserInfo>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "checkSN", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<UserInfo> userInfoBaseResponse) {
|
||||||
|
Log.e(TAG + "checkSN", "onNext: ");
|
||||||
|
int code = userInfoBaseResponse.code;
|
||||||
|
mView.checkSNResult(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "checkSN", "onError: " + e.getMessage());
|
||||||
|
mView.checkSNResult(404);
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + TAG + "checkSN", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getGankaoUID() {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
Log.e(TAG + TAG, "getGankaoUID: uid: " + uid);
|
||||||
|
if (TextUtils.isEmpty(uid) || "0".equals(uid)) {
|
||||||
|
ToastUtil.show("设备未绑定账号,请绑定后重试");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
String token = LaunchTools.getToken(params);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getCreateUserControl()
|
||||||
|
.createUser(appid, timestamp, uid, token)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "getGankaoUID", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + "getGankaoUID", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
if (gankaoBaseResponse.code == 10002) {
|
||||||
|
Type type = new TypeToken<CreateUserBean>() {
|
||||||
|
}.getType();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
CreateUserBean userBean = gson.fromJson(gson.toJson(gankaoBaseResponse.data), type);
|
||||||
|
String gankaoPartnerUID = userBean.getGankaoPartnerUID();
|
||||||
|
int gankaoUIDint = userBean.getGankaoUID();
|
||||||
|
String gankaoUID = String.valueOf(gankaoUIDint);
|
||||||
|
Log.e(TAG + "getGankaoUID", "onNext: gankaoUID: " + gankaoUID);
|
||||||
|
SPUtils.put(mContext, "gankaoUID", gankaoUID);
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "gankaoUID", gankaoUID);
|
||||||
|
int isNew = userBean.getIsNew();
|
||||||
|
mView.setGankaoUID(gankaoUID);
|
||||||
|
} else {
|
||||||
|
mView.setGankaoUID("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
mView.setGankaoUID("");
|
||||||
|
Log.e(TAG + "getGankaoUID", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "getGankaoUID", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void queryAvailableProduct() {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getQueryProductControl()
|
||||||
|
.activeUser(appid, timestamp, LaunchTools.getToken(params))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
if (gankaoBaseResponse.code == 10000) {
|
||||||
|
Type type = new TypeToken<List<AvailableProduct>>() {
|
||||||
|
}.getType();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
List<AvailableProduct> availableProductList = gson.fromJson(gson.toJson(gankaoBaseResponse.data), type);
|
||||||
|
mView.setAvailableProduct(availableProductList);
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("获取激活套餐失败");
|
||||||
|
mView.setAvailableProduct(new ArrayList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onError: " + e.getMessage());
|
||||||
|
mView.setAvailableProduct(new ArrayList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "queryAvailableProduct", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void activeUser(AvailableProduct product,int grade) {
|
||||||
|
String specification_id = product.getSpecification_id();
|
||||||
|
Log.e(TAG, "activeUser: specification_id: " + specification_id);
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
params.put("specification_id", String.valueOf(specification_id));
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getActiveUserControl()
|
||||||
|
.activeUser(appid, timestamp, LaunchTools.getToken(params), uid, specification_id)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "activeUser", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
String jsonString = JSONObject.toJSONString(gankaoBaseResponse);
|
||||||
|
Log.e(TAG + "activeUser", "onNext: " + jsonString);
|
||||||
|
switch (gankaoBaseResponse.code) {
|
||||||
|
//第一次激活
|
||||||
|
case 10000:
|
||||||
|
//已经授权过的
|
||||||
|
case 50000:
|
||||||
|
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Settings.System.putInt(mContext.getContentResolver(), MainActivity.activation, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
mView.activeUserFinish(gankaoBaseResponse.code,grade);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "activeUser", "onError: ");
|
||||||
|
mView.activeUserFinish(0,grade);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "activeUser", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void queryPowerUserList(int grade) {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getQueryPowerUserListControl()
|
||||||
|
.queryPowerUserList(appid, timestamp, LaunchTools.getToken(params))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e("queryPowerUserList", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e("queryPowerUserList", "onNext: ");
|
||||||
|
// Log.e("queryPowerUserList", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
int code = gankaoBaseResponse.code;
|
||||||
|
if (code == 10000) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type type = new TypeToken<List<PowerUser>>() {
|
||||||
|
}.getType();
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(gson.toJson(gankaoBaseResponse.data)).getAsJsonObject();
|
||||||
|
JsonArray jsonArray = jsonObject.getAsJsonArray("powerlist");
|
||||||
|
List<PowerUser> powerUserList = gson.fromJson(gson.toJson(jsonArray), type);
|
||||||
|
mView. queryPowerUserListFinish(powerUserList,grade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("queryPowerUserList", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("queryPowerUserList", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendUid(String jsonString, int grade) {
|
||||||
|
String gankaoUID = Settings.System.getString(mContext.getContentResolver(), "gankaoUID");
|
||||||
|
if (TextUtils.isEmpty(gankaoUID)) {
|
||||||
|
ToastUtil.show("获取设备UID失败,请重新激活");
|
||||||
|
}
|
||||||
|
Log.e(TAG, "sendUid: " + jsonString);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getSaveSnUidApiControl()
|
||||||
|
.saveSnUid(Utils.getSerial(), gankaoUID, grade, jsonString)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(getProvider().bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<Response>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + "sendUid", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(Response response) {
|
||||||
|
Log.e(TAG + "sendUid", "onNext: " + JSONObject.toJSONString(response));
|
||||||
|
mView.sendUidFinish(response.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + "sendUid", "onError: " + e.getMessage());
|
||||||
|
mView.sendUidFinish(404);
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + "sendUid", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
60
app/src/main/java/com/info/sn/adapter/SNUidAdapter.java
Normal file
60
app/src/main/java/com/info/sn/adapter/SNUidAdapter.java
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
package com.info.sn.adapter;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.info.sn.R;
|
||||||
|
import com.info.sn.bean.zuoye.SNUidBean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SNUidAdapter extends RecyclerView.Adapter<SNUidAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private List<SNUidBean> snUidBeans;
|
||||||
|
|
||||||
|
public void setSnUidBeans(List<SNUidBean> uidBeads) {
|
||||||
|
this.snUidBeans = uidBeads;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
View v = View.inflate(parent.getContext(), R.layout.item_snuid, null);
|
||||||
|
v.setLayoutParams(layoutParams);
|
||||||
|
return new ViewHolder(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
SNUidBean snUidBean = snUidBeans.get(position);
|
||||||
|
holder.tv_name.setText(snUidBean.getCard_info());
|
||||||
|
holder.tv_grade.setText(String.valueOf(snUidBean.getGrade()));
|
||||||
|
holder.tv_time.setText(snUidBean.getActivate_time());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return snUidBeans == null ? 0 : snUidBeans.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
TextView tv_name;
|
||||||
|
TextView tv_grade;
|
||||||
|
TextView tv_time;
|
||||||
|
|
||||||
|
ViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
tv_name = itemView.findViewById(R.id.tv_name);
|
||||||
|
tv_grade = itemView.findViewById(R.id.tv_grade);
|
||||||
|
tv_time = itemView.findViewById(R.id.tv_time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ public class AvailableProduct implements Serializable {
|
|||||||
|
|
||||||
String productname;
|
String productname;
|
||||||
String product_id;
|
String product_id;
|
||||||
int specification_id;
|
String specification_id;
|
||||||
String duration;
|
String duration;
|
||||||
String register_autobind;
|
String register_autobind;
|
||||||
String max_apply_preuser;
|
String max_apply_preuser;
|
||||||
@@ -30,11 +30,11 @@ public class AvailableProduct implements Serializable {
|
|||||||
this.product_id = product_id;
|
this.product_id = product_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSpecification_id() {
|
public String getSpecification_id() {
|
||||||
return specification_id;
|
return specification_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpecification_id(int specification_id) {
|
public void setSpecification_id(String specification_id) {
|
||||||
this.specification_id = specification_id;
|
this.specification_id = specification_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
package com.info.sn.bean.gankao;
|
package com.info.sn.bean.gankao;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class GankaoBaseResponse<T> implements Serializable {
|
public class GankaoBaseResponse<T> implements Serializable {
|
||||||
@@ -12,4 +18,11 @@ public class GankaoBaseResponse<T> implements Serializable {
|
|||||||
public String tokenOK;
|
public String tokenOK;
|
||||||
public T data;
|
public T data;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(gson.toJson(this)).getAsJsonObject();
|
||||||
|
return jsonObject.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
129
app/src/main/java/com/info/sn/bean/gankao/PowerUser.java
Normal file
129
app/src/main/java/com/info/sn/bean/gankao/PowerUser.java
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
package com.info.sn.bean.gankao;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class PowerUser implements Serializable {
|
||||||
|
private static final long serialVersionUID = -6368881020242541651L;
|
||||||
|
@SerializedName("合作方用户id")
|
||||||
|
private String userID;
|
||||||
|
@SerializedName("赶考内部PUID")
|
||||||
|
private int pUID;
|
||||||
|
@SerializedName("赶考UID")
|
||||||
|
private int gankaoUID;
|
||||||
|
@SerializedName("姓名")
|
||||||
|
private String name;
|
||||||
|
@SerializedName("年级")
|
||||||
|
private int grade;
|
||||||
|
@SerializedName("身份")
|
||||||
|
private String identity;
|
||||||
|
@SerializedName("授权记录编号")
|
||||||
|
private int authorizationNumber;
|
||||||
|
@SerializedName("授权日期")
|
||||||
|
private String authorizationDate;
|
||||||
|
@SerializedName("权限规格ID")
|
||||||
|
private int authorityID;
|
||||||
|
@SerializedName("权限名称")
|
||||||
|
private String authorityName;
|
||||||
|
@SerializedName("回款价")
|
||||||
|
private float returnPrice;
|
||||||
|
@SerializedName("有效期")
|
||||||
|
private String validPeriod;
|
||||||
|
|
||||||
|
public String getUserID() {
|
||||||
|
return userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserID(String userID) {
|
||||||
|
this.userID = userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getpUID() {
|
||||||
|
return pUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setpUID(int pUID) {
|
||||||
|
this.pUID = pUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGankaoUID() {
|
||||||
|
return gankaoUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGankaoUID(int gankaoUID) {
|
||||||
|
this.gankaoUID = gankaoUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGrade() {
|
||||||
|
return grade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrade(int grade) {
|
||||||
|
this.grade = grade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdentity() {
|
||||||
|
return identity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentity(String identity) {
|
||||||
|
this.identity = identity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAuthorizationNumber() {
|
||||||
|
return authorizationNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorizationNumber(int authorizationNumber) {
|
||||||
|
this.authorizationNumber = authorizationNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthorizationDate() {
|
||||||
|
return authorizationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorizationDate(String authorizationDate) {
|
||||||
|
this.authorizationDate = authorizationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAuthorityID() {
|
||||||
|
return authorityID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorityID(int authorityID) {
|
||||||
|
this.authorityID = authorityID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthorityName() {
|
||||||
|
return authorityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorityName(String authorityName) {
|
||||||
|
this.authorityName = authorityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getReturnPrice() {
|
||||||
|
return returnPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturnPrice(float returnPrice) {
|
||||||
|
this.returnPrice = returnPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidPeriod() {
|
||||||
|
return validPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidPeriod(String validPeriod) {
|
||||||
|
this.validPeriod = validPeriod;
|
||||||
|
}
|
||||||
|
}
|
||||||
130
app/src/main/java/com/info/sn/bean/gankao/UserProduct.java
Normal file
130
app/src/main/java/com/info/sn/bean/gankao/UserProduct.java
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
package com.info.sn.bean.gankao;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class UserProduct implements Serializable {
|
||||||
|
private static final long serialVersionUID = 7962643432696702587L;
|
||||||
|
|
||||||
|
String id;
|
||||||
|
String user_id;
|
||||||
|
String name;
|
||||||
|
boolean isgroup;
|
||||||
|
String product_id;
|
||||||
|
String user_power_id;
|
||||||
|
String specification_id;
|
||||||
|
String register_autobind;
|
||||||
|
float upgradable;
|
||||||
|
String upgradablehint;
|
||||||
|
String expired_time;
|
||||||
|
String created_at;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUser_id() {
|
||||||
|
return user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_id(String user_id) {
|
||||||
|
this.user_id = user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIsgroup() {
|
||||||
|
return isgroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsgroup(boolean isgroup) {
|
||||||
|
this.isgroup = isgroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProduct_id() {
|
||||||
|
return product_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduct_id(String product_id) {
|
||||||
|
this.product_id = product_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUser_power_id() {
|
||||||
|
return user_power_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_power_id(String user_power_id) {
|
||||||
|
this.user_power_id = user_power_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpecification_id() {
|
||||||
|
return specification_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecification_id(String specification_id) {
|
||||||
|
this.specification_id = specification_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegister_autobind() {
|
||||||
|
return register_autobind;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegister_autobind(String register_autobind) {
|
||||||
|
this.register_autobind = register_autobind;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getUpgradable() {
|
||||||
|
return upgradable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpgradable(float upgradable) {
|
||||||
|
this.upgradable = upgradable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpgradablehint() {
|
||||||
|
return upgradablehint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpgradablehint(String upgradablehint) {
|
||||||
|
this.upgradablehint = upgradablehint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExpired_time() {
|
||||||
|
return expired_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpired_time(String expired_time) {
|
||||||
|
this.expired_time = expired_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreated_at() {
|
||||||
|
return created_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated_at(String created_at) {
|
||||||
|
this.created_at = created_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(gson.toJson(this)).getAsJsonObject();
|
||||||
|
return jsonObject.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.info.sn.bean.gankao;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class UserProductCards<T> implements Serializable {
|
||||||
|
private static final long serialVersionUID = 2956193416718626851L;
|
||||||
|
|
||||||
|
T cards;
|
||||||
|
|
||||||
|
public T getCards() {
|
||||||
|
return cards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCards(T cards) {
|
||||||
|
this.cards = cards;
|
||||||
|
}
|
||||||
|
}
|
||||||
53
app/src/main/java/com/info/sn/bean/zuoye/SNUidBean.java
Normal file
53
app/src/main/java/com/info/sn/bean/zuoye/SNUidBean.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package com.info.sn.bean.zuoye;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class SNUidBean implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8415979808461790756L;
|
||||||
|
|
||||||
|
String specification_id;
|
||||||
|
String user_power_id;
|
||||||
|
int grade;
|
||||||
|
String activate_time;
|
||||||
|
String card_info;
|
||||||
|
|
||||||
|
public String getSpecification_id() {
|
||||||
|
return specification_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecification_id(String specification_id) {
|
||||||
|
this.specification_id = specification_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUser_power_id() {
|
||||||
|
return user_power_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_power_id(String user_power_id) {
|
||||||
|
this.user_power_id = user_power_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGrade() {
|
||||||
|
return grade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrade(int grade) {
|
||||||
|
this.grade = grade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActivate_time() {
|
||||||
|
return activate_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivate_time(String activate_time) {
|
||||||
|
this.activate_time = activate_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCard_info() {
|
||||||
|
return card_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCard_info(String card_info) {
|
||||||
|
this.card_info = card_info;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -529,7 +529,7 @@ public class ControlManager {
|
|||||||
|
|
||||||
private static void setCanReset(Context context, String jsonString) {
|
private static void setCanReset(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int mode = jsonObject.getInteger("qch_restore");
|
int mode = jsonObject.getIntValue("qch_restore");
|
||||||
if (mode == 1) {
|
if (mode == 1) {
|
||||||
Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 0);
|
Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 0);
|
||||||
} else {
|
} else {
|
||||||
@@ -555,7 +555,7 @@ public class ControlManager {
|
|||||||
|
|
||||||
public void setDeveloperOptions(Context context, String jsonString) {
|
public void setDeveloperOptions(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int dev_mode = changeNum(jsonObject.getInteger("dev_mode"));
|
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
|
||||||
Log.e(TAG, "getDeveloper: " + dev_mode);
|
Log.e(TAG, "getDeveloper: " + dev_mode);
|
||||||
if (!DeviceManager.isDebugMode()) {
|
if (!DeviceManager.isDebugMode()) {
|
||||||
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
|
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
|
||||||
|
|||||||
@@ -7,25 +7,28 @@ import android.os.Environment;
|
|||||||
import com.info.sn.bean.zuoye.AppInfo;
|
import com.info.sn.bean.zuoye.AppInfo;
|
||||||
import com.info.sn.bean.zuoye.AppStart;
|
import com.info.sn.bean.zuoye.AppStart;
|
||||||
import com.info.sn.bean.zuoye.BaseResponse;
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
import com.info.sn.bean.zuoye.Response;
|
|
||||||
import com.info.sn.bean.zuoye.SystemSettings;
|
import com.info.sn.bean.zuoye.SystemSettings;
|
||||||
import com.info.sn.bean.zuoye.UserAvatarInfo;
|
import com.info.sn.bean.zuoye.UserAvatarInfo;
|
||||||
import com.info.sn.bean.zuoye.UserInfo;
|
import com.info.sn.bean.zuoye.UserInfo;
|
||||||
import com.info.sn.network.UrlAddress;
|
import com.info.sn.network.UrlAddress;
|
||||||
import com.info.sn.network.api.APPJump;
|
import com.info.sn.network.api.APPJump;
|
||||||
import com.info.sn.network.api.ActiveUserApi;
|
import com.info.sn.network.api.gankao.ActiveUserApi;
|
||||||
import com.info.sn.network.api.AddAppInstall;
|
import com.info.sn.network.api.AddAppInstall;
|
||||||
import com.info.sn.network.api.AppUsedApi;
|
import com.info.sn.network.api.AppUsedApi;
|
||||||
import com.info.sn.network.api.BindDevices;
|
import com.info.sn.network.api.BindDevices;
|
||||||
import com.info.sn.network.api.Browser;
|
import com.info.sn.network.api.Browser;
|
||||||
import com.info.sn.network.api.CreateUserApi;
|
import com.info.sn.network.api.gankao.CancelUserPowerApi;
|
||||||
|
import com.info.sn.network.api.gankao.CreateUserApi;
|
||||||
import com.info.sn.network.api.ForceInstall;
|
import com.info.sn.network.api.ForceInstall;
|
||||||
import com.info.sn.network.api.BrowserLabel;
|
import com.info.sn.network.api.BrowserLabel;
|
||||||
|
import com.info.sn.network.api.GetGuideApi;
|
||||||
|
import com.info.sn.network.api.GetSnUidApi;
|
||||||
import com.info.sn.network.api.NewestAppUpdate;
|
import com.info.sn.network.api.NewestAppUpdate;
|
||||||
import com.info.sn.network.api.QRCodeApi;
|
import com.info.sn.network.api.QRCodeApi;
|
||||||
import com.info.sn.network.api.QueryAllApp;
|
import com.info.sn.network.api.QueryAllApp;
|
||||||
import com.info.sn.network.api.QueryAppInside;
|
import com.info.sn.network.api.QueryAppInside;
|
||||||
import com.info.sn.network.api.QueryProductApi;
|
import com.info.sn.network.api.gankao.QueryPowerUserListApi;
|
||||||
|
import com.info.sn.network.api.gankao.QueryProductApi;
|
||||||
import com.info.sn.network.api.QuerySnAppStart;
|
import com.info.sn.network.api.QuerySnAppStart;
|
||||||
import com.info.sn.network.api.RunningApp;
|
import com.info.sn.network.api.RunningApp;
|
||||||
import com.info.sn.network.api.SNInfoApi;
|
import com.info.sn.network.api.SNInfoApi;
|
||||||
@@ -38,6 +41,8 @@ import com.info.sn.network.api.TimeControl;
|
|||||||
import com.info.sn.network.api.UpdateAdminSn;
|
import com.info.sn.network.api.UpdateAdminSn;
|
||||||
import com.info.sn.network.api.UploadScreenshot;
|
import com.info.sn.network.api.UploadScreenshot;
|
||||||
import com.info.sn.network.api.UserInfoControl;
|
import com.info.sn.network.api.UserInfoControl;
|
||||||
|
import com.info.sn.network.api.gankao.UpgradeUserPowerApi;
|
||||||
|
import com.info.sn.network.api.gankao.UserProductsApi;
|
||||||
import com.info.sn.utils.Utils;
|
import com.info.sn.utils.Utils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -218,11 +223,8 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<Response> getSaveSnUidApiControl(String uid) {
|
public SaveSnUidApi getSaveSnUidApiControl() {
|
||||||
return mRetrofit.create(SaveSnUidApi.class)
|
return mRetrofit.create(SaveSnUidApi.class);
|
||||||
.saveSnUid(Utils.getSerial(), uid)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -251,6 +253,19 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Observable<BaseResponse> getGetGuideControl() {
|
||||||
|
return mRetrofit.create(GetGuideApi.class)
|
||||||
|
.getGuidePic(2)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Observable<BaseResponse> getSnUidApiControl() {
|
||||||
|
return mRetrofit.create(GetSnUidApi.class)
|
||||||
|
.getSnUid(Utils.getSerial())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
//赶考
|
//赶考
|
||||||
|
|
||||||
@@ -266,5 +281,19 @@ public class NetInterfaceManager {
|
|||||||
return mGankaoRetrofit.create(QueryProductApi.class);
|
return mGankaoRetrofit.create(QueryProductApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QueryPowerUserListApi getQueryPowerUserListControl() {
|
||||||
|
return mGankaoRetrofit.create(QueryPowerUserListApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserProductsApi getUserProductsControl() {
|
||||||
|
return mGankaoRetrofit.create(UserProductsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CancelUserPowerApi getCancelUserPowerControl() {
|
||||||
|
return mGankaoRetrofit.create(CancelUserPowerApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpgradeUserPowerApi getUpgradeUserPowerControl() {
|
||||||
|
return mGankaoRetrofit.create(UpgradeUserPowerApi.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class HTTPInterface {
|
|||||||
// Log.e("SendAppInstall", installOrRemove + "return: " + packages);
|
// Log.e("SendAppInstall", installOrRemove + "return: " + packages);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
Log.e(TAG, "SendAppInstall: " + jsonString);
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getAddAppInstallControl()
|
.getAddAppInstallControl()
|
||||||
.installorRemove(
|
.installorRemove(
|
||||||
|
|||||||
@@ -49,11 +49,14 @@ public class UrlAddress {
|
|||||||
public static final String GET_USER_AVATAR_INFO = "sn/getUserAvatarInfo";
|
public static final String GET_USER_AVATAR_INFO = "sn/getUserAvatarInfo";
|
||||||
//上传设备赶考的UID
|
//上传设备赶考的UID
|
||||||
public static final String POST_USER_SAVESNUID = "sn/saveSnUid";
|
public static final String POST_USER_SAVESNUID = "sn/saveSnUid";
|
||||||
|
//获取激活时间和赶考UID
|
||||||
|
public static final String GET_SN_UID = "sn/getSnUid";
|
||||||
//获取app使用信息
|
//获取app使用信息
|
||||||
public static final String UPLOAD_APP_USE_INFO = "sn/uploadAppUseInfo";
|
public static final String UPLOAD_APP_USE_INFO = "sn/uploadAppUseInfo";
|
||||||
//获取小程序二维码
|
//获取小程序二维码
|
||||||
public static final String GET_APPLET_QRCODE = "file/getAppletQrCode";
|
public static final String GET_APPLET_QRCODE = "file/getAppletQrCode";
|
||||||
|
//获取操作指南
|
||||||
|
public static final String GET_OPERATION_GUIDE = "file/getFiles";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -65,5 +68,12 @@ public class UrlAddress {
|
|||||||
public static final String ACTIVE_USER = "activeUser";
|
public static final String ACTIVE_USER = "activeUser";
|
||||||
//获得可用的权限产品规格
|
//获得可用的权限产品规格
|
||||||
public static final String QUERY_AVAILABLE_PRODUCT_SPECIFICATIONS = "queryAvailableProductSpecifications";
|
public static final String QUERY_AVAILABLE_PRODUCT_SPECIFICATIONS = "queryAvailableProductSpecifications";
|
||||||
|
//获取机构的接口授权记录
|
||||||
|
public static final String QUERY_POWER_USER_LIST = "queryPowerUserList";
|
||||||
|
//获取用户已获得的产品列表(权限、单体课程、套餐等)
|
||||||
|
public static final String GET_USER_PRODUCTS = "getUserProducts";
|
||||||
|
//升级用户会员权限的学段
|
||||||
|
public static final String UPGRADE_USER_POWER = "upgradeUserPower";
|
||||||
|
//撤销指定的用户授权记录
|
||||||
|
public static final String CANCEL_USER_POWER = "cancelUserPower";
|
||||||
}
|
}
|
||||||
|
|||||||
15
app/src/main/java/com/info/sn/network/api/GetGuideApi.java
Normal file
15
app/src/main/java/com/info/sn/network/api/GetGuideApi.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package com.info.sn.network.api;
|
||||||
|
|
||||||
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface GetGuideApi {
|
||||||
|
@GET(UrlAddress.GET_OPERATION_GUIDE)
|
||||||
|
Observable<BaseResponse> getGuidePic(
|
||||||
|
@Query("type") int type
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.info.sn.network.api;
|
||||||
|
|
||||||
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface GetGuideApiTest {
|
||||||
|
@GET(UrlAddress.GET_OPERATION_GUIDE)
|
||||||
|
Observable getGuidePic(
|
||||||
|
@Query("type") int type
|
||||||
|
);
|
||||||
|
}
|
||||||
15
app/src/main/java/com/info/sn/network/api/GetSnUidApi.java
Normal file
15
app/src/main/java/com/info/sn/network/api/GetSnUidApi.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package com.info.sn.network.api;
|
||||||
|
|
||||||
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface GetSnUidApi {
|
||||||
|
@GET(UrlAddress.GET_SN_UID)
|
||||||
|
Observable<BaseResponse> getSnUid(
|
||||||
|
@Query("sn") String sn
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -13,6 +13,8 @@ public interface SaveSnUidApi {
|
|||||||
@POST(UrlAddress.POST_USER_SAVESNUID)
|
@POST(UrlAddress.POST_USER_SAVESNUID)
|
||||||
Observable<Response> saveSnUid(
|
Observable<Response> saveSnUid(
|
||||||
@Field("sn") String sn,
|
@Field("sn") String sn,
|
||||||
@Field("uid") String uid
|
@Field("uid") String uid,
|
||||||
|
@Field("grade") int grade,
|
||||||
|
@Field("card_info") String card_info
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.info.sn.network.api;
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
import com.info.sn.network.UrlAddress;
|
import com.info.sn.network.UrlAddress;
|
||||||
@@ -15,6 +15,6 @@ public interface ActiveUserApi {
|
|||||||
@Query("timestamp") String timestamp,
|
@Query("timestamp") String timestamp,
|
||||||
@Query("token") String token,
|
@Query("token") String token,
|
||||||
@Query("uid") String uid,
|
@Query("uid") String uid,
|
||||||
@Query("specification_id") int specification_id
|
@Query("specification_id") String specification_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface CancelUserPowerApi {
|
||||||
|
@GET(UrlAddress.CANCEL_USER_POWER)
|
||||||
|
Observable<GankaoBaseResponse> cancelUserPower(
|
||||||
|
@Query("app_id") String app_id,
|
||||||
|
@Query("timestamp") String timestamp,
|
||||||
|
@Query("token") String token,
|
||||||
|
@Query("user_power_id") String user_power_id,
|
||||||
|
@Query("specification_id") String specification_id
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.info.sn.network.api;
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
import com.info.sn.network.UrlAddress;
|
import com.info.sn.network.UrlAddress;
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface QueryPowerUserListApi {
|
||||||
|
@GET(UrlAddress.QUERY_POWER_USER_LIST)
|
||||||
|
Observable<GankaoBaseResponse> queryPowerUserList(
|
||||||
|
@Query("app_id") String app_id,
|
||||||
|
@Query("timestamp") String timestamp,
|
||||||
|
@Query("token") String token
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.info.sn.network.api;
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
import com.info.sn.network.UrlAddress;
|
import com.info.sn.network.UrlAddress;
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface UpgradeUserPowerApi {
|
||||||
|
@GET(UrlAddress.UPGRADE_USER_POWER)
|
||||||
|
Observable<GankaoBaseResponse> upgradeUserPower(
|
||||||
|
@Query("app_id") String app_id,
|
||||||
|
@Query("timestamp") String timestamp,
|
||||||
|
@Query("token") String token,
|
||||||
|
@Query("uid") String uid,
|
||||||
|
@Query("user_power_id") int user_power_id
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.info.sn.network.api.gankao;
|
||||||
|
|
||||||
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.bean.gankao.UserProduct;
|
||||||
|
import com.info.sn.bean.gankao.UserProductCards;
|
||||||
|
import com.info.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface UserProductsApi {
|
||||||
|
@GET(UrlAddress.GET_USER_PRODUCTS)
|
||||||
|
Observable<GankaoBaseResponse<UserProductCards<List<UserProduct>>>> getUserProducts(
|
||||||
|
@Query("app_id") String app_id,
|
||||||
|
@Query("timestamp") String timestamp,
|
||||||
|
@Query("token") String token,
|
||||||
|
@Query("uid") String uid
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ public class InstallResultReceiver extends BroadcastReceiver {
|
|||||||
// Log.e("fht", LEGACY_STATUS);
|
// Log.e("fht", LEGACY_STATUS);
|
||||||
// Log.e("fht", STATUS_MESSAGE);
|
// Log.e("fht", STATUS_MESSAGE);
|
||||||
if (STATUS_MESSAGE != null && STATUS_MESSAGE.equals("INSTALL_SUCCEEDED")) {
|
if (STATUS_MESSAGE != null && STATUS_MESSAGE.equals("INSTALL_SUCCEEDED")) {
|
||||||
ToastUtil.show(PACKAGE_NAME + "安装成功");
|
// ToastUtil.show(PACKAGE_NAME + "安装成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import android.os.Bundle;
|
|||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@@ -20,7 +21,15 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
import com.arialyy.aria.core.download.DownloadEntity;
|
import com.arialyy.aria.core.download.DownloadEntity;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.info.sn.activity.main.MainActivity;
|
||||||
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
|
import com.info.sn.bean.gankao.GankaoBaseResponse;
|
||||||
|
import com.info.sn.bean.gankao.UserProduct;
|
||||||
|
import com.info.sn.bean.gankao.UserProductCards;
|
||||||
import com.info.sn.bean.zuoye.BaseResponse;
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
|
import com.info.sn.config.Scheme;
|
||||||
import com.info.sn.jpush.Logger;
|
import com.info.sn.jpush.Logger;
|
||||||
import com.info.sn.manager.ControlManager;
|
import com.info.sn.manager.ControlManager;
|
||||||
import com.info.sn.network.HTTPInterface;
|
import com.info.sn.network.HTTPInterface;
|
||||||
@@ -33,15 +42,21 @@ import com.info.sn.utils.CacheUtils;
|
|||||||
import com.info.sn.utils.CmdUtil;
|
import com.info.sn.utils.CmdUtil;
|
||||||
import com.info.sn.manager.DeviceManager;
|
import com.info.sn.manager.DeviceManager;
|
||||||
import com.info.sn.utils.JGYUtils;
|
import com.info.sn.utils.JGYUtils;
|
||||||
|
import com.info.sn.utils.LaunchTools;
|
||||||
import com.info.sn.utils.SPUtils;
|
import com.info.sn.utils.SPUtils;
|
||||||
import com.info.sn.utils.ServiceAliveUtils;
|
import com.info.sn.utils.ServiceAliveUtils;
|
||||||
import com.info.sn.utils.ToastUtil;
|
import com.info.sn.utils.ToastUtil;
|
||||||
import com.info.sn.utils.Utils;
|
import com.info.sn.utils.Utils;
|
||||||
import com.info.sn.dialog.CustomDialog;
|
import com.info.sn.dialog.CustomDialog;
|
||||||
|
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -139,7 +154,12 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
//搜题开关
|
//搜题开关
|
||||||
private static final String JIGUANG_SEARCH_TOPIC = "39";
|
private static final String JIGUANG_SEARCH_TOPIC = "39";
|
||||||
//电话白名单推送
|
//电话白名单推送
|
||||||
private static final String JIGUANG_PHONE_LIST = "49";
|
private static final String JIGUANG_PHONE_LIST = "40";
|
||||||
|
//调整套餐
|
||||||
|
private static final String JIGUANG_CHANGE_COMBO = "41";
|
||||||
|
//取消所有套餐
|
||||||
|
private static final String JIGUANG_CANCEL_COMBO = "42";
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
@@ -217,7 +237,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
case JIGUANG_APP_NETWORKSTATE:
|
case JIGUANG_APP_NETWORKSTATE:
|
||||||
ToastUtil.debugShow("收到推送消息: 应用联网管控");
|
ToastUtil.debugShow("收到推送消息: 应用联网管控");
|
||||||
setAppNetworkstate(context, extras);
|
setAppNetworkstate(context, extras);
|
||||||
HTTPInterface.getAppInside();
|
Handler.getMain().postDelayed(HTTPInterface::getAppInside, 2000);
|
||||||
break;
|
break;
|
||||||
case JIGUANG_APP_LOCKEDSTATE:
|
case JIGUANG_APP_LOCKEDSTATE:
|
||||||
ToastUtil.debugShow("收到推送消息: 应用锁管控");
|
ToastUtil.debugShow("收到推送消息: 应用锁管控");
|
||||||
@@ -263,12 +283,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
break;
|
break;
|
||||||
case JIGUANG_APP_NET_AUTO:
|
case JIGUANG_APP_NET_AUTO:
|
||||||
ToastUtil.debugShow("收到推送消息: APP联网自启管控");
|
ToastUtil.debugShow("收到推送消息: APP联网自启管控");
|
||||||
Handler.getMain().postDelayed(new Runnable() {
|
Handler.getMain().postDelayed(() -> HTTPInterface.getAllappPackage(context), 2000);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
HTTPInterface.getAllappPackage(context);
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
break;
|
break;
|
||||||
case JIGUANG_BROWSER_LABEL:
|
case JIGUANG_BROWSER_LABEL:
|
||||||
try {
|
try {
|
||||||
@@ -290,12 +305,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
break;
|
break;
|
||||||
case JIGUANG_APP_SETTING:
|
case JIGUANG_APP_SETTING:
|
||||||
ToastUtil.debugShow("收到推送消息: 获取app管控设置");
|
ToastUtil.debugShow("收到推送消息: 获取app管控设置");
|
||||||
Handler.getMain().postDelayed(new Runnable() {
|
Handler.getMain().postDelayed(() -> HTTPInterface.getAllappPackage(context), 2000);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
HTTPInterface.getAllappPackage(context);
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
break;
|
break;
|
||||||
case JIGUANG_FORCE_KILL:
|
case JIGUANG_FORCE_KILL:
|
||||||
ToastUtil.debugShow("收到推送消息: 强制停止应用");
|
ToastUtil.debugShow("收到推送消息: 强制停止应用");
|
||||||
@@ -353,11 +363,18 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
ToastUtil.debugShow("收到推送消息: 电话白名单管控");
|
ToastUtil.debugShow("收到推送消息: 电话白名单管控");
|
||||||
setPhone(context, extras);
|
setPhone(context, extras);
|
||||||
break;
|
break;
|
||||||
|
case JIGUANG_CHANGE_COMBO:
|
||||||
|
changeCombo(context, extras);
|
||||||
|
break;
|
||||||
|
case JIGUANG_CANCEL_COMBO:
|
||||||
|
cancleCombo(context, extras);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int changeNum(int paramInt) {
|
private int changeNum(int paramInt) {
|
||||||
return paramInt == 1 ? 0 : 1;
|
return paramInt == 1 ? 0 : 1;
|
||||||
}
|
}
|
||||||
@@ -399,7 +416,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
synchronized private void setTfcardState(Context context, String jsonString) {
|
synchronized private void setTfcardState(Context context, String jsonString) {
|
||||||
if (!TextUtils.isEmpty(jsonString)) {
|
if (!TextUtils.isEmpty(jsonString)) {
|
||||||
JSONObject extra = JSON.parseObject(jsonString);
|
JSONObject extra = JSON.parseObject(jsonString);
|
||||||
int is_tf = extra.getInteger("setting_memory");
|
int is_tf = extra.getIntValue("setting_memory");
|
||||||
boolean qch_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", changeNum(is_tf));
|
boolean qch_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", changeNum(is_tf));
|
||||||
if (qch_sdcard_forbid_on) {
|
if (qch_sdcard_forbid_on) {
|
||||||
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), "qch_sdcard_forbid_on"));
|
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), "qch_sdcard_forbid_on"));
|
||||||
@@ -419,7 +436,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();//获取默认蓝牙适配器
|
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();//获取默认蓝牙适配器
|
||||||
}
|
}
|
||||||
JSONObject extra = JSON.parseObject(jsonString);
|
JSONObject extra = JSON.parseObject(jsonString);
|
||||||
int is_bluetooth = changeNum(extra.getInteger("setting_bluetooth"));
|
int is_bluetooth = changeNum(extra.getIntValue("setting_bluetooth"));
|
||||||
Log.e(TAG, "qch_bht_forbid_on:" + is_bluetooth);
|
Log.e(TAG, "qch_bht_forbid_on:" + is_bluetooth);
|
||||||
try {
|
try {
|
||||||
//写入系统数据库
|
//写入系统数据库
|
||||||
@@ -474,7 +491,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
if (!TextUtils.isEmpty(jsonString)) {
|
if (!TextUtils.isEmpty(jsonString)) {
|
||||||
JSONObject extra = JSON.parseObject(jsonString);
|
JSONObject extra = JSON.parseObject(jsonString);
|
||||||
String packageName = extra.getString("package");
|
String packageName = extra.getString("package");
|
||||||
int is_lock = extra.getInteger("is_lock");
|
int is_lock = extra.getIntValue("is_lock");
|
||||||
ToastUtil.debugShow("收到应用锁管控消息:包名" + packageName + "is_lock_state:" + is_lock);
|
ToastUtil.debugShow("收到应用锁管控消息:包名" + packageName + "is_lock_state:" + is_lock);
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
//后台为0可能传过来null
|
//后台为0可能传过来null
|
||||||
@@ -622,7 +639,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
private void setTFmedia(Context context, String jsonString) {
|
private void setTFmedia(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
//影音管控开关
|
//影音管控开关
|
||||||
int setting_tfmedia = jsonObject.getInteger("setting_tfmedia");
|
int setting_tfmedia = jsonObject.getIntValue("setting_tfmedia");
|
||||||
Log.e("SystemSetting", "qch_tfmedia_forbid---------" + setting_tfmedia);
|
Log.e("SystemSetting", "qch_tfmedia_forbid---------" + setting_tfmedia);
|
||||||
|
|
||||||
if (setting_tfmedia == 1) {
|
if (setting_tfmedia == 1) {
|
||||||
@@ -642,16 +659,16 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
private void setCameta(Context context, String jsonString) {
|
private void setCameta(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
//摄像头开关
|
//摄像头开关
|
||||||
int setting_camera = changeNum(jsonObject.getInteger("setting_camera"));
|
int setting_camera = changeNum(jsonObject.getIntValue("setting_camera"));
|
||||||
JGYUtils.putInt(context.getContentResolver(), "qch_app_camera", setting_camera);
|
JGYUtils.putInt(context.getContentResolver(), "qch_app_camera", setting_camera);
|
||||||
ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
||||||
Log.e("SystemSetting", "setting_camera---------" + setting_camera);
|
Log.e("SystemSetting", "setting_camera---------" + setting_camera);
|
||||||
String cameraStatus = "";
|
String cameraStatus = "";
|
||||||
switch (setting_camera) {
|
switch (setting_camera) {
|
||||||
case 1:
|
case 0:
|
||||||
cameraStatus = "qch_camera_open";
|
cameraStatus = "qch_camera_open";
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 1:
|
||||||
cameraStatus = "qch_camera_forbid";
|
cameraStatus = "qch_camera_forbid";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -698,9 +715,9 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
// intent.putExtra("name", name);
|
// intent.putExtra("name", name);
|
||||||
if (type.equals("1")) {
|
if ("1".equals(type)) {
|
||||||
intent.setAction(ManagerService.ACTION_LOCK);
|
intent.setAction(ManagerService.ACTION_LOCK);
|
||||||
} else if (type.equals("0")) {
|
} else if ("0".equals(type)) {
|
||||||
intent.setAction(ManagerService.ACTION_UNLOCK);
|
intent.setAction(ManagerService.ACTION_UNLOCK);
|
||||||
}
|
}
|
||||||
context.sendBroadcast(intent);
|
context.sendBroadcast(intent);
|
||||||
@@ -841,7 +858,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
*/
|
*/
|
||||||
private void setHotspot(Context context, String jsonString) {
|
private void setHotspot(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int setting_hotspot = changeNum(jsonObject.getInteger("setting_hotspot"));//热点
|
int setting_hotspot = changeNum(jsonObject.getIntValue("setting_hotspot"));//热点
|
||||||
try {
|
try {
|
||||||
if (setting_hotspot == 1) {
|
if (setting_hotspot == 1) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
@@ -859,20 +876,20 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
private void setRestore(Context context, String jsonString) {
|
private void setRestore(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int mode = jsonObject.getInteger("qch_restore");
|
int mode = jsonObject.getIntValue("qch_restore");
|
||||||
boolean qch_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_restore_forbid_on", changeNum(mode));
|
boolean qch_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_restore_forbid_on", changeNum(mode));
|
||||||
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBrowserInput(Context context, String jsonString) {
|
private void setBrowserInput(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int setting_browserInput = changeNum(jsonObject.getInteger("setting_browserInput"));
|
int setting_browserInput = changeNum(jsonObject.getIntValue("setting_browserInput"));
|
||||||
JGYUtils.putInt(context.getContentResolver(), "qch_Browser_input", setting_browserInput);
|
JGYUtils.putInt(context.getContentResolver(), "qch_Browser_input", setting_browserInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDeveloper(Context context, String jsonString) {
|
private void setDeveloper(Context context, String jsonString) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int dev_mode = changeNum(jsonObject.getInteger("dev_mode"));
|
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
|
||||||
Log.e(TAG, "getDeveloper: " + dev_mode);
|
Log.e(TAG, "getDeveloper: " + dev_mode);
|
||||||
if (!DeviceManager.isDebugMode()) {
|
if (!DeviceManager.isDebugMode()) {
|
||||||
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
|
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
|
||||||
@@ -912,9 +929,211 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
private void searchTopic(Context context, String jsonString) {
|
private void searchTopic(Context context, String jsonString) {
|
||||||
Log.e(TAG, "searchTopic: " + jsonString);
|
Log.e(TAG, "searchTopic: " + jsonString);
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
int search_topic = jsonObject.getInteger("search_topic");
|
int search_topic = jsonObject.getIntValue("search_topic");
|
||||||
SPUtils.put(context, "search_topic", search_topic);
|
SPUtils.put(context, "search_topic", search_topic);
|
||||||
JGYUtils.updateForbidList(context);
|
JGYUtils.updateForbidList(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void changeCombo(Context context, String jsonString) {
|
||||||
|
Log.e(TAG, "changeCombo: " + jsonString);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
|
String card_info = jsonObject.getString("card_info");
|
||||||
|
if (TextUtils.isEmpty(card_info)) {
|
||||||
|
ToastUtil.show("要修改的套餐名为空");
|
||||||
|
} else {
|
||||||
|
HashSet<String> infoSet = new HashSet<>(Arrays.asList(card_info.split(",")));
|
||||||
|
for (String cardInfo : infoSet) {
|
||||||
|
queryAvailableProduct(cardInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void queryAvailableProduct(String card_info) {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getQueryProductControl()
|
||||||
|
.activeUser(appid, timestamp, LaunchTools.getToken(params))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + ":queryAvailableProduct", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + ":queryAvailableProduct", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
if (gankaoBaseResponse.code == 10000) {
|
||||||
|
Type type = new TypeToken<List<AvailableProduct>>() {
|
||||||
|
}.getType();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
List<AvailableProduct> availableProductList = gson.fromJson(gson.toJson(gankaoBaseResponse.data), type);
|
||||||
|
AvailableProduct product = null;
|
||||||
|
for (AvailableProduct availableProduct : availableProductList) {
|
||||||
|
if (availableProduct.getDuration().contains(card_info)) {
|
||||||
|
product = availableProduct;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
activeUser(product);
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("获取激活套餐失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + ":queryAvailableProduct", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + ":queryAvailableProduct", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void activeUser(@NotNull AvailableProduct product) {
|
||||||
|
if (product == null) {
|
||||||
|
ToastUtil.show("获取套餐失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String specification_id = product.getSpecification_id();
|
||||||
|
Log.e(TAG, "activeUser: specification_id: " + specification_id);
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
params.put("specification_id", String.valueOf(specification_id));
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getActiveUserControl()
|
||||||
|
.activeUser(appid, timestamp, LaunchTools.getToken(params), uid, specification_id)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG + ":activeUser", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse gankaoBaseResponse) {
|
||||||
|
Log.e(TAG + ":activeUser", "onNext: " + JSONObject.toJSONString(gankaoBaseResponse));
|
||||||
|
switch (gankaoBaseResponse.code) {
|
||||||
|
case 10000:
|
||||||
|
case 50000:
|
||||||
|
// sendUid(product, gankaoUID);
|
||||||
|
ToastUtil.show("激活成功:" + product.getDuration());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG + ":activeUser", "onError: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG + ":activeUser", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface GetUserProductsCallback {
|
||||||
|
void activeUserProduct(UserProduct activeUserProduct);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getUserProducts(String card_info, GetUserProductsCallback callback) {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getUserProductsControl()
|
||||||
|
.getUserProducts(appid, timestamp, LaunchTools.getToken(params), uid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<GankaoBaseResponse<UserProductCards<List<UserProduct>>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GankaoBaseResponse<UserProductCards<List<UserProduct>>> userProductCardsGankaoBaseResponse) {
|
||||||
|
Log.e("getUserProducts", "onNext: " + userProductCardsGankaoBaseResponse.toString());
|
||||||
|
if (userProductCardsGankaoBaseResponse.code == 200) {
|
||||||
|
UserProduct userProduct = null;
|
||||||
|
for (UserProduct product : userProductCardsGankaoBaseResponse.data.getCards()) {
|
||||||
|
if (product.getName().contains("权益套装") && product.getName().contains(card_info)) {
|
||||||
|
userProduct = product;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callback.activeUserProduct(userProduct);
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("获取用户已激活的套餐失败");
|
||||||
|
callback.activeUserProduct(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("getUserProducts", "onError: " + e.getMessage());
|
||||||
|
callback.activeUserProduct(null);
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getUserProducts", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cancleCombo(Context context, String jsonString) {
|
||||||
|
Log.e(TAG, "cancleCombo: " + jsonString);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
|
cancelUserPower(jsonObject);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cancelUserPower(JSONObject jsonObject) {
|
||||||
|
String appid = Scheme.partner_id;
|
||||||
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
|
String uid = Utils.getSerial();
|
||||||
|
String user_power_id = jsonObject.getString("user_power_id");
|
||||||
|
String specification_id = jsonObject.getString("specification_id");
|
||||||
|
|
||||||
|
HashMap<String, String> params = new HashMap<>();
|
||||||
|
params.put("appid", appid);
|
||||||
|
params.put("timestamp", timestamp);
|
||||||
|
params.put("uid", uid);
|
||||||
|
params.put("user_power_id", user_power_id);
|
||||||
|
params.put("specification_id", specification_id);
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getCancelUserPowerControl()
|
||||||
|
.cancelUserPower(appid, timestamp, LaunchTools.getToken(params), user_power_id, specification_id)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ import android.content.pm.PackageManager;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.NetworkUtils;
|
import com.blankj.utilcode.util.NetworkUtils;
|
||||||
import com.info.sn.activity.main.MainActivity;
|
import com.info.sn.activity.main.MainActivity;
|
||||||
import com.info.sn.activity.main.MainContact;
|
import com.info.sn.activity.main.MainContact;
|
||||||
@@ -15,6 +18,7 @@ import com.info.sn.activity.main.MainPresenter;
|
|||||||
import com.info.sn.bean.zuoye.BaseResponse;
|
import com.info.sn.bean.zuoye.BaseResponse;
|
||||||
import com.info.sn.bean.zuoye.UserInfo;
|
import com.info.sn.bean.zuoye.UserInfo;
|
||||||
import com.info.sn.bean.gankao.AvailableProduct;
|
import com.info.sn.bean.gankao.AvailableProduct;
|
||||||
|
import com.info.sn.config.Configs;
|
||||||
import com.info.sn.jpush.TagAliasOperatorHelper;
|
import com.info.sn.jpush.TagAliasOperatorHelper;
|
||||||
import com.info.sn.manager.ControlManager;
|
import com.info.sn.manager.ControlManager;
|
||||||
import com.info.sn.network.HTTPInterface;
|
import com.info.sn.network.HTTPInterface;
|
||||||
@@ -27,6 +31,8 @@ import com.trello.rxlifecycle2.RxLifecycle;
|
|||||||
import com.trello.rxlifecycle2.android.ActivityEvent;
|
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||||
import com.trello.rxlifecycle2.android.RxLifecycleAndroid;
|
import com.trello.rxlifecycle2.android.RxLifecycleAndroid;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -197,6 +203,11 @@ public class MainService extends Service implements MainContact.MainView, Networ
|
|||||||
TagAliasOperatorHelper.getInstance().handleAction(MainService.this, TagAliasOperatorHelper.sequence, tagAliasBean);
|
TagAliasOperatorHelper.getInstance().handleAction(MainService.this, TagAliasOperatorHelper.sequence, tagAliasBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPowerUserList(String date) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkSNFinish(int code) {
|
public void checkSNFinish(int code) {
|
||||||
|
|
||||||
@@ -208,12 +219,12 @@ public class MainService extends Service implements MainContact.MainView, Networ
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAvailableProduct(List<AvailableProduct> availableProductList) {
|
public void setAvailableProduct(List<AvailableProduct> availableProductList, String gankaoUID) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void activeUser(int code) {
|
public void activeUserFinish(int code) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,17 +234,69 @@ public class MainService extends Service implements MainContact.MainView, Networ
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInfo(BaseResponse<UserInfo> response) {
|
public void setSnInfo(BaseResponse<UserInfo> response) {
|
||||||
|
if (response != null) {
|
||||||
int code = response.code;
|
int code = response.code;
|
||||||
|
//设备已经绑定
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
|
UserInfo userInfo = response.data;
|
||||||
|
boolean username = Settings.System.putString(getContentResolver(), "UserInfo_username", userInfo.getSn_name());
|
||||||
|
boolean gread = Settings.System.putString(getContentResolver(), "UserInfo_grade", userInfo.getGrade());
|
||||||
|
SPUtils.put(this, Configs.isLogined, 1);
|
||||||
|
SPUtils.put(this, "member_id", userInfo.getMember_id());
|
||||||
|
SPUtils.put(this, "sn_id", userInfo.getId());
|
||||||
|
if (!TextUtils.isEmpty(userInfo.getSn_name())) {
|
||||||
|
SPUtils.put(this, "USERINFO_NAME", userInfo.getSn_name());
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(userInfo.getSchool())) {
|
||||||
|
SPUtils.put(this, "USERINFO_SCHOOL", userInfo.getSchool());
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(userInfo.getGrade())) {
|
||||||
|
SPUtils.put(this, "USERINFO_GRADE", userInfo.getGrade());
|
||||||
|
}
|
||||||
|
|
||||||
mPresenter.getLocked();
|
mPresenter.getLocked();
|
||||||
}
|
}
|
||||||
|
//设备没有绑定
|
||||||
|
else if (code == 300) {
|
||||||
|
ControlManager.getInstance().setDisableSetting();
|
||||||
|
}
|
||||||
|
//没有授权的设备
|
||||||
|
else if (code == 400) {
|
||||||
|
ControlManager.getInstance().setDisableSetting();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mPresenter.getSnUid();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSnUid(JSONObject jsonObject) {
|
||||||
|
if (jsonObject != null) {
|
||||||
|
String uid = jsonObject.getString("uid");
|
||||||
|
if (!TextUtils.isEmpty(uid)) {
|
||||||
|
Settings.System.putString(getContentResolver(), "gankaoUID", uid);
|
||||||
|
}
|
||||||
|
// String uid = jsonObject.getString("uid");
|
||||||
|
// long activate_time = jsonObject.getLong("activate_time");
|
||||||
|
// String card_info = jsonObject.getString("card_info");
|
||||||
|
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// Date d1 = new Date(activate_time * 1000);
|
||||||
|
// int grade = jsonObject.getIntValue("grade");
|
||||||
|
// SPUtils.put(MainService.this, "int_grade", grade);
|
||||||
|
// String t1 = format.format(d1);
|
||||||
|
} else {
|
||||||
|
mPresenter.registerGankao();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGankao(String gankaoUID) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUserInfo() {
|
public void setUserInfo() {
|
||||||
|
mPresenter.getSnInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class ManagerService extends Service {
|
|||||||
int code = baseResponse.code;
|
int code = baseResponse.code;
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(baseResponse.data));
|
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(baseResponse.data));
|
||||||
int is_screen_lock = jsonObject.getInteger("is_screen_lock");
|
int is_screen_lock = jsonObject.getIntValue("is_screen_lock");
|
||||||
if (is_screen_lock == 1) {
|
if (is_screen_lock == 1) {
|
||||||
if (!timelocked) {
|
if (!timelocked) {
|
||||||
showFloatingWindow("屏幕已锁定");
|
showFloatingWindow("屏幕已锁定");
|
||||||
@@ -223,14 +223,14 @@ public class ManagerService extends Service {
|
|||||||
getScreenLockState();
|
getScreenLockState();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ACTION_LOCK == action) {
|
if (ACTION_LOCK.equals(action)) {
|
||||||
// String name = intent.getStringExtra("name");
|
// String name = intent.getStringExtra("name");
|
||||||
String name = "屏幕已锁定";
|
String name = "屏幕已锁定";
|
||||||
if (!timelocked) {
|
if (!timelocked) {
|
||||||
showFloatingWindow(name);
|
showFloatingWindow(name);
|
||||||
}
|
}
|
||||||
screenlocked = true;
|
screenlocked = true;
|
||||||
} else if (ACTION_UNLOCK == action) {
|
} else if (ACTION_UNLOCK.equals(action)) {
|
||||||
if (!timelocked) {
|
if (!timelocked) {
|
||||||
hideFloatingWindow();
|
hideFloatingWindow();
|
||||||
}
|
}
|
||||||
@@ -288,10 +288,10 @@ public class ManagerService extends Service {
|
|||||||
// if (null != workingContralTime) {
|
// if (null != workingContralTime) {
|
||||||
if (TimeUtils.inContralTime(workingContralTime, weekContralTime)) {
|
if (TimeUtils.inContralTime(workingContralTime, weekContralTime)) {
|
||||||
if (!screenlocked) {
|
if (!screenlocked) {
|
||||||
showFloatingWindow("管控时间:\n" + TimeUtils.getNowTimeString(ManagerService.this));
|
showFloatingWindow("可用时间:\n" + TimeUtils.getNowTimeString(ManagerService.this));
|
||||||
} else {
|
} else {
|
||||||
TextView textView = topView.findViewById(R.id.textView);
|
TextView textView = topView.findViewById(R.id.textView);
|
||||||
textView.setText("管控时间:\n" + TimeUtils.getNowTimeString(ManagerService.this));
|
textView.setText("可用时间:\n" + TimeUtils.getNowTimeString(ManagerService.this));
|
||||||
}
|
}
|
||||||
timelocked = true;
|
timelocked = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -317,9 +317,14 @@ public class ManagerService extends Service {
|
|||||||
screenLockReceiver = new ScreenLockReceiver();
|
screenLockReceiver = new ScreenLockReceiver();
|
||||||
}
|
}
|
||||||
IntentFilter filter = new IntentFilter();
|
IntentFilter filter = new IntentFilter();
|
||||||
|
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||||
filter.addAction(Intent.ACTION_SCREEN_ON);
|
filter.addAction(Intent.ACTION_SCREEN_ON);
|
||||||
|
filter.addAction(Intent.ACTION_BOOT_COMPLETED);
|
||||||
filter.addAction(Intent.ACTION_USER_PRESENT);
|
filter.addAction(Intent.ACTION_USER_PRESENT);
|
||||||
|
filter.addAction(Intent.ACTION_SHUTDOWN);
|
||||||
|
filter.addAction(Intent.ACTION_FACTORY_RESET);
|
||||||
|
filter.addAction(Intent.ACTION_MASTER_CLEAR);
|
||||||
registerReceiver(screenLockReceiver, filter);
|
registerReceiver(screenLockReceiver, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,11 +339,13 @@ public class ManagerService extends Service {
|
|||||||
}
|
}
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case Intent.ACTION_USER_PRESENT:
|
case Intent.ACTION_USER_PRESENT:
|
||||||
break;
|
|
||||||
case Intent.ACTION_SCREEN_ON:
|
case Intent.ACTION_SCREEN_ON:
|
||||||
sendScreenState(1);
|
sendScreenState(1);
|
||||||
break;
|
break;
|
||||||
case Intent.ACTION_SCREEN_OFF:
|
case Intent.ACTION_SCREEN_OFF:
|
||||||
|
case Intent.ACTION_SHUTDOWN:
|
||||||
|
case Intent.ACTION_FACTORY_RESET:
|
||||||
|
case Intent.ACTION_MASTER_CLEAR:
|
||||||
sendScreenState(0);
|
sendScreenState(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -12,20 +12,25 @@ import android.os.Handler;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arialyy.annotations.Download;
|
import com.arialyy.annotations.Download;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
import com.arialyy.aria.core.task.DownloadTask;
|
import com.arialyy.aria.core.task.DownloadTask;
|
||||||
|
import com.blankj.utilcode.util.ToastUtils;
|
||||||
import com.info.sn.KeepAliveConnection;
|
import com.info.sn.KeepAliveConnection;
|
||||||
import com.info.sn.R;
|
import com.info.sn.R;
|
||||||
import com.info.sn.activity.main.MainActivity;
|
import com.info.sn.activity.main.MainActivity;
|
||||||
import com.info.sn.utils.ApkUtils;
|
import com.info.sn.utils.ApkUtils;
|
||||||
import com.info.sn.utils.JGYUtils;
|
import com.info.sn.utils.JGYUtils;
|
||||||
|
import com.info.sn.utils.ToastUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -183,6 +188,17 @@ public class MyDownloadService extends Service {
|
|||||||
@Download.onTaskRunning
|
@Download.onTaskRunning
|
||||||
void running(DownloadTask task) {
|
void running(DownloadTask task) {
|
||||||
Log.e("aria running", "正在下载:" + task.getState() + "--" + task.getPercent() + "--" + task.getExtendField());
|
Log.e("aria running", "正在下载:" + task.getState() + "--" + task.getPercent() + "--" + task.getExtendField());
|
||||||
|
String appName = "";
|
||||||
|
try {
|
||||||
|
String jsonString = task.getExtendField();
|
||||||
|
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||||
|
if (!TextUtils.isEmpty(jsonString) && jsonObject != null) {
|
||||||
|
appName = jsonObject.getString("app_name");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("running", "running: " + e.getMessage());
|
||||||
|
}
|
||||||
|
ToastUtils.showShort("正在下载:" + appName + "--" + task.getPercent() + "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Download.onTaskComplete
|
@Download.onTaskComplete
|
||||||
@@ -192,5 +208,4 @@ public class MyDownloadService extends Service {
|
|||||||
Log.e("taskComplete", task.getExtendField());
|
Log.e("taskComplete", task.getExtendField());
|
||||||
Aria.download(this).load(task.getDownloadEntity().getId()).cancel();
|
Aria.download(this).load(task.getDownloadEntity().getId()).cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ public class RemoteService extends Service {
|
|||||||
public String getUserInfo() throws RemoteException {
|
public String getUserInfo() throws RemoteException {
|
||||||
String username = Settings.System.getString(getContentResolver(), "UserInfo_username");
|
String username = Settings.System.getString(getContentResolver(), "UserInfo_username");
|
||||||
String avatar = Settings.System.getString(getContentResolver(), "UserInfo_avatar");
|
String avatar = Settings.System.getString(getContentResolver(), "UserInfo_avatar");
|
||||||
String gread = Settings.System.getString(getContentResolver(), "UserInfo_grade");
|
// String gread = Settings.System.getString(getContentResolver(), "UserInfo_grade");
|
||||||
|
int gread = (int) SPUtils.get(RemoteService.this,"int_grade",0);
|
||||||
String gankaoUID = Settings.System.getString(getContentResolver(), "gankaoUID");
|
String gankaoUID = Settings.System.getString(getContentResolver(), "gankaoUID");
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
jsonObject.addProperty("username", username);
|
jsonObject.addProperty("username", username);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import android.content.pm.ApplicationInfo;
|
|||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageInstaller;
|
import android.content.pm.PackageInstaller;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.ResolveInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -40,6 +41,7 @@ import java.lang.reflect.Method;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
@@ -790,6 +792,7 @@ public class ApkUtils {
|
|||||||
}
|
}
|
||||||
return versionName;
|
return versionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTaskPackname(Context context) {
|
public static String getTaskPackname(Context context) {
|
||||||
String currentApp = "CurrentNULL";
|
String currentApp = "CurrentNULL";
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||||
@@ -813,4 +816,22 @@ public class ApkUtils {
|
|||||||
// Log.e("TAG", "Current App in foreground is: " + currentApp);
|
// Log.e("TAG", "Current App in foreground is: " + currentApp);
|
||||||
return currentApp;
|
return currentApp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean getIsCanStart(Context context, String pkg) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_MAIN, null);
|
||||||
|
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
|
// 通过查询,获得所有ResolveInfo对象.
|
||||||
|
List<ResolveInfo> infos = context.getPackageManager().queryIntentActivities(intent, 0);
|
||||||
|
HashMap<String, ResolveInfo> hashMap = new HashMap<>();
|
||||||
|
for (ResolveInfo info : infos) {
|
||||||
|
hashMap.put(info.activityInfo.packageName, info);
|
||||||
|
}
|
||||||
|
if (hashMap.get(pkg) == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,11 @@ import java.lang.reflect.Method;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
||||||
|
|
||||||
@@ -610,4 +613,129 @@ public class JGYUtils {
|
|||||||
context.sendBroadcast(intent);
|
context.sendBroadcast(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//应用管理-允许联网
|
||||||
|
public final static String ACTION_HrReceiver_JGY = "qch_jgy_network_allow";
|
||||||
|
//应用管理-禁止联网
|
||||||
|
public final static String ACTION_HrReceiver_JGY_DIS = "qch_jgy_network_disallow";
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
|
synchronized public static void setAppNetwork(Context context, HashSet<String> blackList) {
|
||||||
|
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控" + blackList);
|
||||||
|
String dis = Settings.System.getString(context.getContentResolver(), ACTION_HrReceiver_JGY_DIS);
|
||||||
|
String not = Settings.System.getString(context.getContentResolver(), ACTION_HrReceiver_JGY);
|
||||||
|
//清除旧数据
|
||||||
|
if (!TextUtils.isEmpty(dis)) {
|
||||||
|
Log.e(TAG, "setAppNetwork: dis = " + dis);
|
||||||
|
Settings.System.putString(context.getContentResolver(), ACTION_HrReceiver_JGY_DIS, "Invalid");
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(not)) {
|
||||||
|
Log.e(TAG, "setAppNetwork: not = " + not);
|
||||||
|
Settings.System.putString(context.getContentResolver(), ACTION_HrReceiver_JGY, "Invalid");
|
||||||
|
}
|
||||||
|
|
||||||
|
String oldBlackList = (String) SPUtils.get(context, ACTION_HrReceiver_JGY_DIS, "");
|
||||||
|
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackList.split(",")));
|
||||||
|
oldBlackListSet.removeIf(new Predicate<String>() {
|
||||||
|
@Override
|
||||||
|
public boolean test(String s) {
|
||||||
|
//去空
|
||||||
|
return TextUtils.isEmpty(s.trim());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//之前禁止上网得列表
|
||||||
|
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
|
||||||
|
if (oldBlackListSet.size() == 0) {
|
||||||
|
Log.e(TAG, "setAppNetwork: blackList: " + blackList);
|
||||||
|
for (String pkg : blackList) {
|
||||||
|
if (TextUtils.isEmpty(pkg)) continue;
|
||||||
|
//发送没有安装的
|
||||||
|
if (!ApkUtils.isAvailable(context, pkg)) {
|
||||||
|
Log.e(TAG, "setAppNetwork: skip: " + pkg);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "setAppNetwork: " + pkg + " 已安装");
|
||||||
|
}
|
||||||
|
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY_DIS);
|
||||||
|
netControlNotIntent.putExtra("package_name", pkg);
|
||||||
|
netControlNotIntent.setPackage("com.android.settings");
|
||||||
|
context.sendBroadcast(netControlNotIntent);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//减少的
|
||||||
|
Set<String> removedNet = oldBlackListSet;
|
||||||
|
//增加的
|
||||||
|
Set<String> addedNet = new HashSet<>();
|
||||||
|
for (String pkg : blackList) {
|
||||||
|
if (TextUtils.isEmpty(pkg)) continue;
|
||||||
|
if (removedNet.contains(pkg)) {
|
||||||
|
removedNet.remove(pkg);
|
||||||
|
} else {
|
||||||
|
addedNet.add(pkg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.e(TAG, "setAppNetwork: removedNet: " + removedNet);
|
||||||
|
Log.e(TAG, "setAppNetwork: addedNet: " + addedNet);
|
||||||
|
for (String pkg : removedNet) {
|
||||||
|
if (TextUtils.isEmpty(pkg)) continue;
|
||||||
|
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY);
|
||||||
|
netControlNotIntent.putExtra("package_name", pkg);
|
||||||
|
netControlNotIntent.setPackage("com.android.settings");
|
||||||
|
context.sendBroadcast(netControlNotIntent);
|
||||||
|
}
|
||||||
|
for (String pkg : addedNet) {
|
||||||
|
if (TextUtils.isEmpty(pkg)) continue;
|
||||||
|
if (!ApkUtils.isAvailable(context, pkg)) {
|
||||||
|
Log.e(TAG, "setAppNetwork: skip: " + pkg);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "setAppNetwork: " + pkg + " 已安装");
|
||||||
|
}
|
||||||
|
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY_DIS);
|
||||||
|
netControlNotIntent.putExtra("package_name", pkg);
|
||||||
|
netControlNotIntent.setPackage("com.android.settings");
|
||||||
|
context.sendBroadcast(netControlNotIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String net_not = String.join(",", blackList);
|
||||||
|
SPUtils.put(context, ACTION_HrReceiver_JGY_DIS, net_not);
|
||||||
|
//Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_HrReceiver_JGY_DIS, net_not);
|
||||||
|
Log.e("fht", "not::" + net_not);
|
||||||
|
|
||||||
|
//Intent netControlIntent = new Intent(CommonDatas.ACTION_HrReceiver_JGY_DIS);
|
||||||
|
//netControlIntent.putExtra("package_name", net_not);
|
||||||
|
//sendBroadcast(netControlIntent);
|
||||||
|
|
||||||
|
//Intent netControlNotIntent = new Intent(CommonDatas.ACTION_HrReceiver_JGY);
|
||||||
|
//netControlNotIntent.putExtra("package_name", net_ok);
|
||||||
|
//sendBroadcast(netControlNotIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
|
synchronized public void onBootSendNetwork() {
|
||||||
|
String oldBlackListString = (String) SPUtils.get(mContext, ACTION_HrReceiver_JGY_DIS, "");
|
||||||
|
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackListString.split(",")));
|
||||||
|
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
|
||||||
|
oldBlackListSet.removeIf(new Predicate<String>() {
|
||||||
|
@Override
|
||||||
|
public boolean test(String s) {
|
||||||
|
return TextUtils.isEmpty(s.trim());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
for (String pkg : oldBlackListSet) {
|
||||||
|
if (TextUtils.isEmpty(pkg)) continue;
|
||||||
|
if (!ApkUtils.isAvailable(mContext, pkg)) {
|
||||||
|
Log.e(TAG, "setAppNetwork: skip: " + pkg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY_DIS);
|
||||||
|
netControlNotIntent.putExtra("package_name", pkg);
|
||||||
|
netControlNotIntent.setPackage("com.android.settings");
|
||||||
|
mContext.sendBroadcast(netControlNotIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public class TimeUtils {
|
|||||||
public static final String WEEK_START_TIME_KEY = "WEEK_START_TIME";
|
public static final String WEEK_START_TIME_KEY = "WEEK_START_TIME";
|
||||||
public static final String WEEK_END_TIME_KEY = "WEEK_END_TIME";
|
public static final String WEEK_END_TIME_KEY = "WEEK_END_TIME";
|
||||||
public static long dayTime = 60 * 60 * 24 * 1000;
|
public static long dayTime = 60 * 60 * 24 * 1000;
|
||||||
|
public static long minuteTime = 60 * 1000;
|
||||||
|
|
||||||
|
|
||||||
public static String getNowTime() {
|
public static String getNowTime() {
|
||||||
long nowTime = System.currentTimeMillis();
|
long nowTime = System.currentTimeMillis();
|
||||||
@@ -173,7 +175,7 @@ public class TimeUtils {
|
|||||||
* @return 时间戳格式化文本
|
* @return 时间戳格式化文本
|
||||||
*/
|
*/
|
||||||
public static String getDate(long time) {
|
public static String getDate(long time) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String finaWayDate = sdf.format(time);
|
String finaWayDate = sdf.format(time);
|
||||||
Log.e(TAG, "getDate: " + finaWayDate);
|
Log.e(TAG, "getDate: " + finaWayDate);
|
||||||
return finaWayDate;
|
return finaWayDate;
|
||||||
@@ -332,7 +334,9 @@ public class TimeUtils {
|
|||||||
//开始时间大于结束时间 列 16:00-01:00
|
//开始时间大于结束时间 列 16:00-01:00
|
||||||
endDate.setTime(endDate.getTime() + dayTime);
|
endDate.setTime(endDate.getTime() + dayTime);
|
||||||
}
|
}
|
||||||
if (nowDate.getTime() >= startDate.getTime() && nowDate.getTime() <= endDate.getTime()) {
|
Log.e(TAG, "inControlTime: " + (startDate.getTime() - minuteTime));
|
||||||
|
assert nowDate != null;
|
||||||
|
if (nowDate.getTime() <= startDate.getTime() - minuteTime || nowDate.getTime() >= endDate.getTime()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1169,6 +1169,7 @@ public class Utils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统配置信息
|
* 获取系统配置信息
|
||||||
|
*
|
||||||
* @param key
|
* @param key
|
||||||
* @param defaultValue
|
* @param defaultValue
|
||||||
* @return
|
* @return
|
||||||
@@ -1216,7 +1217,7 @@ public class Utils {
|
|||||||
Log.e(TAG, "getHardware: storage = " + storage);
|
Log.e(TAG, "getHardware: storage = " + storage);
|
||||||
double use_space = getUse_space(context);
|
double use_space = getUse_space(context);
|
||||||
Log.e(TAG, "getHardware: use_space = " + use_space);
|
Log.e(TAG, "getHardware: use_space = " + use_space);
|
||||||
long wifi_time = (long) com.info.sn.utils.SPUtils.get(context, "wifi_last_connect_time", 0L)/1000;
|
long wifi_time = (long) com.info.sn.utils.SPUtils.get(context, "wifi_last_connect_time", 0L) / 1000;
|
||||||
Log.e(TAG, "getHardware: wifi_time" + wifi_time);
|
Log.e(TAG, "getHardware: wifi_time" + wifi_time);
|
||||||
int CPU = getNumCores();
|
int CPU = getNumCores();
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
@@ -1246,7 +1247,7 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getAppUsedStatistics(Context context) {
|
public static String getAppUsedStatistics(Context context) {
|
||||||
StatisticsInfo statisticsInfo = new StatisticsInfo(context, 3);
|
StatisticsInfo statisticsInfo = new StatisticsInfo(context, 0);
|
||||||
long totalTime = statisticsInfo.getTotalTime();
|
long totalTime = statisticsInfo.getTotalTime();
|
||||||
int totalTimes = statisticsInfo.getTotalTimes();
|
int totalTimes = statisticsInfo.getTotalTimes();
|
||||||
List<AppInformation> datalist = statisticsInfo.getShowList();
|
List<AppInformation> datalist = statisticsInfo.getShowList();
|
||||||
@@ -1265,6 +1266,7 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
String jsonString = JSON.toJSONString(appUsedList);
|
String jsonString = JSON.toJSONString(appUsedList);
|
||||||
|
Log.e(TAG, "getAppUsedStatistics: " + jsonString);
|
||||||
return jsonString;
|
return jsonString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
72
app/src/main/java/com/info/sn/view/FlowRadioGroup.java
Normal file
72
app/src/main/java/com/info/sn/view/FlowRadioGroup.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
package com.info.sn.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流式布局的RadioGroup
|
||||||
|
*/
|
||||||
|
public class FlowRadioGroup extends RadioGroup {
|
||||||
|
|
||||||
|
public FlowRadioGroup(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FlowRadioGroup(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
int maxWidth = MeasureSpec.getSize(widthMeasureSpec);
|
||||||
|
int childCount = getChildCount();
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
int row = 0;
|
||||||
|
|
||||||
|
for (int index = 0; index < childCount; index++) {
|
||||||
|
final View child = getChildAt(index);
|
||||||
|
if (child.getVisibility() != View.GONE) {
|
||||||
|
child.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
|
||||||
|
// 此处增加onlayout中的换行判断,用于计算所需的高度
|
||||||
|
int width = child.getMeasuredWidth();
|
||||||
|
int height = child.getMeasuredHeight();
|
||||||
|
x += width;
|
||||||
|
y = row * height + height;
|
||||||
|
if (x > maxWidth) {
|
||||||
|
x = width;
|
||||||
|
row++;
|
||||||
|
y = row * height + height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 设置容器所需的宽度和高度
|
||||||
|
setMeasuredDimension(maxWidth, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
|
final int childCount = getChildCount();
|
||||||
|
int maxWidth = r - l;
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
int row = 0;
|
||||||
|
for (int i = 0; i < childCount; i++) {
|
||||||
|
final View child = this.getChildAt(i);
|
||||||
|
if (child.getVisibility() != View.GONE) {
|
||||||
|
int width = child.getMeasuredWidth();
|
||||||
|
int height = child.getMeasuredHeight();
|
||||||
|
x += width;
|
||||||
|
y = row * height + height;
|
||||||
|
if (x > maxWidth) {
|
||||||
|
x = width;
|
||||||
|
row++;
|
||||||
|
y = row * height + height;
|
||||||
|
}
|
||||||
|
child.layout(x - width, y - height, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable-hdpi/main_vip.png
Normal file
BIN
app/src/main/res/drawable-hdpi/main_vip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable-hdpi/phone.png
Normal file
BIN
app/src/main/res/drawable-hdpi/phone.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
17
app/src/main/res/drawable/bg_selecte.xml
Normal file
17
app/src/main/res/drawable/bg_selecte.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<solid
|
||||||
|
android:color="@color/white" />
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<padding android:bottom="50dp"
|
||||||
|
android:top="50dp"
|
||||||
|
android:right="50dp"
|
||||||
|
android:left="50dp"/>
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="24dp"
|
||||||
|
android:topRightRadius="24dp"
|
||||||
|
android:bottomLeftRadius="24dp"
|
||||||
|
android:bottomRightRadius="24dp" />
|
||||||
|
</shape>
|
||||||
@@ -3,11 +3,16 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<!-- 内部颜色 -->
|
<!-- 内部颜色 -->
|
||||||
<solid
|
<solid
|
||||||
android:color="@color/activation_color" />
|
android:color="@color/check_activation_color" />
|
||||||
<!-- 圆角的幅度 -->
|
<!-- 圆角的幅度 -->
|
||||||
<corners
|
<corners
|
||||||
android:topLeftRadius="24dp"
|
android:topLeftRadius="24dp"
|
||||||
android:topRightRadius="24dp"
|
android:topRightRadius="24dp"
|
||||||
android:bottomLeftRadius="24dp"
|
android:bottomLeftRadius="24dp"
|
||||||
android:bottomRightRadius="24dp" />
|
android:bottomRightRadius="24dp" />
|
||||||
|
<padding
|
||||||
|
android:bottom="5dp"
|
||||||
|
android:left="10dp"
|
||||||
|
android:right="10dp"
|
||||||
|
android:top="5dp" />
|
||||||
</shape>
|
</shape>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<!-- 内部颜色 -->
|
<!-- 内部颜色 -->
|
||||||
<solid
|
<solid
|
||||||
android:color="@color/check_activation_color" />
|
android:color="@color/activation_color" />
|
||||||
<!-- 圆角的幅度 -->
|
<!-- 圆角的幅度 -->
|
||||||
<corners
|
<corners
|
||||||
android:topLeftRadius="24dp"
|
android:topLeftRadius="24dp"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<!-- 内部颜色 -->
|
<!-- 内部颜色 -->
|
||||||
<solid
|
<solid
|
||||||
android:color="@color/check_activation_color" />
|
android:color="@color/activation_color" />
|
||||||
<!-- 圆角的幅度 -->
|
<!-- 圆角的幅度 -->
|
||||||
<corners
|
<corners
|
||||||
android:topLeftRadius="24dp"
|
android:topLeftRadius="24dp"
|
||||||
|
|||||||
13
app/src/main/res/drawable/bt_unactivation.xml
Normal file
13
app/src/main/res/drawable/bt_unactivation.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<solid
|
||||||
|
android:color="@color/lightgrey" />
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="24dp"
|
||||||
|
android:topRightRadius="24dp"
|
||||||
|
android:bottomLeftRadius="24dp"
|
||||||
|
android:bottomRightRadius="24dp" />
|
||||||
|
</shape>
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item
|
<item>
|
||||||
>
|
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<solid android:color="#efefef" />
|
<solid android:color="#efefef" />
|
||||||
<corners android:radius="15dp" />
|
<corners android:radius="15dp" />
|
||||||
<!-- <stroke-->
|
<!-- <stroke-->
|
||||||
<!-- android:width="1dp"-->
|
<!-- android:width="1dp"-->
|
||||||
<!-- android:color="#505050" />-->
|
<!-- android:color="#505050" />-->
|
||||||
<padding
|
<padding
|
||||||
android:bottom="5dp"
|
android:bottom="5dp"
|
||||||
android:left="10dp"
|
android:left="10dp"
|
||||||
|
|||||||
10
app/src/main/res/drawable/radio.xml
Normal file
10
app/src/main/res/drawable/radio.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:state_checked="false"
|
||||||
|
android:drawable="@drawable/radio_unchecked" />
|
||||||
|
<item
|
||||||
|
android:state_checked="true"
|
||||||
|
android:drawable="@drawable/radio_checked" />
|
||||||
|
|
||||||
|
</selector>
|
||||||
18
app/src/main/res/drawable/radio_checked.xml
Normal file
18
app/src/main/res/drawable/radio_checked.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<solid
|
||||||
|
android:color="@color/activation_color" />
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="24dp"
|
||||||
|
android:topRightRadius="24dp"
|
||||||
|
android:bottomLeftRadius="24dp"
|
||||||
|
android:bottomRightRadius="24dp" />
|
||||||
|
|
||||||
|
<padding android:bottom="4dp"
|
||||||
|
android:top="4dp"
|
||||||
|
android:right="8dp"
|
||||||
|
android:left="8dp"/>
|
||||||
|
</shape>
|
||||||
8
app/src/main/res/drawable/radio_textcolor.xml
Normal file
8
app/src/main/res/drawable/radio_textcolor.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 选中 -->
|
||||||
|
<item android:state_checked="true" android:color="@color/white"/>
|
||||||
|
<!-- 非选中 -->
|
||||||
|
<item android:state_checked="false" android:color="@color/black"/>
|
||||||
|
|
||||||
|
</selector>
|
||||||
20
app/src/main/res/drawable/radio_unchecked.xml
Normal file
20
app/src/main/res/drawable/radio_unchecked.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<solid
|
||||||
|
android:color="@color/white" />
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<stroke android:color="@color/gray"
|
||||||
|
android:width="1dp"/>
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="24dp"
|
||||||
|
android:topRightRadius="24dp"
|
||||||
|
android:bottomLeftRadius="24dp"
|
||||||
|
android:bottomRightRadius="24dp" />
|
||||||
|
|
||||||
|
<padding android:bottom="4dp"
|
||||||
|
android:top="4dp"
|
||||||
|
android:right="8dp"
|
||||||
|
android:left="8dp"/>
|
||||||
|
</shape>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout"
|
android:id="@+id/constraintLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="52dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:text="设备信息"
|
android:text="教管壹 云管控·AI学习机"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
@@ -43,6 +43,28 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:text="@string/caption"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_guide"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="all"
|
||||||
|
android:text="@string/hello"
|
||||||
|
android:textColor="@color/activation_color"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView3"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView3" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
@@ -50,18 +72,109 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
|
app:layout_constraintTop_toBottomOf="@+id/tv_guide">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView9"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="第一步"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView11"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="请用微信扫码小程序 注册家长控制账号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView9"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView9" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="96dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/applet_qrcode"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView9" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView10"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="第二步"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView12"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="请登录微信小程序扫描学习机二维码进行绑定"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView10"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/qr_code"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="96dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/phone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<com.flyco.tablayout.SlidingTabLayout
|
<com.flyco.tablayout.SlidingTabLayout
|
||||||
android:id="@+id/slidingtablayout"
|
android:id="@+id/slidingtablayout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
@@ -75,11 +188,12 @@
|
|||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:id="@+id/viewPager"
|
android:id="@+id/viewPager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="300dp"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:visibility="gone"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/slidingtablayout" />
|
app:layout_constraintTop_toBottomOf="@+id/slidingtablayout" />
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_logo"
|
android:id="@+id/iv_logo"
|
||||||
android:layout_width="180dp"
|
android:layout_width="180dp"
|
||||||
@@ -94,28 +208,15 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/qr_code"
|
|
||||||
android:layout_width="300dp"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/iv_logo"
|
|
||||||
app:layout_constraintVertical_bias="0.3" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout2"
|
android:id="@+id/constraintLayout2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
app:layout_constraintTop_toBottomOf="@+id/qr_code">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_note"
|
android:id="@+id/tv_note"
|
||||||
@@ -142,10 +243,18 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="2px"
|
||||||
|
android:background="@color/gray"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_weight="2">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout"
|
android:id="@+id/linearLayout"
|
||||||
@@ -162,7 +271,7 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp">
|
android:layout_height="40dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
@@ -182,7 +291,7 @@
|
|||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:text="设备SN"
|
android:text="设备SN"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView"
|
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -192,7 +301,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -200,8 +309,8 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="8sp">
|
android:layout_marginTop="4dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView2"
|
||||||
@@ -221,7 +330,7 @@
|
|||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:text="用户姓名"
|
android:text="用户姓名"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView2"
|
app:layout_constraintStart_toEndOf="@+id/imageView2"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -231,7 +340,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -240,8 +349,8 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="8sp">
|
android:layout_marginTop="4dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView3"
|
android:id="@+id/imageView3"
|
||||||
@@ -261,7 +370,7 @@
|
|||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:text="学校"
|
android:text="学校"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView3"
|
app:layout_constraintStart_toEndOf="@+id/imageView3"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -271,7 +380,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -280,8 +389,8 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="8sp">
|
android:layout_marginTop="4dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView4"
|
android:id="@+id/imageView4"
|
||||||
@@ -301,7 +410,7 @@
|
|||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:text="年级"
|
android:text="年级"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView4"
|
app:layout_constraintStart_toEndOf="@+id/imageView4"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -311,7 +420,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -320,8 +429,8 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_update"
|
android:id="@+id/cl_update"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="8sp">
|
android:layout_marginTop="4dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView5"
|
android:id="@+id/imageView5"
|
||||||
@@ -341,7 +450,7 @@
|
|||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:text="版本"
|
android:text="版本"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="22sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView5"
|
app:layout_constraintStart_toEndOf="@+id/imageView5"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -351,25 +460,93 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:textSize="18sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_vip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="4dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView6"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/main_vip"
|
||||||
|
app:layout_constraintBottom_toBottomOf="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_marginStart="16dp"
|
||||||
|
android:text="学习系统"
|
||||||
|
android:textColor="#4b4b4b"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView6"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_vip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right"
|
||||||
|
android:text="查看详情"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_activate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_activation"
|
android:id="@+id/bt_activation"
|
||||||
android:layout_width="240dp"
|
android:layout_width="160dp"
|
||||||
android:layout_height="44dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:background="@drawable/bt_selector"
|
android:background="@drawable/bt_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
android:text="激活学习系统"
|
android:text="激活学习系统"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_repurchase"
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:background="@drawable/bt_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
|
android:text="复购学习系统"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/linearLayout"
|
android:visibility="gone" />
|
||||||
app:layout_constraintStart_toStartOf="@+id/linearLayout"
|
</LinearLayout>
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView7"
|
android:id="@+id/textView7"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:text="设备信息"
|
android:text="教管壹 云管控·AI学习机"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
@@ -45,6 +45,117 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:text="@string/caption"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_guide"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="all"
|
||||||
|
android:text="@string/hello"
|
||||||
|
android:textColor="@color/activation_color"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView3"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView3" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_guide">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView9"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="第一步"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView11"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="请用微信扫码小程序 注册家长控制账号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView9"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView9" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:layout_marginTop="36dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/applet_qrcode"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView11" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView10"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="第二步"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView12"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="请用微信扫码小程序 注册家长控制账号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView10"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/qr_code"
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:layout_marginTop="36dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/phone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView12" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_logo"
|
android:id="@+id/iv_logo"
|
||||||
android:layout_width="180dp"
|
android:layout_width="180dp"
|
||||||
@@ -64,6 +175,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
|
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
|
||||||
@@ -76,33 +188,23 @@
|
|||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:id="@+id/viewPager"
|
android:id="@+id/viewPager"
|
||||||
android:layout_width="360dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="360dp"
|
android:layout_height="300dp"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/slidingtablayout" />
|
app:layout_constraintTop_toBottomOf="@+id/slidingtablayout" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/qr_code"
|
|
||||||
android:layout_width="240dp"
|
|
||||||
android:layout_height="240dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/iv_logo"> </ImageView>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout2"
|
android:id="@+id/constraintLayout2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="400dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
app:layout_constraintTop_toBottomOf="@+id/qr_code">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_note"
|
android:id="@+id/tv_note"
|
||||||
@@ -128,21 +230,22 @@
|
|||||||
app:layout_constraintTop_toTopOf="@+id/tv_note" />
|
app:layout_constraintTop_toTopOf="@+id/tv_note" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout"
|
android:id="@+id/linearLayout"
|
||||||
android:layout_width="360dp"
|
android:layout_width="360dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="20dp"
|
||||||
android:background="@drawable/background"
|
android:background="@drawable/background"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/viewPager">
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout4">
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp">
|
android:layout_height="40dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
@@ -180,7 +283,7 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="5dp">
|
android:layout_marginTop="5dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -220,7 +323,7 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="5dp">
|
android:layout_marginTop="5dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -260,7 +363,7 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="5dp">
|
android:layout_marginTop="5dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -300,8 +403,8 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_update"
|
android:id="@+id/cl_update"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="5dp">
|
android:layout_marginTop="8sp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView5"
|
android:id="@+id/imageView5"
|
||||||
@@ -336,20 +439,89 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_vip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="8sp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView6"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/main_vip"
|
||||||
|
app:layout_constraintBottom_toBottomOf="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_marginStart="16dp"
|
||||||
|
android:text="学习系统"
|
||||||
|
android:textColor="#4b4b4b"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView6"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_vip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right"
|
||||||
|
android:text="查看详情"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_activate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_activation"
|
android:id="@+id/bt_activation"
|
||||||
android:layout_width="240dp"
|
android:layout_width="160dp"
|
||||||
android:layout_height="44dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:background="@drawable/bt_selector"
|
android:background="@drawable/bt_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
android:text="激活学习系统"
|
android:text="激活学习系统"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="18sp" />
|
||||||
app:layout_constraintEnd_toEndOf="@+id/linearLayout"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/linearLayout"
|
<Button
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
|
android:id="@+id/bt_repurchase"
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:background="@drawable/bt_selector"
|
||||||
|
android:gravity="center"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
|
android:text="复购学习系统"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView7"
|
android:id="@+id/textView7"
|
||||||
|
|||||||
15
app/src/main/res/layout/activity_guide.xml
Normal file
15
app/src/main/res/layout/activity_guide.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/root"
|
||||||
|
tools:context=".activity.GuideActivity">
|
||||||
|
|
||||||
|
<com.github.chrisbanes.photoview.PhotoView
|
||||||
|
android:id="@+id/photoView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
279
app/src/main/res/layout/activity_selecte_grade.xml
Normal file
279
app/src/main/res/layout/activity_selecte_grade.xml
Normal file
@@ -0,0 +1,279 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".activity.selectegrade.SelecteGradeActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_selecte"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:text="请选择激活年级"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="32dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="小学"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/radioGroup1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radioGroup1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/textView1"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:text="一年级" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="二年级" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="三年级" />
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radioGroup2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/radioGroup1"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/radioGroup1">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="四年级" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton5"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="五年级" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton6"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="六年级" />
|
||||||
|
</RadioGroup>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="32dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:text="初中"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radioGroup3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/textView2"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton7"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:text="七年级" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton8"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:text="八年级" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton9"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:text="九年级" />
|
||||||
|
</RadioGroup>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="32dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="高中"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radioGroup4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/textView3"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton10"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="高 一" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton11"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="高 二" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioButton12"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:textColor="@drawable/radio_textcolor"
|
||||||
|
android:background="@drawable/radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:text="高 三" />
|
||||||
|
</RadioGroup>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:text="@string/hint"
|
||||||
|
android:textColor="@color/activation_color" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="24dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_unactivation"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:background="@drawable/bt_unactivation"
|
||||||
|
android:text="取消激活"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_activation"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:background="@drawable/bt_normnl"
|
||||||
|
android:text="确定激活"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
22
app/src/main/res/layout/activity_sn_uid.xml
Normal file
22
app/src/main/res/layout/activity_sn_uid.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/root"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".activity.SNUidActivity">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:listitem="@layout/item_snuid" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/qr_code"
|
android:id="@+id/qr_code"
|
||||||
android:layout_width="250dp"
|
android:layout_width="180dp"
|
||||||
android:layout_height="250dp"
|
android:layout_height="180dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/applet_qrcode"
|
android:src="@drawable/applet_qrcode"
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
android:id="@+id/tv_note"
|
android:id="@+id/tv_note"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="微信搜一搜"
|
android:text="请用微信扫码小程序注册"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone"
|
||||||
android:src="@drawable/main_search"
|
android:src="@drawable/main_search"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/tv_note"
|
app:layout_constraintStart_toEndOf="@+id/tv_note"
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/qr_code"
|
android:id="@+id/qr_code"
|
||||||
android:layout_width="250dp"
|
android:layout_width="180dp"
|
||||||
android:layout_height="250dp"
|
android:layout_height="180dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
android:id="@+id/tv_note"
|
android:id="@+id/tv_note"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="小程序扫码绑定设备"
|
android:text="小程序注册后扫码绑定平板电脑"
|
||||||
android:textColor="#4b4b4b"
|
android:textColor="#4b4b4b"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|||||||
80
app/src/main/res/layout/item_snuid.xml
Normal file
80
app/src/main/res/layout/item_snuid.xml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="360dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView13"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="套餐名"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
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="12dp"
|
||||||
|
android:text="name"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/textView13"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/textView13"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/textView13"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView15"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="年级"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView13"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView13" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_grade"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:text="grade"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/textView15"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/textView15"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/textView15"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView16"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="120dp"
|
||||||
|
android:text="激活时间"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/tv_name" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="时间"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/textView16"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textView16"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/tv_grade" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -11,5 +11,9 @@
|
|||||||
|
|
||||||
<!-- TODO: Remove or change this placeholder text -->
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
|
<string name="hello"><u>查看操作指引</u></string>
|
||||||
|
<string name="caption">尊敬的用户:\n非常感谢选用教管壹品牌云管控·AI学习机,您可按以下步骤激活家长管控账号并绑定AI学习机,以便获得相关管控功能,如应用安装黑白名单设置、浏览器上网网址黑白
|
||||||
|
名单设置、系统功能及影音娱乐管控设置、学习机使用时间段管控等等;或您亦可选择暂不绑定家长管控账号,直接激活AI学习系统进行学习(请务必仔细核对并选择正确
|
||||||
|
学龄段,激活后无法更改或退费)。请注意:若未绑定家长管控账号,学习机应用市场将无法启用应用下载,敬请注意!</string>
|
||||||
|
<string name="hint">请务必仔细核对并选择正确学龄段,激活后无法更改或退费</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -34,4 +34,24 @@
|
|||||||
<item name="android:windowSoftInputMode">stateVisible|adjustPan</item>
|
<item name="android:windowSoftInputMode">stateVisible|adjustPan</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="activity_styles" 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">false</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>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user