update:2021.01.27
fix:版本号更新 add:
@@ -35,6 +35,15 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.CopyrightActivity"
|
||||
android:screenOrientation="behind" />
|
||||
@@ -44,12 +53,15 @@
|
||||
<activity
|
||||
android:name=".activity.SearcherActivity"
|
||||
android:screenOrientation="behind" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.HintActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="sensor"
|
||||
android:theme="@style/activity_styles" />
|
||||
<service
|
||||
android:name=".service.InitJpushServer"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.KindDetailActivity"
|
||||
android:screenOrientation="behind" />
|
||||
@@ -62,17 +74,6 @@
|
||||
<activity
|
||||
android:name=".activity.DownloadManagerActivity"
|
||||
android:screenOrientation="behind" />
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service android:name=".service.GuardService" />
|
||||
<service android:name=".service.StepService" />
|
||||
<service android:name=".service.MyDownloadService" />
|
||||
@@ -195,7 +196,8 @@
|
||||
|
||||
<category android:name="com.appstore.uiui" />
|
||||
</intent-filter>
|
||||
</activity> <!-- Since JCore2.0.0 Required SDK核心功能 -->
|
||||
</activity>
|
||||
<!-- Since JCore2.0.0 Required SDK核心功能 -->
|
||||
<!-- 这个Service要继承JCommonService -->
|
||||
<service
|
||||
android:name=".jpush.PushService"
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.appstore.uiui.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.appstore.uiui.R;
|
||||
import com.appstore.uiui.base.BaseActivity;
|
||||
import com.appstore.uiui.utils.ApkUtils;
|
||||
|
||||
public class HintActivity extends BaseActivity {
|
||||
private ConstraintLayout root;
|
||||
private TextView tv_hint;
|
||||
private Button bt_confirm;
|
||||
|
||||
@Override
|
||||
protected int setLayoutResourceID() {
|
||||
return R.layout.activity_hint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
root = findViewById(R.id.root);
|
||||
tv_hint = findViewById(R.id.tv_hint);
|
||||
bt_confirm = findViewById(R.id.bt_confirm);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
String text = intent.getStringExtra("text");
|
||||
if (!TextUtils.isEmpty(text)) {
|
||||
tv_hint.setText(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setListener() {
|
||||
root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
bt_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ApkUtils.openApp(HintActivity.this, "com.info.sn");
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
// TODO Auto-generated method stub
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,6 @@ import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -35,8 +33,6 @@ import com.appstore.uiui.jpush.ExampleUtil;
|
||||
import com.appstore.uiui.jpush.LocalBroadcastManager;
|
||||
import com.appstore.uiui.jpush.TagAliasOperatorHelper;
|
||||
import com.appstore.uiui.network.NetInterfaceManager;
|
||||
import com.appstore.uiui.network.api.QueryAllApp;
|
||||
import com.appstore.uiui.network.api.SNInfo;
|
||||
import com.appstore.uiui.service.GuardService;
|
||||
import com.appstore.uiui.service.InitJpushServer;
|
||||
import com.appstore.uiui.service.MyDownloadService;
|
||||
@@ -96,7 +92,6 @@ public class MainActivity extends BaseActivity {
|
||||
// Toast.makeText(this, "Get registration fail, JPush init failed!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// OKGO.getUserInfo(handler);
|
||||
getUserInfo();
|
||||
|
||||
// PackageManager pm = getPackageManager();
|
||||
// pm.setApplicationEnabledSetting("com.tencent.qqmusic", PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
|
||||
@@ -117,6 +112,17 @@ public class MainActivity extends BaseActivity {
|
||||
return R.layout.activity_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getUserInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
@@ -413,6 +419,7 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(@io.reactivex.annotations.NonNull BaseResponse<UserInfo> userInfoBaseResponse) {
|
||||
int code = userInfoBaseResponse.code;
|
||||
//已经绑定
|
||||
if (code == 200) {
|
||||
UserInfo info = userInfoBaseResponse.data;
|
||||
SPUtils.put(MainActivity.this, "isLogined", 1);
|
||||
@@ -421,10 +428,19 @@ public class MainActivity extends BaseActivity {
|
||||
if (!TextUtils.isEmpty(info.getGrade())) {
|
||||
SPUtils.put(MainActivity.this, "sn_grade", info.getGrade());
|
||||
}
|
||||
} else if (code == -200) {
|
||||
}
|
||||
//没有绑定
|
||||
else if (code == 300) {
|
||||
SPUtils.put(MainActivity.this, "isLogined", 0);
|
||||
} else if (code == -250) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("text", getResources().getString(R.string.no_bind));
|
||||
intent.setClass(MainActivity.this, HintActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
//没有设备
|
||||
else if (code == 400) {
|
||||
SPUtils.put(MainActivity.this, "isLogined", 2);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,68 +497,4 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Handler handler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(@NonNull Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
// case 0:
|
||||
// SPUtils.put(MainActivity.this, "isLogined", 0);
|
||||
// break;
|
||||
// case 1:
|
||||
// SPUtils.put(MainActivity.this, "isLogined", 1);
|
||||
// UserInfo userInfo = (UserInfo) msg.obj;
|
||||
// SPUtils.put(MainActivity.this, "member_id", userInfo.getMember_id());
|
||||
// SPUtils.put(MainActivity.this, "sn_id", userInfo.getId());
|
||||
// SPUtils.put(MainActivity.this, "sn_grade", userInfo.getGrade());
|
||||
// break;
|
||||
// case 2:
|
||||
// SPUtils.put(MainActivity.this, "isLogined", 2);
|
||||
// break;
|
||||
case 200:
|
||||
String url = (String) msg.obj;
|
||||
// getFile(url);
|
||||
break;
|
||||
case 201:
|
||||
String apppackage = (String) msg.obj;
|
||||
Log.e("fht", Settings.System.getString(getContentResolver(), "qch_app_forbid") + "?");
|
||||
if (Settings.System.putString(getContentResolver(), "qch_app_forbid", apppackage)) {
|
||||
Log.e("fht", "app package write successful");
|
||||
}
|
||||
break;
|
||||
case 202:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// private void getFile(String url) {
|
||||
// OkGo.<File>get(url)
|
||||
// .execute(new FileCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(final Response<File> response) {
|
||||
//// Settings.System.putString(getApplicationContext().getContentResolver(), "qch_app_forbid", "com.baidu.video");
|
||||
// new Thread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// ApkUtils.installApp(MainActivity.this, response.body().getAbsolutePath());
|
||||
// }
|
||||
// }).start();
|
||||
// LogUtils.e("getFile", "download file successful,now installing");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<File> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("getFile", "File download Failure");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void downloadProgress(Progress progress) {
|
||||
// super.downloadProgress(progress);
|
||||
// LogUtils.e("getFile", "已下载:" + progress.currentSize + ",总大小:" + progress.totalSize + ",进度:" + progress.fraction + ",当前网速:" + progress.speed);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -129,6 +129,12 @@ public class DownloadManagerAdapter extends RecyclerView.Adapter<DownloadManager
|
||||
if (null != mDownloadTask && mDownloadTask.getEntity().getUrl().equals(entity.getUrl())) {
|
||||
holder.refresh(mDownloadTask);
|
||||
}
|
||||
holder.remove.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Aria.download(this).load(entity.getId()).cancel(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// public void unRegister() {
|
||||
|
||||
@@ -29,8 +29,8 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
setStatusBar();
|
||||
setContentView(setLayoutResourceID());
|
||||
initView();
|
||||
initData();
|
||||
setListener();
|
||||
initData();
|
||||
}
|
||||
|
||||
protected abstract int setLayoutResourceID();
|
||||
|
||||
@@ -20,6 +20,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.appstore.uiui.R;
|
||||
import com.appstore.uiui.activity.HintActivity;
|
||||
import com.appstore.uiui.activity.MainActivity;
|
||||
import com.appstore.uiui.adapter.AppAdapter;
|
||||
import com.appstore.uiui.adapter.BannerViewHolder;
|
||||
import com.appstore.uiui.base.LazyLoadFragment;
|
||||
@@ -269,8 +271,8 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
Log.e(TAG, "getBanner: iv_banner: height = " + bannerHeight);
|
||||
Log.e(TAG, "getBanner: Drawable: width = " + width);
|
||||
Log.e(TAG, "getBanner: Drawable: height = " + height);
|
||||
Log.e(TAG, "getBanner: " + (float) (1.0 *bannerWidth / width));
|
||||
Log.e(TAG, "getBanner: " +(int) ((float) (1.0 *bannerWidth / width) * height));
|
||||
Log.e(TAG, "getBanner: " + (float) (1.0 * bannerWidth / width));
|
||||
Log.e(TAG, "getBanner: " + (int) ((float) (1.0 * bannerWidth / width) * height));
|
||||
int changeHeight = (int) ((double) (bannerWidth / width) * height);
|
||||
if (changeHeight != 0) {
|
||||
iv_banner.getLayoutParams().height = changeHeight;
|
||||
@@ -314,6 +316,11 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
} else {
|
||||
mRvResult.setVisibility(View.GONE);
|
||||
imageView.setVisibility(View.VISIBLE);
|
||||
Intent intent = new Intent();
|
||||
// intent.putExtra("text", getResources().getString(R.string.no_app));
|
||||
intent.setClass(getActivity(), HintActivity.class);
|
||||
startActivity(intent);
|
||||
getActivity().finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,481 +94,5 @@ public class HTTPInterface {
|
||||
checkUpdate(context, packageName, "0");
|
||||
}
|
||||
}
|
||||
|
||||
// private Handler mhandler = new Handler() {
|
||||
// @Override
|
||||
// public void handleMessage(@NonNull Message msg) {
|
||||
// super.handleMessage(msg);
|
||||
// switch (msg.what) {
|
||||
// case GET_ALL_APPINFO:
|
||||
// break;
|
||||
// case GET_USERINFO:
|
||||
//
|
||||
// break;
|
||||
// case GET_SORTAPP:
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// synchronized public static void getAllAppInfo(final Handler handler) {
|
||||
// OkGo.<String>post(UrlAddress.GET_ALL_APPINFO)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(response.body());
|
||||
//// LogUtils.e("onSuccess", body.toString());
|
||||
// LogUtils.e("fht", "getAllAppInfo onSuccess");
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// String data = body.getString("data");
|
||||
// List<AppInfo> applist = JSON.parseArray(data, AppInfo.class);
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
// Message message = new Message();
|
||||
// message.what = 1;
|
||||
// message.obj = applist;
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// ToastUtil.show(msg);
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.e("Exception", e.getMessage());
|
||||
// ToastUtil.show("服务器错误,请稍后重试");
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("getAllAppInfo", response.getException().toString());
|
||||
// ToastUtil.show("网络连接失败,检查网络连接");
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// public static synchronized void checkDevicesInfo(final Context context) {
|
||||
// OkGo.<String>get(UrlAddress.GET_INFO_FROMESN)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// Log.e("onSuccess", "checkDevicesInfo");
|
||||
// try {
|
||||
// JSONObject bodyObject = JSON.parseObject(response.body());
|
||||
// Integer code = (bodyObject.getInteger("code"));
|
||||
// String msg = bodyObject.getString("msg");
|
||||
// String data = bodyObject.getString("data");
|
||||
// SNInfo userInfo = JSON.parseObject(data, SNInfo.class);
|
||||
// if (code == 200) {
|
||||
// SPUtils.put(context, "isLogined", 1);
|
||||
// SPUtils.put(context, "member_id", userInfo.getMember_id());
|
||||
// SPUtils.put(context, "sn_id", userInfo.getId());
|
||||
// } else if (code == -200) {
|
||||
// SPUtils.put(context, "isLogined", 0);
|
||||
//
|
||||
// } else if (code == -250) {
|
||||
// SPUtils.put(context, "isLogined", 2);
|
||||
// //设备验证
|
||||
// }
|
||||
// } catch (Exception ex) {
|
||||
// Log.e("checkDevicesInfo", ex.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// Log.e("onError", response.getException().toString());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void getAllAppPackageName(final Handler handler) {
|
||||
// OkGo.<String>post(UrlAddress.GET_ALL_PACKAGENAME)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// String s = response.body();
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(s);
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// String data = body.getString("data");
|
||||
// if (code == 200) {
|
||||
// List<JSONObject> jsonArray = JSON.parseArray(data, JSONObject.class);
|
||||
// String packageList = "";
|
||||
// for (JSONObject jsonObject : jsonArray) {
|
||||
// packageList += jsonObject.getString("app_package") + ",";
|
||||
// }
|
||||
// if (!packageList.isEmpty()) {
|
||||
// Log.e("fht", packageList);
|
||||
// Message message = new Message();
|
||||
// message.what = 201;
|
||||
// message.obj = packageList;
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// handler.sendEmptyMessage(202);
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void getRankApp(final Handler handler) {
|
||||
// OkGo.<String>get(UrlAddress.GET_ALL_RANK).execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(response.body());
|
||||
//// LogUtils.e("onSuccess", body.toString());
|
||||
// LogUtils.e("fht", "getAllAppInfo onSuccess");
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// String data = body.getString("data");
|
||||
// List<AppInfo> applist = JSON.parseArray(data, AppInfo.class);
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
// Message message = new Message();
|
||||
// message.what = 1;
|
||||
// message.obj = applist;
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// ToastUtil.show(msg);
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.e("Exception", e.getMessage());
|
||||
// ToastUtil.show("服务器错误,请稍后重试");
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("getRankApp", response.getException().toString());
|
||||
// ToastUtil.show("网络连接失败,检查网络连接");
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void searchAppbyName(final Handler handler, String app_name) {
|
||||
// OkGo.<String>post(UrlAddress.GET_APPSEARCHE)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .params("app_name", app_name)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(response.body());
|
||||
// LogUtils.e("onSuccess", body.toString());
|
||||
// LogUtils.e("fht", "searchAppbyName onSuccess");
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// String data = body.getString("data");
|
||||
// List<AppInfo> applist = JSON.parseArray(data, AppInfo.class);
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
// Message message = new Message();
|
||||
// message.what = 1;
|
||||
// message.obj = applist;
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// ToastUtil.show(msg);
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.e("Exception", e.getMessage());
|
||||
// ToastUtil.show("服务器错误,请稍后重试");
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("searchAppbyName", response.getException().toString());
|
||||
// ToastUtil.show("网络连接失败,检查网络连接");
|
||||
// handler.sendEmptyMessage(0);
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void getUserInfo(final Handler handler) {
|
||||
// String sn = Utils.getSerial();
|
||||
// OkGo.<String>get(UrlAddress.GET_INFO_FROMESN)
|
||||
// .params("sn", sn)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// LogUtils.e("fht", "getUserInfo onSuccess");
|
||||
// JSONObject jsonObject = JSON.parseObject(response.body());
|
||||
// int code = jsonObject.getInteger("code");
|
||||
// String msg = jsonObject.getString("msg");
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
// String data = jsonObject.getString("data");
|
||||
// SNInfo userInfo = JSON.parseObject(data, SNInfo.class);
|
||||
// Message message = new Message();
|
||||
// message.what = 1;
|
||||
// message.obj = userInfo;
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// ToastUtil.show(msg);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("getUserInfo", response.getException().toString());
|
||||
// ToastUtil.show("网络连接失败,检查网络连接");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void getUserInfo(final Context context) {
|
||||
// OkGo.<String>get(UrlAddress.GET_INFO_FROMESN)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// LogUtils.e("fht", "getUserInfo onSuccess");
|
||||
// JSONObject jsonObject = JSON.parseObject(response.body());
|
||||
// int code = jsonObject.getInteger("code");
|
||||
// String msg = jsonObject.getString("msg");
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
// String data = jsonObject.getString("data");
|
||||
// SNInfo userInfo = JSON.parseObject(data, SNInfo.class);
|
||||
// SPUtils.put(context, "member_id", userInfo.getMember_id());
|
||||
// SPUtils.put(context, "sn_id", userInfo.getId());
|
||||
// SPUtils.put(context, "sn_grade", userInfo.getSn_grade());
|
||||
// } else {
|
||||
// ToastUtil.show(msg);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("getUserInfo", response.getException().toString());
|
||||
// ToastUtil.show("网络连接失败,检查网络连接");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void getSortApp(final Handler handler, int type, int grade, int subject) {
|
||||
// OkGo.<String>post(UrlAddress.GET_SORT_APP)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .params("app_type", type)//应用分类 0学习 1娱乐
|
||||
// .params("grade", grade)//年级 以数字代表
|
||||
// .params("subject", subject) //科目 以数字代表
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// LogUtils.e("fht", "getSortApp onSuccess");
|
||||
// JSONObject jsonObject = JSON.parseObject(response.body());
|
||||
// LogUtils.e("fht", jsonObject.toString());
|
||||
// int code = jsonObject.getInteger("code");
|
||||
// String msg = jsonObject.getString("msg");
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
// String data = jsonObject.getString("data");
|
||||
// List<AppInfo> list = JSON.parseArray(data, AppInfo.class);
|
||||
// Message message = new Message();
|
||||
// message.what = 1;
|
||||
// message.obj = list;
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// ToastUtil.show(msg);
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("getSortApp", response.getException().toString());
|
||||
// ToastUtil.show("网络连接失败,检查网络连接");
|
||||
// handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void setAppinstallInfo(int member_id, String sn_id, String app_name, String packageName) {
|
||||
// OkGo.<String>post(UrlAddress.SET_APP_INSTALL_INFO)
|
||||
// .params("member_id", member_id)
|
||||
// .params("sn_id", sn_id)
|
||||
// .params("app_name", app_name)
|
||||
// .params("package", packageName)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// JSONObject object = JSON.parseObject(response.body());
|
||||
// int code = object.getInteger("code");
|
||||
// String msg = object.getString("msg");
|
||||
// LogUtils.e("setAppinstallInfo", msg);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("setAppinstallInfo", "onError:" + response.getException());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// synchronized public static void setAppuninstallInfo(String sn_id, String packageName) {
|
||||
// OkGo.<String>post(UrlAddress.SET_APP_UNINSTALL_INFO)
|
||||
// .params("sn_id", sn_id)
|
||||
// .params("package", packageName)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// JSONObject object = JSON.parseObject(response.body());
|
||||
// int code = object.getInteger("code");
|
||||
// String msg = object.getString("msg");
|
||||
// LogUtils.e("setAppinstallInfo", msg);
|
||||
// if (code == MessageWhat.CODE_SUCCESSFUL) {
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// LogUtils.e("setAppinstallInfo", "onError:" + response.getException());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// synchronized public static void checkUpdateByPackage(final Handler handler, final String packageName, String versionCode) {
|
||||
// OkGo.<String>post(UrlAddress.GET_APP_UPDATE)
|
||||
// .params("code", versionCode)
|
||||
// .params("package", packageName)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(response.body());
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// if (code == 200) {
|
||||
// Message message = new Message();
|
||||
// JSONObject data = JSON.parseObject(body.getString("data"));
|
||||
// if (data != null) {
|
||||
// String url = data.getString("downloadurl");
|
||||
// message.what = 200;
|
||||
// message.obj = url;
|
||||
// } else {
|
||||
// message.what = -200;
|
||||
// }
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// Log.e("checkUpdateByPackage", packageName + msg);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// Log.e("checkUpdateByPackage", e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// Log.e("checkUpdateByPackage", response.getException().toString());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// public static void getBannerImg(final Handler handler) {
|
||||
// OkGo.<String>get(UrlAddress.GET_BANNER_IMG).execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(response.body());
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// if (code == 200) {
|
||||
// Message message = new Message();
|
||||
// List<bannerImage> data = JSON.parseArray(body.getString("data"), bannerImage.class);
|
||||
// if (data != null) {
|
||||
// List<String> urlList = new ArrayList<>();
|
||||
// for (int i = 0; i < data.size(); i++) {
|
||||
// urlList.add(data.get(0).getImg());
|
||||
// }
|
||||
// message.what = 200;
|
||||
// message.obj = urlList;
|
||||
// } else {
|
||||
// message.what = -200;
|
||||
// }
|
||||
// handler.sendMessage(message);
|
||||
// } else {
|
||||
// Log.e("checkUpdateByPackage", msg);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// Log.e("checkUpdateByPackage", e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public static void getSubClassfy(final Handler handler) {
|
||||
// OkGo.<String>post(UrlAddress.GET_SUBClASSFY)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(Response<String> response) {
|
||||
// JSONObject jsonObject = JSONObject.parseObject(response.body());
|
||||
// int code = jsonObject.getInteger("code");
|
||||
// String msg = jsonObject.getString("msg");
|
||||
// if (code == 200) {
|
||||
// String data = jsonObject.getString("data");
|
||||
// if (!data.equals("")) {
|
||||
// List<String> list = Arrays.asList(data.split(","));
|
||||
// Message message = new Message();
|
||||
// message.what = 200;
|
||||
// message.obj = list;
|
||||
// handler.sendMessage(message);
|
||||
// }
|
||||
// } else {
|
||||
// ToastUtil.debugShow(msg);
|
||||
// handler.sendEmptyMessage(-200);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Response<String> response) {
|
||||
// super.onError(response);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,32 +6,30 @@ public class UrlAddress {
|
||||
public final static String GET_ALL_APPINFO = "app/queryAllApp";
|
||||
//获取所有应用
|
||||
public final static String GET_PACKAGE_APP = "app/queryPackageApp";
|
||||
|
||||
public final static String GET_ALL_RANK = "App/rankings";
|
||||
//获取所有应用排行
|
||||
public final static String GET_APPSEARCHE = "App/appSearch";
|
||||
public final static String GET_ALL_RANK = "App/rankings";
|
||||
//搜索应用
|
||||
public final static String GET_INFO_FROMESN = "sn/getSnInfo";
|
||||
public final static String GET_APPSEARCHE = "App/appSearch";
|
||||
//通过SN获取绑定信息
|
||||
public final static String GET_SORT_APP = "App/sortApp";
|
||||
public final static String GET_INFO_FROMESN = "sn/getSnInfo";
|
||||
//app分类查询
|
||||
public final static String SET_APP_INSTALL_INFO = "App/appInstall";
|
||||
public final static String GET_SORT_APP = "App/sortApp";
|
||||
//发送app安装信息
|
||||
public final static String SET_APP_UNINSTALL_INFO = "App/appUnload";
|
||||
public final static String SET_APP_INSTALL_INFO = "App/appInstall";
|
||||
//发送app卸载信息
|
||||
public final static String GET_APP_UPDATE = "Update/update";
|
||||
public final static String SET_APP_UNINSTALL_INFO = "App/appUnload";
|
||||
//根据包名获取更新
|
||||
public final static String GET_BANNER_IMG = "app/getBrand";
|
||||
public final static String GET_APP_UPDATE = "Update/update";
|
||||
//获取banner图
|
||||
public final static String GET_BANNER_IMG = "app/getBrand";
|
||||
public final static String GET_BANNER = "sn/getBanner";
|
||||
|
||||
|
||||
public final static String GET_ALL_PACKAGENAME = "App/allPackageSn";
|
||||
//获取所有应用包名
|
||||
public final static String GET_SUBClASSFY = "Application/getSubClassfy";
|
||||
public final static String GET_ALL_PACKAGENAME = "App/allPackageSn";
|
||||
//获取应用分类
|
||||
public final static String SEND_DOWNLOADAPP = "app/downloadApp";
|
||||
public final static String GET_SUBClASSFY = "Application/getSubClassfy";
|
||||
|
||||
public final static String GET_NEWESTAPPUPDATE = "app/newestAppUpdate";
|
||||
public final static String SEND_DOWNLOADAPP = "app/downloadApp";
|
||||
//根据包名获取更新
|
||||
public final static String GET_NEWESTAPPUPDATE = "app/newestAppUpdate";
|
||||
}
|
||||
|
||||
17
app/src/main/res/drawable/bg_hint.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="30dp"
|
||||
android:top="30dp"
|
||||
android:right="30dp"
|
||||
android:left="30dp"/>
|
||||
<corners
|
||||
android:topLeftRadius="24dp"
|
||||
android:topRightRadius="24dp"
|
||||
android:bottomLeftRadius="24dp"
|
||||
android:bottomRightRadius="24dp" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/bt_confirm.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="@color/default_color" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="12dp"
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp" />
|
||||
</shape>
|
||||
59
app/src/main/res/layout/activity_hint.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="440dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_hint"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="温馨提示"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/no_bind"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@drawable/bt_confirm"
|
||||
android:stateListAnimator="@null"
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_hint"
|
||||
app:layout_constraintHorizontal_bias="0.503"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_hint"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_hint"
|
||||
app:layout_constraintVertical_bias="1" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -3,5 +3,6 @@
|
||||
<string name="download_btn_had">打开</string>
|
||||
<string name="open_app_fail">打开失败!</string>
|
||||
<string name="search_edit">\t请输入应用名称或关键字</string>
|
||||
|
||||
<string name="no_bind">为了营造良好的学习环境,应用中心默认开启“守护模式“,由家长推送第三方应用下载。请家长在微信小程序搜索【教管壹云管控AI学习机】—选择应用设置下载。平板端会显示家长所选择的应用。</string>
|
||||
<string name="no_app">该设备暂时无白名单应用以供安装,请使用家长绑定账号推荐相关应用至平板应用市场!</string>
|
||||
</resources>
|
||||
|
||||
@@ -9,5 +9,23 @@
|
||||
<!-- <item name="fontPath">fonts/test.ttf</item>-->
|
||||
<!-- <item name="fontPath">fonts/SourceHanSansCN-ExtraLight.ttf</item>-->
|
||||
</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>
|
||||
|
||||