version:1.0.0
fix: update:预览版
This commit is contained in:
@@ -59,102 +59,9 @@ android {
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
// iPlay50SE {
|
||||
// storeFile file("keystore/iPlay50SE.keystore")
|
||||
// storePassword "123456"
|
||||
// keyAlias "iplay50se"
|
||||
// keyPassword "123456"
|
||||
// v1SigningEnabled true
|
||||
// v2SigningEnabled true
|
||||
// }
|
||||
|
||||
U807 {
|
||||
storeFile file("keystore/AllwinnerU807.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "u807"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
T1102 {
|
||||
storeFile file("keystore/T1102.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "t1102"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
iPlay50P {
|
||||
storeFile file("keystore/iPlay50P.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "iplay50p"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
iPlay50PDebug.initWith(debug)
|
||||
iPlay50PDebug {
|
||||
buildConfigField "String", "platform", '"T1102"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.iPlay50P
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
|
||||
]
|
||||
}
|
||||
|
||||
iPlay50PRelease.initWith(release)
|
||||
iPlay50PRelease {
|
||||
buildConfigField "String", "platform", '"T1102"'
|
||||
signingConfig signingConfigs.iPlay50P
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
|
||||
]
|
||||
}
|
||||
|
||||
MTKT1102Debug.initWith(debug)
|
||||
MTKT1102Debug {
|
||||
buildConfigField "String", "platform", '"MTKT1102"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.T1102
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
|
||||
]
|
||||
}
|
||||
|
||||
MTKT1102Release.initWith(release)
|
||||
MTKT1102Release {
|
||||
buildConfigField "String", "platform", '"MTKT1102"'
|
||||
signingConfig signingConfigs.T1102
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "aed54e2ec50c45151d17b512c9e4f34c"
|
||||
]
|
||||
}
|
||||
|
||||
U807Debug.initWith(debug)
|
||||
U807Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.U807
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "8200776fc8cad995184a9a3a17a552e4"
|
||||
]
|
||||
}
|
||||
|
||||
U807Release.initWith(release)
|
||||
U807Release {
|
||||
signingConfig signingConfigs.U807
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
AMAP_KEY: "8200776fc8cad995184a9a3a17a552e4"
|
||||
]
|
||||
}
|
||||
|
||||
debug {
|
||||
versionNameSuffix "-debug"
|
||||
@@ -170,7 +77,7 @@ android {
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
// def app_name = getResValues().get("app_name").value
|
||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
def fileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType.name}.apk"
|
||||
output.outputFileName = fileName
|
||||
}
|
||||
}
|
||||
@@ -195,7 +102,7 @@ android {
|
||||
def outputFile = ""
|
||||
if (outputFile != null) {
|
||||
// def app_name = getResValues().get("app_name").value
|
||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
def fileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType.name}.apk"
|
||||
output.outputFileName = new File(outputFile, fileName)
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
// SystemInfoInterface.aidl
|
||||
package com.aoleyun.sn;
|
||||
|
||||
// Declare any non-default types here with import statements
|
||||
|
||||
interface SystemInfoInterface {
|
||||
/**
|
||||
* Demonstrates some basic types that you can use as parameters
|
||||
* and return values in AIDL.
|
||||
*/
|
||||
void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
|
||||
double aDouble, String aString);
|
||||
|
||||
String getSerial();
|
||||
List<String> getHideIcon();
|
||||
List<String> getDisableIcon();
|
||||
String getTopAppPackage();
|
||||
boolean SystemPutInt(String name, int value);
|
||||
void setDefaultDesktop(String pkg);
|
||||
List<String> getDisableApp();
|
||||
}
|
||||
44
app/src/main/aidl/com/uiui/zy/IGetInfoInterface.aidl
Normal file
44
app/src/main/aidl/com/uiui/zy/IGetInfoInterface.aidl
Normal file
@@ -0,0 +1,44 @@
|
||||
// IGetInfoInterface.aidl
|
||||
package com.uiui.zy;
|
||||
|
||||
// Declare any non-default types here with import statements
|
||||
|
||||
interface IGetInfoInterface {
|
||||
/**
|
||||
* Demonstrates some basic types that you can use as parameters
|
||||
* and return values in AIDL.
|
||||
*/
|
||||
void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
|
||||
double aDouble, String aString);
|
||||
|
||||
//获取sn
|
||||
String getSerial();
|
||||
//获取mac作为sn
|
||||
String getPushMac();
|
||||
//是否激活
|
||||
boolean SnIsActivation();
|
||||
//获取激活码
|
||||
String getActivationCode();
|
||||
//设置为默认桌面
|
||||
void setDefaultLauncher(String pkg);
|
||||
//退出桌面
|
||||
void exitDesktop();
|
||||
//能否退出桌面
|
||||
boolean isReturnAndroid();
|
||||
//模拟返回键
|
||||
void keyBack();
|
||||
//获取定位结果
|
||||
String getMapResult();
|
||||
//获取应用使用时长
|
||||
String getAppUsedStatistics();
|
||||
//使用第三方应用
|
||||
boolean showThirdApp();
|
||||
//获取应用市场app
|
||||
List<String> getAdminApp();
|
||||
//写入系统数据
|
||||
boolean putSecureInt(String key, int value);
|
||||
//写入系统数据
|
||||
boolean putSystemInt(String key, int value);
|
||||
//写入系统数据
|
||||
boolean putSystemFloat(String key, float value);
|
||||
}
|
||||
@@ -59,20 +59,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private ScaleCircleNavigator scaleCircleNavigator;
|
||||
|
||||
private FragmentManager mFragmentManager;
|
||||
private BaseFragmentPagerAdapter mBaseFragmentPagerAdapter;
|
||||
|
||||
private List<Fragment> mFragments;
|
||||
|
||||
private UserFragment mUserFragment;
|
||||
private SubjectFragment mSubjectFragment;
|
||||
|
||||
private int defaultCurrent = 1;
|
||||
|
||||
private AppUpdateInfo mAppUpdateInfo;
|
||||
|
||||
@Override
|
||||
public void onRemoteConnected() {
|
||||
Log.e(TAG, "onConnected: ");
|
||||
@@ -113,97 +99,8 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
Utils.getAndroiodScreenProperty(this);
|
||||
|
||||
mFragmentManager = getSupportFragmentManager();
|
||||
mFragments = new ArrayList<>();
|
||||
mUserFragment = new UserFragment();
|
||||
if (!mUserFragment.isAdded()) {
|
||||
mFragments.add(mUserFragment);
|
||||
}
|
||||
mSubjectFragment = new SubjectFragment();
|
||||
if (!mSubjectFragment.isAdded()) {
|
||||
mFragments.add(mSubjectFragment);
|
||||
}
|
||||
mBaseFragmentPagerAdapter = new BaseFragmentPagerAdapter(mFragmentManager, mFragments);
|
||||
|
||||
mViewDataBinding.viewPager.setAdapter(mBaseFragmentPagerAdapter);
|
||||
mViewDataBinding.viewPager.setCurrentItem(defaultCurrent);
|
||||
|
||||
scaleCircleNavigator = new ScaleCircleNavigator(this);
|
||||
scaleCircleNavigator.setCircleCount(1 + mSubjectFragment.getFragmentSize());
|
||||
scaleCircleNavigator.setNormalCircleColor(getResources().getColor(R.color.normal_circle));
|
||||
scaleCircleNavigator.setSelectedCircleColor(getResources().getColor(R.color.selected_circle));
|
||||
scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() {
|
||||
@Override
|
||||
public void onClick(int index) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mViewDataBinding.magicIndicator.setNavigator(scaleCircleNavigator);
|
||||
// ViewPagerHelper.bind(mMagicIndicator, mViewPager);
|
||||
mSubjectFragment.setPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
// Log.e("mSubjectFragment", "onPageScrolled: position = " + position + " positionOffset = " + positionOffset + " positionOffsetPixels = " + positionOffsetPixels);
|
||||
mViewDataBinding.magicIndicator.onPageScrolled(position + 1, positionOffset, positionOffsetPixels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
// Log.e("mSubjectFragment", "onPageSelected: position = " + position);
|
||||
mViewDataBinding.magicIndicator.onPageSelected(position + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
// Log.e("mSubjectFragment", "onPageSelected: state = " + state);
|
||||
mViewDataBinding.magicIndicator.onPageScrollStateChanged(state);
|
||||
}
|
||||
});
|
||||
mViewDataBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
// Log.e("mViewPager", "onPageScrolled: position = " + position + " positionOffset = " + positionOffset + " positionOffsetPixels = " + positionOffsetPixels);
|
||||
if (!(position == 1 && positionOffsetPixels == 0)) {
|
||||
if (position <= 1) {
|
||||
mViewDataBinding.magicIndicator.onPageScrolled(position, positionOffset, positionOffsetPixels);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
// Log.e("mViewPager", "onPageSelected: position = " + position);
|
||||
if (position <= 1) {
|
||||
mViewDataBinding.magicIndicator.onPageSelected(position);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
// Log.e("mViewPager", "onPageSelected: state = " + state);
|
||||
mViewDataBinding.magicIndicator.onPageScrollStateChanged(state);
|
||||
}
|
||||
});
|
||||
|
||||
if (mFragments.size() > 1) {
|
||||
mViewDataBinding.viewPager.setCurrentItem(defaultCurrent);
|
||||
mViewDataBinding.magicIndicator.onPageSelected(defaultCurrent);
|
||||
}
|
||||
// ComponentName cn = new ComponentName("com.jxw.mskt.video", "com.jxw.mskt.video.VideoDownload");
|
||||
// Intent intent = new Intent();
|
||||
// intent.setComponent(cn);
|
||||
// intent.putExtra("type", "新东方专区");
|
||||
// intent.putExtra("isCourse", false);
|
||||
// intent.putExtra("id", 23151);
|
||||
// intent.putExtra("name", "西游记");
|
||||
// intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||
// try {
|
||||
// startActivity(intent);
|
||||
// } catch (Exception e) {
|
||||
// Log.e(TAG, "openPackageWithArgs: " + e.getMessage());
|
||||
// }
|
||||
Intent intent = new Intent(MainActivity.this, SocketService.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
startForegroundService(intent);
|
||||
@@ -287,29 +184,13 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
}
|
||||
|
||||
// public static void toggleNotificationListenerService(Context context) {
|
||||
// Log.e(TAG, "toggleNotificationListenerService");
|
||||
// PackageManager pm = context.getPackageManager();
|
||||
// pm.setComponentEnabledSetting(new ComponentName(context, NotificationService.class),
|
||||
// PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||
//
|
||||
// pm.setComponentEnabledSetting(new ComponentName(context, NotificationService.class),
|
||||
// PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
Log.e(TAG, "onWindowFocusChanged: hasFocus = " + hasFocus);
|
||||
if (hasFocus) {//表示渲染结束
|
||||
if (mViewDataBinding.viewPager != null) {
|
||||
mViewDataBinding.viewPager.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mViewDataBinding.viewPager.setOffscreenPageLimit(4);
|
||||
}
|
||||
}, 1987);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@ public class SubjectFragment extends BaseDataBindingFragment<FragmentSubjectBind
|
||||
|
||||
private String[] mAllTitle = new String[]{
|
||||
// "AR自主学",
|
||||
"精准学", "语文", "数学", "英语", "物理", "化学", "生物", "综合", "应用"};
|
||||
"精准学", "语文", "数学", "英语", "物理", "化学", "生物", "综合"};
|
||||
|
||||
private String[] mTitleWithoutScience = new String[]{"精准学", "语文", "数学", "英语", "应用"};
|
||||
private String[] mTitleWithoutScience = new String[]{"精准学", "语文", "数学", "英语"};
|
||||
|
||||
private FragmentActivity mContext;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SubjectFragment extends BaseDataBindingFragment<FragmentSubjectBind
|
||||
private BiologyFragment mBiologyFragment;
|
||||
private ComplexFragment mComplexFragment;
|
||||
|
||||
private AppFragment mAppFragment;
|
||||
// private AppFragment mAppFragment;
|
||||
|
||||
private List<Fragment> mFragments;
|
||||
private FragmentManager mFragmentManager;
|
||||
@@ -104,7 +104,7 @@ public class SubjectFragment extends BaseDataBindingFragment<FragmentSubjectBind
|
||||
mBiologyFragment = new BiologyFragment();
|
||||
mComplexFragment = new ComplexFragment();
|
||||
}
|
||||
mAppFragment = new AppFragment();
|
||||
// mAppFragment = new AppFragment();
|
||||
|
||||
// mFragments.add(mARStudyFragment);
|
||||
mFragments.add(mPrecisionFragment);
|
||||
@@ -117,7 +117,7 @@ public class SubjectFragment extends BaseDataBindingFragment<FragmentSubjectBind
|
||||
mFragments.add(mBiologyFragment);
|
||||
mFragments.add(mComplexFragment);
|
||||
}
|
||||
mFragments.add(mAppFragment);
|
||||
// mFragments.add(mAppFragment);
|
||||
Log.e(TAG, "SubjectFragment: end = " + (System.currentTimeMillis() - time));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ import android.util.Log;
|
||||
import com.alibaba.sdk.android.push.CloudPushService;
|
||||
import com.alibaba.sdk.android.push.CommonCallback;
|
||||
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||
import com.aoleyun.sn.SystemInfoInterface;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiui.zy.IGetInfoInterface;
|
||||
import com.xuexispace.ai.config.CommonConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -33,12 +33,12 @@ public class RemoteManager {
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private static boolean mServiceConnected = false;
|
||||
|
||||
private SystemInfoInterface mSystemInfoInterface;
|
||||
private IGetInfoInterface mIGetInfoInterface;
|
||||
private ServiceConnection mServiceConnection;
|
||||
|
||||
private static final String SN_AIDL_NAME = "com.aoleyun.sn.SystemInfoInterface";
|
||||
public static final String SN_PACKAGE_NAME = "com.aoleyun.sn";
|
||||
private static final String SN_SERVICE_NAME = "com.aoleyun.sn.service.RemoteService";
|
||||
private static final String SN_AIDL_NAME = "com.uiui.zy.IGetInfoInterface";
|
||||
public static final String SN_PACKAGE_NAME = "com.uiui.zy";
|
||||
private static final String SN_SERVICE_NAME = "com.uiui.zy.service.RemoteService";
|
||||
|
||||
private static final String SN_KEY = "sn_serial_key";
|
||||
|
||||
@@ -51,13 +51,13 @@ public class RemoteManager {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
Log.e(TAG, "onServiceConnected: mIGetInfoConnection");
|
||||
mSystemInfoInterface = SystemInfoInterface.Stub.asInterface(service);
|
||||
mIGetInfoInterface = IGetInfoInterface.Stub.asInterface(service);
|
||||
mServiceConnected = true;
|
||||
for (ConnectedListener listener : mListeners) {
|
||||
listener.onRemoteConnected();
|
||||
}
|
||||
try {
|
||||
String sn = mSystemInfoInterface.getSerial();
|
||||
String sn = mIGetInfoInterface.getSerial();
|
||||
CrashReport.setDeviceId(mContext, sn);
|
||||
mMMKV.encode(SN_KEY, sn);
|
||||
Log.e(TAG, "onServiceConnected: sn = " + sn);
|
||||
@@ -73,7 +73,7 @@ public class RemoteManager {
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
Log.e(TAG, "onServiceDisconnected: mIGetInfoConnection");
|
||||
//置空,重连
|
||||
mSystemInfoInterface = null;
|
||||
mIGetInfoInterface = null;
|
||||
mServiceConnected = false;
|
||||
bindInfoService();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class RemoteManager {
|
||||
}
|
||||
|
||||
private void bindInfoService() {
|
||||
if (mSystemInfoInterface == null) {
|
||||
if (mIGetInfoInterface == null) {
|
||||
//这是连接aidl服务的代码
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(SN_AIDL_NAME);
|
||||
@@ -173,9 +173,9 @@ public class RemoteManager {
|
||||
* @return 获取sn
|
||||
*/
|
||||
public String getSerial() {
|
||||
if (mSystemInfoInterface != null) {
|
||||
if (mIGetInfoInterface != null) {
|
||||
try {
|
||||
return mSystemInfoInterface.getSerial();
|
||||
return mIGetInfoInterface.getSerial();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getSerial: " + e.getMessage());
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.xuexispace.ai.network;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -31,24 +30,15 @@ import com.xuexispace.ai.gson.GsonUtils;
|
||||
import com.xuexispace.ai.manager.RemoteManager;
|
||||
import com.xuexispace.ai.network.api.AlarmClockApi;
|
||||
import com.xuexispace.ai.network.api.AppUsageRecordApi;
|
||||
import com.xuexispace.ai.network.api.CloudLessonApi;
|
||||
import com.xuexispace.ai.network.api.CloudLessonAppApi;
|
||||
import com.xuexispace.ai.network.api.GetFilesApi;
|
||||
import com.xuexispace.ai.network.api.GetHomeworkApi;
|
||||
import com.xuexispace.ai.network.api.HomeworkDetailApi;
|
||||
import com.xuexispace.ai.network.api.HomeworkUpdateApi;
|
||||
import com.xuexispace.ai.network.api.HomeworkApi;
|
||||
import com.xuexispace.ai.network.api.PhraseApi;
|
||||
import com.xuexispace.ai.network.api.RunNewApp;
|
||||
import com.xuexispace.ai.network.api.SNInfoApi;
|
||||
import com.xuexispace.ai.network.api.SnInfoApi;
|
||||
import com.xuexispace.ai.network.api.SettingApi;
|
||||
import com.xuexispace.ai.network.api.StudyStatApi;
|
||||
import com.xuexispace.ai.network.api.UpdateAddressApi;
|
||||
import com.xuexispace.ai.network.api.UpdateAlarmClockApi;
|
||||
import com.xuexispace.ai.network.api.UpdateInfoControl;
|
||||
import com.xuexispace.ai.network.api.UserInfoControl;
|
||||
import com.xuexispace.ai.network.api.uiuios.CheckUpdateApi;
|
||||
import com.xuexispace.ai.network.interceptor.RepeatRequestInterceptor;
|
||||
import com.xuexispace.ai.utils.OpenApkUtils;
|
||||
import com.xuexispace.ai.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -113,7 +103,7 @@ public class NetInterfaceManager {
|
||||
builder.addInterceptor(new RepeatRequestInterceptor());
|
||||
|
||||
// 设置缓存文件路径
|
||||
Cache cache = new Cache(new File(getCacheDir() + "/OkHttpCache"), CACHE_SIZE);
|
||||
Cache cache = new Cache(new File(Utils.getCacheDir(mContext) + "/OkHttpCache"), CACHE_SIZE);
|
||||
builder.cache(cache);// 设置缓存
|
||||
mOkHttpClient = builder.build();
|
||||
}
|
||||
@@ -138,7 +128,7 @@ public class NetInterfaceManager {
|
||||
builder.addInterceptor(new RepeatRequestInterceptor());
|
||||
|
||||
// 设置缓存文件路径
|
||||
Cache cache = new Cache(new File(getCacheDir() + "/OkHttpCache"), CACHE_SIZE);
|
||||
Cache cache = new Cache(new File(Utils.getCacheDir(mContext) + "/OkHttpCache"), CACHE_SIZE);
|
||||
builder.cache(cache);// 设置缓存
|
||||
mUiuiosOkHttpClient = builder.build();
|
||||
}
|
||||
@@ -173,23 +163,6 @@ public class NetInterfaceManager {
|
||||
Log.e("OKhttp ", " 打印HTTP请求完成 Headers \n");
|
||||
}
|
||||
|
||||
private String getCacheDir() {
|
||||
String cachePath;
|
||||
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|
||||
|| !Environment.isExternalStorageRemovable()) {
|
||||
if (mContext.getExternalCacheDir() != null) {
|
||||
cachePath = mContext.getExternalCacheDir().getPath();
|
||||
} else if (mContext.getExternalFilesDir("cache") != null) {
|
||||
cachePath = mContext.getExternalFilesDir("cache").getPath();
|
||||
} else {
|
||||
cachePath = mContext.getCacheDir().getPath();
|
||||
}
|
||||
} else {
|
||||
cachePath = mContext.getCacheDir().getPath();
|
||||
}
|
||||
return cachePath;
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new NetInterfaceManager(context);
|
||||
@@ -248,14 +221,14 @@ public class NetInterfaceManager {
|
||||
* */
|
||||
|
||||
public Observable<BaseResponse<SnInfo>> getsnInfoControl() {
|
||||
return mRetrofit.create(SNInfoApi.class)
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.getsninfo(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<UserAvatarInfo>> getUserAvatarInfoControl() {
|
||||
return mRetrofit.create(UserInfoControl.class)
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.getUserAvatarInfo(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -264,7 +237,7 @@ public class NetInterfaceManager {
|
||||
public Observable<BaseResponse> getUpdateInfoObservable(Map<String, String> params) {
|
||||
String json = GsonUtils.toJSONString(params);
|
||||
RequestBody body = convertToJsonRequestBody(json);
|
||||
return mRetrofit.create(UpdateInfoControl.class)
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.updateUserInfo(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -273,28 +246,28 @@ public class NetInterfaceManager {
|
||||
public Observable<BaseResponse> getUpdateInfoObservable(Map<String, String> params, MultipartBody.Part multipartBody) {
|
||||
String json = GsonUtils.toJSONString(params);
|
||||
RequestBody requestBody = convertToJsonRequestBody(json);
|
||||
return mRetrofit.create(UpdateInfoControl.class)
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.updateUserInfo(requestBody, multipartBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getRunningAppObservable(String json) {
|
||||
return mRetrofit.create(RunNewApp.class)
|
||||
return mRetrofit.create(AppUsageRecordApi.class)
|
||||
.sendRunningInfo(RemoteManager.getInstance().getSerial(), json)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<LessonSetting>> getCloudLessonObservable() {
|
||||
return mRetrofit.create(CloudLessonApi.class)
|
||||
return mRetrofit.create(SettingApi.class)
|
||||
.getCloudLessonSetting(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<LessonApp>> getCloudLessonAppObservable() {
|
||||
return mRetrofit.create(CloudLessonAppApi.class)
|
||||
return mRetrofit.create(SettingApi.class)
|
||||
.getCloudLessonApp(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -309,21 +282,21 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAlarmObservable(int id) {
|
||||
return mRetrofit.create(UpdateAlarmClockApi.class)
|
||||
return mRetrofit.create(AlarmClockApi.class)
|
||||
.updateAlarm(RemoteManager.getInstance().getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<StudyStatBean>> getStudyStatObservable() {
|
||||
return mRetrofit.create(StudyStatApi.class)
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.getStudyStat(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAddressObservable(String address, double longitude, double latitude) {
|
||||
return mRetrofit.create(UpdateAddressApi.class)
|
||||
return mRetrofit.create(SnInfoApi.class)
|
||||
.updateAddress(RemoteManager.getInstance().getSerial(), address, longitude, latitude)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -337,21 +310,21 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ArrayList<HomeworkBean>>> getHomeworkObservable() {
|
||||
return mRetrofit.create(GetHomeworkApi.class)
|
||||
return mRetrofit.create(HomeworkApi.class)
|
||||
.getHomeworks(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<HomeworkBean>> getHomeworkDetailObservable(int id) {
|
||||
return mRetrofit.create(HomeworkDetailApi.class)
|
||||
return mRetrofit.create(HomeworkApi.class)
|
||||
.getHomeworkDetail(RemoteManager.getInstance().getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getHomeworkUpdateObservable(int id) {
|
||||
return mRetrofit.create(HomeworkUpdateApi.class)
|
||||
return mRetrofit.create(HomeworkApi.class)
|
||||
.updateHomework(RemoteManager.getInstance().getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
|
||||
@@ -7,7 +7,10 @@ import com.xuexispace.ai.network.UrlAddress;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AlarmClockApi {
|
||||
@@ -15,4 +18,11 @@ public interface AlarmClockApi {
|
||||
Observable<BaseResponse<List<AlarmClockData>>> getAlarmClock(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_ALARM_CLOCK)
|
||||
Observable<BaseResponse> updateAlarm(
|
||||
@Field("sn") String sn,
|
||||
@Field("id") int id
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,13 @@ import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface AppUsageRecordApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.RUN_NEW_APP)
|
||||
Observable<BaseResponse> sendRunningInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("app") String app
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.APP_USAGE_RECORD)
|
||||
Observable<BaseResponse> sendappUsageRecord(
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.LessonSetting;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface CloudLessonApi {
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON)
|
||||
Observable<BaseResponse<LessonSetting>> getCloudLessonSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.LessonApp;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface CloudLessonAppApi {
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
|
||||
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.HomeworkBean;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetHomeworkApi {
|
||||
@GET(UrlAddress.GET_HOMEWORK)
|
||||
Observable<BaseResponse<ArrayList<HomeworkBean>>> getHomeworks(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.HomeworkBean;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface HomeworkApi {
|
||||
@GET(UrlAddress.GET_HOMEWORK)
|
||||
Observable<BaseResponse<ArrayList<HomeworkBean>>> getHomeworks(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_HOMEWORK_DETAIL)
|
||||
Observable<BaseResponse<HomeworkBean>> getHomeworkDetail(
|
||||
@Query("sn") String sn,
|
||||
@Query("id") int id
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_HOMEWORK_UPDATE)
|
||||
Observable<BaseResponse> updateHomework(
|
||||
@Field("sn") String sn,
|
||||
@Field("id") int id
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.HomeworkBean;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface HomeworkDetailApi {
|
||||
@GET(UrlAddress.GET_HOMEWORK_DETAIL)
|
||||
Observable<BaseResponse<HomeworkBean>> getHomeworkDetail(
|
||||
@Query("sn") String sn,
|
||||
@Query("id") int id
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface HomeworkUpdateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_HOMEWORK_UPDATE)
|
||||
Observable<BaseResponse> updateHomework(
|
||||
@Field("sn") String sn,
|
||||
@Field("id") int id
|
||||
);
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface RunNewApp {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.RUN_NEW_APP)
|
||||
Observable<BaseResponse> sendRunningInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("app") String app
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.SnInfo;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SNInfoApi {
|
||||
@GET(UrlAddress.SNINFO)
|
||||
Observable<BaseResponse<SnInfo>> getsninfo(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.LessonApp;
|
||||
import com.xuexispace.ai.bean.LessonSetting;
|
||||
import com.xuexispace.ai.bean.SystemSettings;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
@@ -9,6 +11,16 @@ import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SettingApi {
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON)
|
||||
Observable<BaseResponse<LessonSetting>> getCloudLessonSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
|
||||
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SETTINGS)
|
||||
Observable<BaseResponse<SystemSettings>> getSetting(
|
||||
@Query("sn") String sn
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.SnInfo;
|
||||
import com.xuexispace.ai.bean.StudyStatBean;
|
||||
import com.xuexispace.ai.bean.UserAvatarInfo;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnInfoApi {
|
||||
@GET(UrlAddress.SNINFO)
|
||||
Observable<BaseResponse<SnInfo>> getsninfo(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_USER_AVATAR_INFO)
|
||||
Observable<BaseResponse<UserAvatarInfo>> getUserAvatarInfo(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@POST(UrlAddress.UPDATE_INFO)
|
||||
Observable<BaseResponse> updateUserInfo(@Body RequestBody requestBody);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPDATE_INFO)
|
||||
Observable<BaseResponse> updateUserInfo(
|
||||
@Body RequestBody requestBody,
|
||||
@Part MultipartBody.Part body);
|
||||
|
||||
@GET(UrlAddress.GET_STUDY_STAT)
|
||||
Observable<BaseResponse<StudyStatBean>> getStudyStat(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_ADDRESS)
|
||||
Observable<BaseResponse> updateAddress(
|
||||
@Field("sn") String sn,
|
||||
@Field("address") String address,
|
||||
@Field("longitude") double longitude,
|
||||
@Field("latitude") double latitude
|
||||
);
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.StudyStatBean;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface StudyStatApi {
|
||||
@GET(UrlAddress.GET_STUDY_STAT)
|
||||
Observable<BaseResponse<StudyStatBean>> getStudyStat(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UpdateAddressApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_ADDRESS)
|
||||
Observable<BaseResponse> updateAddress(
|
||||
@Field("sn") String sn,
|
||||
@Field("address") String address,
|
||||
@Field("longitude") double longitude,
|
||||
@Field("latitude") double latitude
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UpdateAlarmClockApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_ALARM_CLOCK)
|
||||
Observable<BaseResponse> updateAlarm(
|
||||
@Field("sn") String sn,
|
||||
@Field("id") int id
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
|
||||
public interface UpdateInfoControl {
|
||||
@POST(UrlAddress.UPDATE_INFO)
|
||||
Observable<BaseResponse> updateUserInfo(@Body RequestBody requestBody);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPDATE_INFO)
|
||||
Observable<BaseResponse> updateUserInfo(
|
||||
@Body RequestBody requestBody,
|
||||
@Part MultipartBody.Part body);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xuexispace.ai.network.api;
|
||||
|
||||
import com.xuexispace.ai.bean.BaseResponse;
|
||||
import com.xuexispace.ai.bean.UserAvatarInfo;
|
||||
import com.xuexispace.ai.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UserInfoControl {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_USER_AVATAR_INFO)
|
||||
Observable<BaseResponse<UserAvatarInfo>> getUserAvatarInfo(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -399,4 +399,21 @@ public class Utils {
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static String getCacheDir(Context context) {
|
||||
String cachePath;
|
||||
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|
||||
|| !Environment.isExternalStorageRemovable()) {
|
||||
if (context.getExternalCacheDir() != null) {
|
||||
cachePath = context.getExternalCacheDir().getPath();
|
||||
} else if (context.getExternalFilesDir("cache") != null) {
|
||||
cachePath = context.getExternalFilesDir("cache").getPath();
|
||||
} else {
|
||||
cachePath = context.getCacheDir().getPath();
|
||||
}
|
||||
} else {
|
||||
cachePath = context.getCacheDir().getPath();
|
||||
}
|
||||
return cachePath;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 114 KiB |
@@ -20,25 +20,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
<fragment
|
||||
android:id="@+id/subjectFragment"
|
||||
android:name="com.xuexispace.ai.fragment.subject.SubjectFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/magicIndicator"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/magicIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_robot"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
@@ -178,7 +169,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:onClick="@{click::open2}">
|
||||
android:onClick="@{click::open2}"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon2"
|
||||
@@ -244,7 +236,7 @@
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:onClick="@{click::open4}"
|
||||
android:visibility="visible">
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon4"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">学习精灵</string>
|
||||
<string name="app_name">学习空间</string>
|
||||
<string name="privacy_agreement"><u>隐私协议</u></string>
|
||||
<string name="privacy_agreement_title">服务协议和隐私政策</string>
|
||||
<string name="privacy_agreement_content">\t\t\t\t请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了向你提供即时通讯,内容分享等服务,
|
||||
|
||||
Reference in New Issue
Block a user