version:1.3.5
fix:增加展锐平台签名 add:
@@ -15,10 +15,10 @@ android {
|
|||||||
buildToolsVersion "29.0.3"
|
buildToolsVersion "29.0.3"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.appstore.uiui"
|
applicationId "com.appstore.uiui"
|
||||||
minSdkVersion 23
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 31
|
versionCode 35
|
||||||
versionName "1.3.1"
|
versionName "1.3.5"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
//极光
|
//极光
|
||||||
ndk {
|
ndk {
|
||||||
@@ -38,6 +38,14 @@ android {
|
|||||||
}
|
}
|
||||||
//签名
|
//签名
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
zhanRui {
|
||||||
|
storeFile file("src/keys/zhanxun.keystore")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "zhanxun"
|
||||||
|
keyPassword "123456"
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
|
}
|
||||||
debug {
|
debug {
|
||||||
storeFile file("src/keys/xueshibaoos.jks")
|
storeFile file("src/keys/xueshibaoos.jks")
|
||||||
storePassword "123456"
|
storePassword "123456"
|
||||||
@@ -55,9 +63,21 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
zhanRuiRelease.initWith(release)
|
||||||
|
zhanRuiRelease {
|
||||||
|
buildConfigField "String", "platform", '"ZhanRui"'
|
||||||
|
signingConfig signingConfigs.zhanRui
|
||||||
|
}
|
||||||
|
|
||||||
|
zhanRuiDebug.initWith(debug)
|
||||||
|
zhanRuiDebug {
|
||||||
|
versionNameSuffix "-debug"
|
||||||
|
buildConfigField "String", "platform", '"ZhanRui"'
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.zhanRui
|
||||||
|
}
|
||||||
debug {
|
debug {
|
||||||
// 显示Log
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
|
||||||
versionNameSuffix "-debug"
|
versionNameSuffix "-debug"
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
//Zipalign优化
|
//Zipalign优化
|
||||||
@@ -66,15 +86,14 @@ android {
|
|||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
def fileName = "${appName()}-V${defaultConfig.versionName}-${releaseTime()}.apk"
|
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||||
output.outputFileName = fileName
|
output.outputFileName = fileName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
// 不显示Log
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
|
||||||
//混淆
|
//混淆
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
//Zipalign优化
|
//Zipalign优化
|
||||||
@@ -88,9 +107,8 @@ android {
|
|||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
def outputFile = ""
|
def outputFile = ""
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
def fileName = "${appName()}-${defaultConfig.versionCode}-V${defaultConfig.versionName}-${releaseTime()}.apk"
|
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||||
output.outputFileName = new File(outputFile, fileName)
|
output.outputFileName = new File(outputFile, fileName)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
app/src/keys/zhanxun.keystore
Normal file
@@ -3,6 +3,8 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.appstore.uiui"
|
package="com.appstore.uiui"
|
||||||
android:sharedUserId="android.uid.system">
|
android:sharedUserId="android.uid.system">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
|
||||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
|
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
|
||||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||||
@@ -23,7 +25,7 @@
|
|||||||
<uses-permission android:name="com.appstore.uiui.permission.JPUSH_MESSAGE" />
|
<uses-permission android:name="com.appstore.uiui.permission.JPUSH_MESSAGE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MyApplication"
|
android:name=".base.BaseApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ public class AboutActivity extends BaseActivity {
|
|||||||
tv_copyright.setOnClickListener(new View.OnClickListener() {
|
tv_copyright.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
startActivity(new Intent(AboutActivity.this, CopyrightActivity.class));
|
// startActivity(new Intent(AboutActivity.this, CopyrightActivity.class));
|
||||||
|
Intent i = new Intent(Intent.ACTION_MAIN);
|
||||||
|
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
i.addCategory(Intent.CATEGORY_HOME);
|
||||||
|
startActivity(i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.HorizontalScrollView;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RatingBar;
|
import android.widget.RatingBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -20,12 +22,15 @@ import com.appstore.uiui.R;
|
|||||||
import com.appstore.uiui.adapter.ImageAdapter;
|
import com.appstore.uiui.adapter.ImageAdapter;
|
||||||
import com.appstore.uiui.base.BaseActivity;
|
import com.appstore.uiui.base.BaseActivity;
|
||||||
import com.appstore.uiui.bean.AppInfo;
|
import com.appstore.uiui.bean.AppInfo;
|
||||||
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
import com.appstore.uiui.bean.GlideCircleWithBorder;
|
import com.appstore.uiui.bean.GlideCircleWithBorder;
|
||||||
import com.appstore.uiui.helper.CustomSnapHelper;
|
import com.appstore.uiui.helper.CustomSnapHelper;
|
||||||
|
import com.appstore.uiui.network.NetInterfaceManager;
|
||||||
import com.appstore.uiui.utils.ApkUtils;
|
import com.appstore.uiui.utils.ApkUtils;
|
||||||
import com.appstore.uiui.utils.FileUtils;
|
import com.appstore.uiui.utils.FileUtils;
|
||||||
import com.appstore.uiui.utils.StorageUtils;
|
import com.appstore.uiui.utils.StorageUtils;
|
||||||
import com.appstore.uiui.utils.ToastUtil;
|
import com.appstore.uiui.utils.ToastUtil;
|
||||||
|
import com.appstore.uiui.utils.Utils;
|
||||||
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.download.DownloadEntity;
|
import com.arialyy.aria.core.download.DownloadEntity;
|
||||||
@@ -37,7 +42,15 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.Scheduler;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
public class DetailsActivity extends BaseActivity {
|
public class DetailsActivity extends BaseActivity {
|
||||||
|
private String TAG = DetailsActivity.class.getSimpleName();
|
||||||
|
|
||||||
private TextView tv_title, tv_name, tv_company, tv_update_time, tv_version, tv_content, detali_tv_size, detail_tv_Developers;
|
private TextView tv_title, tv_name, tv_company, tv_update_time, tv_version, tv_content, detali_tv_size, detail_tv_Developers;
|
||||||
private Button tv_download;
|
private Button tv_download;
|
||||||
private RatingBar rating_bar;
|
private RatingBar rating_bar;
|
||||||
@@ -46,6 +59,7 @@ public class DetailsActivity extends BaseActivity {
|
|||||||
private AppInfo appInfo;
|
private AppInfo appInfo;
|
||||||
private ImageAdapter imageAdapter;
|
private ImageAdapter imageAdapter;
|
||||||
private installReceiver myReceiver;
|
private installReceiver myReceiver;
|
||||||
|
private HorizontalScrollView scrollView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int setLayoutResourceID() {
|
protected int setLayoutResourceID() {
|
||||||
@@ -66,7 +80,7 @@ public class DetailsActivity extends BaseActivity {
|
|||||||
rv_image = findViewById(R.id.detail_rv_image);
|
rv_image = findViewById(R.id.detail_rv_image);
|
||||||
detali_tv_size = findViewById(R.id.detali_tv_size);
|
detali_tv_size = findViewById(R.id.detali_tv_size);
|
||||||
detail_tv_Developers = findViewById(R.id.detail_tv_Developers);
|
detail_tv_Developers = findViewById(R.id.detail_tv_Developers);
|
||||||
|
scrollView = findViewById(R.id.scrollView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -76,6 +90,8 @@ public class DetailsActivity extends BaseActivity {
|
|||||||
if (appInfo == null) {
|
if (appInfo == null) {
|
||||||
ToastUtil.show("获取引用信息失败,返回重试");
|
ToastUtil.show("获取引用信息失败,返回重试");
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
getPackageApp(appInfo.getApp_package(), appInfo.getApp_version_code());
|
||||||
}
|
}
|
||||||
// final DownloadTask downloadTask = OkDownload.getInstance().getTask(appInfo.getApp_url());
|
// final DownloadTask downloadTask = OkDownload.getInstance().getTask(appInfo.getApp_url());
|
||||||
// if (downloadTask != null) {
|
// if (downloadTask != null) {
|
||||||
@@ -93,16 +109,10 @@ public class DetailsActivity extends BaseActivity {
|
|||||||
rating_bar.setRating((float) appInfo.getApp_score());
|
rating_bar.setRating((float) appInfo.getApp_score());
|
||||||
Glide.with(this).asBitmap().load(appInfo.getApp_img()).transform(new GlideCircleWithBorder(this))
|
Glide.with(this).asBitmap().load(appInfo.getApp_img()).transform(new GlideCircleWithBorder(this))
|
||||||
.into(iv_icon);
|
.into(iv_icon);
|
||||||
List<String> list = new ArrayList<String>() {{
|
|
||||||
this.add(appInfo.getApp_preview1());
|
|
||||||
this.add(appInfo.getApp_preview2());
|
|
||||||
this.add(appInfo.getApp_preview3());
|
|
||||||
}};
|
|
||||||
imageAdapter = new ImageAdapter(list);
|
|
||||||
rv_image.setAdapter(imageAdapter);
|
|
||||||
rv_image.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
rv_image.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||||
CustomSnapHelper snapHelper = new CustomSnapHelper();
|
CustomSnapHelper snapHelper = new CustomSnapHelper();
|
||||||
snapHelper.attachToRecyclerView(rv_image);
|
snapHelper.attachToRecyclerView(rv_image);
|
||||||
|
setImage(appInfo);
|
||||||
final boolean installed = ApkUtils.isInstalled(DetailsActivity.this, appInfo.getApp_package());
|
final boolean installed = ApkUtils.isInstalled(DetailsActivity.this, appInfo.getApp_package());
|
||||||
final boolean update = ApkUtils.isUpdate(DetailsActivity.this, appInfo.getApp_package(), appInfo.getApp_version_code());
|
final boolean update = ApkUtils.isUpdate(DetailsActivity.this, appInfo.getApp_package(), appInfo.getApp_version_code());
|
||||||
if (installed) {
|
if (installed) {
|
||||||
@@ -163,6 +173,72 @@ public class DetailsActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setImage(final AppInfo info) {
|
||||||
|
List<String> list = new ArrayList<String>() {{
|
||||||
|
this.add(info.getApp_preview1());
|
||||||
|
this.add(info.getApp_preview2());
|
||||||
|
this.add(info.getApp_preview3());
|
||||||
|
}};
|
||||||
|
imageAdapter = new ImageAdapter();
|
||||||
|
imageAdapter.setData(list);
|
||||||
|
rv_image.setAdapter(imageAdapter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void getPackageApp(String packageName, long versionCode) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getQueryPackageAppControl()
|
||||||
|
.getPackageApp(packageName, versionCode)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG, "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<AppInfo> appInfoBaseResponse) {
|
||||||
|
if (appInfoBaseResponse.code == 200) {
|
||||||
|
AppInfo info = appInfoBaseResponse.data;
|
||||||
|
boolean haveImage = false;
|
||||||
|
if (!TextUtils.isEmpty(info.getApp_preview1())) {
|
||||||
|
appInfo.setApp_preview1(info.getApp_preview1());
|
||||||
|
haveImage = true;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(info.getApp_preview2())) {
|
||||||
|
appInfo.setApp_preview2(info.getApp_preview2());
|
||||||
|
haveImage = true;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(info.getApp_preview3())) {
|
||||||
|
appInfo.setApp_preview3(info.getApp_preview3());
|
||||||
|
haveImage = true;
|
||||||
|
}
|
||||||
|
appInfo.setApp_version_name(info.getApp_version_name());
|
||||||
|
if (haveImage) {
|
||||||
|
scrollView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
scrollView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
setImage(appInfo);
|
||||||
|
} else {
|
||||||
|
scrollView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e(TAG, "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e(TAG, "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void refresh(DownloadTask task) {
|
void refresh(DownloadTask task) {
|
||||||
if (appInfo.getApp_url().equals(task.getEntity().getUrl())) {
|
if (appInfo.getApp_url().equals(task.getEntity().getUrl())) {
|
||||||
switch (task.getState()) {
|
switch (task.getState()) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
@@ -19,6 +20,7 @@ import com.appstore.uiui.adapter.LocalAppAdapter;
|
|||||||
import com.appstore.uiui.base.BaseActivity;
|
import com.appstore.uiui.base.BaseActivity;
|
||||||
import com.appstore.uiui.base.RefreshManager;
|
import com.appstore.uiui.base.RefreshManager;
|
||||||
import com.appstore.uiui.bean.LocalApp;
|
import com.appstore.uiui.bean.LocalApp;
|
||||||
|
import com.appstore.uiui.utils.ApkUtils;
|
||||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||||
@@ -80,7 +82,7 @@ public class LocalManagerActivity extends BaseActivity implements RefreshManager
|
|||||||
Intent intent = new Intent(Intent.ACTION_MAIN, null);
|
Intent intent = new Intent(Intent.ACTION_MAIN, null);
|
||||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
List<ResolveInfo> resolveInfoList = getApplication().getPackageManager().queryIntentActivities(intent, 0);
|
List<ResolveInfo> resolveInfoList = getApplication().getPackageManager().queryIntentActivities(intent, 0);
|
||||||
|
String qch_force_app = Settings.System.getString(getContentResolver(), "qch_force_app");
|
||||||
for (int i = 0; i < resolveInfoList.size(); i++) {
|
for (int i = 0; i < resolveInfoList.size(); i++) {
|
||||||
LocalApp bean = new LocalApp();
|
LocalApp bean = new LocalApp();
|
||||||
bean.setAppName(resolveInfoList.get(i).loadLabel(getApplicationContext().getPackageManager()).toString());
|
bean.setAppName(resolveInfoList.get(i).loadLabel(getApplicationContext().getPackageManager()).toString());
|
||||||
@@ -88,10 +90,17 @@ public class LocalManagerActivity extends BaseActivity implements RefreshManager
|
|||||||
if (packageName.equals(getApplicationContext().getPackageName()) || packageName.equals("com.android.uiuios")) {
|
if (packageName.equals(getApplicationContext().getPackageName()) || packageName.equals("com.android.uiuios")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
bean.setPackageName(packageName);
|
bean.setPackageName(packageName);
|
||||||
Drawable icon = resolveInfoList.get(i).loadIcon(getApplicationContext().getPackageManager());
|
Drawable icon = resolveInfoList.get(i).loadIcon(getApplicationContext().getPackageManager());
|
||||||
bean.setIcon(icon);
|
bean.setIcon(icon);
|
||||||
|
if (qch_force_app.contains(packageName)){
|
||||||
|
bean.setCanUnintall(false);
|
||||||
|
}else {
|
||||||
|
bean.setCanUnintall(true);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
PackageInfo packageInfo = getApplicationContext().getPackageManager().getPackageInfo(packageName, 0);
|
PackageInfo packageInfo = getApplicationContext().getPackageManager().getPackageInfo(packageName, 0);
|
||||||
String versionCode = getApplicationContext().getPackageManager()
|
String versionCode = getApplicationContext().getPackageManager()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.appstore.uiui.fragment.ManageFragment;
|
|||||||
import com.appstore.uiui.jpush.ExampleUtil;
|
import com.appstore.uiui.jpush.ExampleUtil;
|
||||||
import com.appstore.uiui.jpush.LocalBroadcastManager;
|
import com.appstore.uiui.jpush.LocalBroadcastManager;
|
||||||
import com.appstore.uiui.jpush.TagAliasOperatorHelper;
|
import com.appstore.uiui.jpush.TagAliasOperatorHelper;
|
||||||
import com.appstore.uiui.network.NetWorkManager;
|
import com.appstore.uiui.network.NetInterfaceManager;
|
||||||
import com.appstore.uiui.network.api.QueryAllApp;
|
import com.appstore.uiui.network.api.QueryAllApp;
|
||||||
import com.appstore.uiui.network.api.SNInfo;
|
import com.appstore.uiui.network.api.SNInfo;
|
||||||
import com.appstore.uiui.service.GuardService;
|
import com.appstore.uiui.service.GuardService;
|
||||||
@@ -71,6 +71,7 @@ import static com.appstore.uiui.jpush.TagAliasOperatorHelper.TagAliasBean;
|
|||||||
import static com.appstore.uiui.jpush.TagAliasOperatorHelper.sequence;
|
import static com.appstore.uiui.jpush.TagAliasOperatorHelper.sequence;
|
||||||
|
|
||||||
public class MainActivity extends BaseActivity {
|
public class MainActivity extends BaseActivity {
|
||||||
|
private static final String TAG = MainActivity.class.getSimpleName();
|
||||||
private RelativeLayout search_layout;
|
private RelativeLayout search_layout;
|
||||||
private ImageView iv_download, iv_appicon;
|
private ImageView iv_download, iv_appicon;
|
||||||
private SlidingTabLayout mSlidingTabLayout;
|
private SlidingTabLayout mSlidingTabLayout;
|
||||||
@@ -82,7 +83,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Log.e("MainActivity", "onCreate");
|
Log.e(TAG, "onCreate");
|
||||||
requestPermission();
|
requestPermission();
|
||||||
registerMessageReceiver(); // used for receive msg
|
registerMessageReceiver(); // used for receive msg
|
||||||
String rid = JPushInterface.getRegistrationID(getApplicationContext());
|
String rid = JPushInterface.getRegistrationID(getApplicationContext());
|
||||||
@@ -119,13 +120,13 @@ public class MainActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
Log.e("MainActivity", "onConfigurationChanged");
|
Log.e(TAG, "onConfigurationChanged");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
Log.e("MainActivity", "onSaveInstanceState");
|
Log.e(TAG, "onSaveInstanceState");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -379,9 +380,6 @@ public class MainActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static final String TAG = "fanhuitong";
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
@@ -403,8 +401,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
|
|
||||||
|
|
||||||
synchronized private void getUserInfo() {
|
synchronized private void getUserInfo() {
|
||||||
final SNInfo userInfo = NetWorkManager.getuserInfoControl();
|
NetInterfaceManager.getInstance().getuserInfoControl().getUserinfo(Utils.getSerial())
|
||||||
userInfo.getUserinfo(Utils.getSerial())
|
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseResponse<UserInfo>>() {
|
.subscribe(new Observer<BaseResponse<UserInfo>>() {
|
||||||
@@ -443,8 +440,7 @@ public class MainActivity extends BaseActivity {
|
|||||||
|
|
||||||
|
|
||||||
private void getAllAppPackageName() {
|
private void getAllAppPackageName() {
|
||||||
QueryAllApp allApp = NetWorkManager.getQueryAllAppControl();
|
NetInterfaceManager.getInstance().getQueryAllAppControl().getAllApp(Utils.getSerial())
|
||||||
allApp.getAllApp(Utils.getSerial())
|
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
package com.appstore.uiui.activity;
|
package com.appstore.uiui.activity;
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.SearchView;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
@@ -15,17 +19,28 @@ import com.appstore.uiui.R;
|
|||||||
import com.appstore.uiui.adapter.AppAdapter;
|
import com.appstore.uiui.adapter.AppAdapter;
|
||||||
import com.appstore.uiui.base.BaseActivity;
|
import com.appstore.uiui.base.BaseActivity;
|
||||||
import com.appstore.uiui.bean.AppInfo;
|
import com.appstore.uiui.bean.AppInfo;
|
||||||
import com.appstore.uiui.utils.LogUtils;
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
|
import com.appstore.uiui.network.NetInterfaceManager;
|
||||||
|
import com.appstore.uiui.network.api.QueryAllApp;
|
||||||
|
import com.appstore.uiui.network.api.SearchApp;
|
||||||
|
import com.appstore.uiui.utils.Utils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
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 SearcherActivity extends BaseActivity {
|
public class SearcherActivity extends BaseActivity {
|
||||||
private SearchView search;
|
private String TAG = SearcherActivity.class.getSimpleName();
|
||||||
|
// private SearchView search;
|
||||||
private List<AppInfo> mAppInfoList = new ArrayList<>();
|
private List<AppInfo> mAppInfoList = new ArrayList<>();
|
||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
private AppAdapter madapter;
|
private AppAdapter madapter;
|
||||||
|
private EditText edit_search;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int setLayoutResourceID() {
|
protected int setLayoutResourceID() {
|
||||||
@@ -35,11 +50,15 @@ public class SearcherActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
search = findViewById(R.id.search);
|
// search = findViewById(R.id.search);
|
||||||
// int id = search.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
|
// int id = search.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
|
||||||
TextView textView = search.findViewById(androidx.appcompat.R.id.search_src_text);
|
// TextView textView = search.findViewById(androidx.appcompat.R.id.search_src_text);
|
||||||
textView.setTextColor(Color.BLACK);
|
// textView.setTextColor(Color.BLACK);
|
||||||
textView.setHintTextColor(Color.GRAY);//提示字体颜色**
|
// textView.setHintTextColor(Color.GRAY);//提示字体颜色**
|
||||||
|
edit_search = findViewById(R.id.edit_search);
|
||||||
|
edit_search.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
||||||
|
edit_search.setInputType(EditorInfo.TYPE_CLASS_TEXT);
|
||||||
|
|
||||||
recyclerView = findViewById(R.id.recyclerView);
|
recyclerView = findViewById(R.id.recyclerView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,23 +72,113 @@ public class SearcherActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setListener() {
|
protected void setListener() {
|
||||||
search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
// search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
|
// @Override
|
||||||
|
// public boolean onQueryTextSubmit(String query) {
|
||||||
|
// LogUtils.e("icon_serach", query);
|
||||||
|
//// OKGO.searchAppbyName(handler, query);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean onQueryTextChange(String newText) {
|
||||||
|
// madapter.setData(new ArrayList<AppInfo>());
|
||||||
|
// madapter.notifyDataSetChanged();
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
edit_search.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
LogUtils.e("icon_serach", query);
|
if (actionId == EditorInfo.IME_ACTION_SEND || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
||||||
// OKGO.searchAppbyName(handler, query);
|
//do something;
|
||||||
return false;
|
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE))
|
||||||
|
.hideSoftInputFromWindow(SearcherActivity.this.getCurrentFocus()
|
||||||
|
.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
|
String text = edit_search.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(text)) {
|
||||||
|
getAllAppPackageName();
|
||||||
|
} else {
|
||||||
|
searcheApp(text);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onQueryTextChange(String newText) {
|
|
||||||
madapter.setData(new ArrayList<AppInfo>());
|
|
||||||
madapter.notifyDataSetChanged();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void searcheApp(String text) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getSearchAppControl()
|
||||||
|
.getApp(Utils.getSerial(), text)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||||
|
if (listBaseResponse.code == 200) {
|
||||||
|
List<AppInfo> appInfos = listBaseResponse.data;
|
||||||
|
if (appInfos != null && appInfos.size() > 0) {
|
||||||
|
madapter.setData(listBaseResponse.data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
madapter.setData(new ArrayList<AppInfo>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getAllAppPackageName() {
|
||||||
|
NetInterfaceManager.getInstance().getQueryAllAppControl().getAllApp(Utils.getSerial())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e(TAG, "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||||
|
if (listBaseResponse.code == 200) {
|
||||||
|
List<AppInfo> appInfos = listBaseResponse.data;
|
||||||
|
if (appInfos != null && appInfos.size() > 0) {
|
||||||
|
madapter.setData(listBaseResponse.data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
madapter.setData(new ArrayList<AppInfo>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finish(View view) {
|
public void finish(View view) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,16 +84,16 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.Holder> {
|
|||||||
if (installed) {
|
if (installed) {
|
||||||
if (update) {
|
if (update) {
|
||||||
holder.btnDownLoad.setText("更新");
|
holder.btnDownLoad.setText("更新");
|
||||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.default_color));
|
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.default_text_color));
|
||||||
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_shap_download));
|
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_shap_download));
|
||||||
} else {
|
} else {
|
||||||
holder.btnDownLoad.setText("打开");
|
holder.btnDownLoad.setText("打开");
|
||||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.default_color));
|
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.white));
|
||||||
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_shap_download));
|
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_shap_open));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
holder.btnDownLoad.setText("安装");
|
holder.btnDownLoad.setText("安装");
|
||||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.default_color));
|
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.default_text_color));
|
||||||
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_shap_download));
|
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_shap_download));
|
||||||
if (null != mDownloadTask) {
|
if (null != mDownloadTask) {
|
||||||
if (mDownloadTask.getKey().equals(appInfo.getApp_url())) {
|
if (mDownloadTask.getKey().equals(appInfo.getApp_url())) {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ImageViewHol
|
|||||||
private List<String> mSrcList;
|
private List<String> mSrcList;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
|
public ImageAdapter() {
|
||||||
|
}
|
||||||
|
|
||||||
public ImageAdapter(List<String> mSrcList) {
|
public ImageAdapter(List<String> mSrcList) {
|
||||||
this.mSrcList = mSrcList;
|
this.mSrcList = mSrcList;
|
||||||
@@ -44,6 +46,11 @@ public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ImageViewHol
|
|||||||
return mSrcList.size();
|
return mSrcList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setData(List<String> data) {
|
||||||
|
this.mSrcList = data;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
static class ImageViewHolder extends RecyclerView.ViewHolder {
|
static class ImageViewHolder extends RecyclerView.ViewHolder {
|
||||||
ImageView imageView;
|
ImageView imageView;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package com.appstore.uiui.adapter;
|
package com.appstore.uiui.adapter;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.net.Uri;
|
|
||||||
import android.text.format.Formatter;
|
import android.text.format.Formatter;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -14,11 +11,9 @@ import android.widget.Button;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.cardview.widget.CardView;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.appstore.uiui.R;
|
import com.appstore.uiui.R;
|
||||||
import com.appstore.uiui.bean.AppInfo;
|
|
||||||
import com.appstore.uiui.bean.GlideCircleWithBorder;
|
import com.appstore.uiui.bean.GlideCircleWithBorder;
|
||||||
import com.appstore.uiui.bean.LocalApp;
|
import com.appstore.uiui.bean.LocalApp;
|
||||||
import com.appstore.uiui.utils.ApkUtils;
|
import com.appstore.uiui.utils.ApkUtils;
|
||||||
@@ -60,12 +55,23 @@ public class LocalAppAdapter extends RecyclerView.Adapter<LocalAppAdapter.LocalA
|
|||||||
holder.tvCompany.setText(localApp.getCompany());
|
holder.tvCompany.setText(localApp.getCompany());
|
||||||
holder.tvName.setText(localApp.getAppName());
|
holder.tvName.setText(localApp.getAppName());
|
||||||
holder.tvVersion.setText(localApp.getVersion());
|
holder.tvVersion.setText(localApp.getVersion());
|
||||||
|
if (localApp.isCanUnintall()) {
|
||||||
|
holder.btnDownLoad.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.btnDownLoad.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
holder.btnDownLoad.setOnClickListener(new View.OnClickListener() {
|
holder.btnDownLoad.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
ApkUtils.Uninstall(context, localApp.getPackageName());
|
ApkUtils.Uninstall(context, localApp.getPackageName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
holder.btnOpen.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
ApkUtils.openApp(context, localApp.getPackageName());
|
||||||
|
}
|
||||||
|
});
|
||||||
String totalLength = Formatter.formatFileSize(context, localApp.getSize());
|
String totalLength = Formatter.formatFileSize(context, localApp.getSize());
|
||||||
holder.tvCompany.setText(totalLength);
|
holder.tvCompany.setText(totalLength);
|
||||||
|
|
||||||
@@ -85,7 +91,7 @@ public class LocalAppAdapter extends RecyclerView.Adapter<LocalAppAdapter.LocalA
|
|||||||
ImageView ivIcon;
|
ImageView ivIcon;
|
||||||
TextView tvCompany, tvName, tvVersion;
|
TextView tvCompany, tvName, tvVersion;
|
||||||
TextView tvUpdate;
|
TextView tvUpdate;
|
||||||
Button btnDownLoad;
|
Button btnDownLoad, btnOpen;
|
||||||
|
|
||||||
public LocalAppViewHolder(View itemView) {
|
public LocalAppViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@@ -94,7 +100,8 @@ public class LocalAppAdapter extends RecyclerView.Adapter<LocalAppAdapter.LocalA
|
|||||||
tvName = itemView.findViewById(R.id.local_app_tv_name);
|
tvName = itemView.findViewById(R.id.local_app_tv_name);
|
||||||
tvVersion = itemView.findViewById(R.id.local_app_version);
|
tvVersion = itemView.findViewById(R.id.local_app_version);
|
||||||
tvUpdate = itemView.findViewById(R.id.local_app_update);
|
tvUpdate = itemView.findViewById(R.id.local_app_update);
|
||||||
btnDownLoad = itemView.findViewById(R.id.local_app_btn_download);
|
btnDownLoad = itemView.findViewById(R.id.local_app_btn_delete);
|
||||||
|
btnOpen = itemView.findViewById(R.id.local_app_btn_open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class UpdateAppAdapter extends RecyclerView.Adapter<UpdateAppAdapter.Upda
|
|||||||
holder.tvVersion.setText(appInfo.getVersionName() + "->" + appInfo.getNewVersionName());
|
holder.tvVersion.setText(appInfo.getVersionName() + "->" + appInfo.getNewVersionName());
|
||||||
holder.btnDownLoad.setText("更新");
|
holder.btnDownLoad.setText("更新");
|
||||||
holder.btnDownLoad.setTextColor(context.getColor(R.color.red));
|
holder.btnDownLoad.setTextColor(context.getColor(R.color.red));
|
||||||
holder.btnDownLoad.setBackground(context.getDrawable(R.drawable.btn_style_none));
|
holder.btnDownLoad.setBackground(context.getDrawable(R.drawable.btn_shap_open));
|
||||||
holder.btnDownLoad.setOnClickListener(new View.OnClickListener() {
|
holder.btnDownLoad.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -96,7 +96,7 @@ public class UpdateAppAdapter extends RecyclerView.Adapter<UpdateAppAdapter.Upda
|
|||||||
tvName = itemView.findViewById(R.id.local_app_tv_name);
|
tvName = itemView.findViewById(R.id.local_app_tv_name);
|
||||||
tvVersion = itemView.findViewById(R.id.local_app_version);
|
tvVersion = itemView.findViewById(R.id.local_app_version);
|
||||||
tvUpdate = itemView.findViewById(R.id.local_app_update);
|
tvUpdate = itemView.findViewById(R.id.local_app_update);
|
||||||
btnDownLoad = itemView.findViewById(R.id.local_app_btn_download);
|
btnDownLoad = itemView.findViewById(R.id.local_app_btn_delete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bind() {
|
public void bind() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.appstore.uiui;
|
package com.appstore.uiui.base;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -12,8 +12,11 @@ import android.provider.Settings;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.appstore.uiui.R;
|
||||||
import com.appstore.uiui.jpush.Logger;
|
import com.appstore.uiui.jpush.Logger;
|
||||||
|
import com.appstore.uiui.network.NetInterfaceManager;
|
||||||
import com.appstore.uiui.receiver.AppManagerReceiver;
|
import com.appstore.uiui.receiver.AppManagerReceiver;
|
||||||
|
import com.appstore.uiui.utils.JGYUtils;
|
||||||
import com.appstore.uiui.utils.LogUtils;
|
import com.appstore.uiui.utils.LogUtils;
|
||||||
import com.appstore.uiui.utils.ToastUtil;
|
import com.appstore.uiui.utils.ToastUtil;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
@@ -36,13 +39,13 @@ import cn.jpush.android.api.JPushInterface;
|
|||||||
* Created by asus on 2017/10/27.
|
* Created by asus on 2017/10/27.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MyApplication extends Application {
|
public class BaseApplication extends Application {
|
||||||
private static final String TAG = "JIGUANG-Example";
|
private static final String TAG = "JIGUANG-Example";
|
||||||
|
|
||||||
|
|
||||||
private static MyApplication app;
|
private static BaseApplication app;
|
||||||
|
|
||||||
public static MyApplication getInstance() {
|
public static BaseApplication getInstance() {
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +56,7 @@ public class MyApplication extends Application {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull RefreshLayout layout) {
|
public RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull RefreshLayout layout) {
|
||||||
layout.setPrimaryColorsId(R.color.download, R.color.default_color);//全局设置主题颜色
|
layout.setPrimaryColorsId(R.color.download, R.color.default_text_color);//全局设置主题颜色
|
||||||
return new ClassicsHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
return new ClassicsHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -78,7 +81,7 @@ public class MyApplication extends Application {
|
|||||||
// OkGo.getInstance().init(this)
|
// OkGo.getInstance().init(this)
|
||||||
// .setRetryCount(10)//重试次数
|
// .setRetryCount(10)//重试次数
|
||||||
// ;
|
// ;
|
||||||
|
JGYUtils.init(this);
|
||||||
Aria.init(this);
|
Aria.init(this);
|
||||||
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||||
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
||||||
@@ -96,6 +99,7 @@ public class MyApplication extends Application {
|
|||||||
// .build()
|
// .build()
|
||||||
// );
|
// );
|
||||||
registAppReceive();
|
registAppReceive();
|
||||||
|
NetInterfaceManager.init(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppManagerReceiver mAppManagerReceiver;
|
private AppManagerReceiver mAppManagerReceiver;
|
||||||
@@ -7,7 +7,7 @@ public class AppInfo implements Serializable {
|
|||||||
private String app_name;
|
private String app_name;
|
||||||
private String app_package;
|
private String app_package;
|
||||||
private String app_version_name;
|
private String app_version_name;
|
||||||
private int app_version_code;
|
private long app_version_code;
|
||||||
private long app_size;
|
private long app_size;
|
||||||
private String app_desc;
|
private String app_desc;
|
||||||
private String app_url;
|
private String app_url;
|
||||||
@@ -60,11 +60,11 @@ public class AppInfo implements Serializable {
|
|||||||
this.app_version_name = app_version_name;
|
this.app_version_name = app_version_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getApp_version_code() {
|
public long getApp_version_code() {
|
||||||
return app_version_code;
|
return app_version_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setApp_version_code(int app_version_code) {
|
public void setApp_version_code(long app_version_code) {
|
||||||
this.app_version_code = app_version_code;
|
this.app_version_code = app_version_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
26
app/src/main/java/com/appstore/uiui/bean/Banner.java
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
package com.appstore.uiui.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class Banner implements Serializable {
|
||||||
|
private static final long serialVersionUID = 7293116155788824676L;
|
||||||
|
|
||||||
|
private String banner_name;
|
||||||
|
private String banner_img;
|
||||||
|
|
||||||
|
public String getBanner_name() {
|
||||||
|
return banner_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBanner_name(String banner_name) {
|
||||||
|
this.banner_name = banner_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBanner_img() {
|
||||||
|
return banner_img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBanner_img(String banner_img) {
|
||||||
|
this.banner_img = banner_img;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package com.appstore.uiui.bean;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class bannerImage implements Serializable {
|
public class BannerImage implements Serializable {
|
||||||
String title;
|
String title;
|
||||||
String id;
|
String id;
|
||||||
String desc;
|
String desc;
|
||||||
@@ -2,20 +2,24 @@ package com.appstore.uiui.bean;
|
|||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by asus on 2017/10/26.
|
* Created by asus on 2017/10/26.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class LocalApp {
|
public class LocalApp implements Serializable {
|
||||||
|
private static final long serialVersionUID = -9160249766709133844L;
|
||||||
|
|
||||||
String appName;//名字
|
private String appName;//名字
|
||||||
Drawable icon;//图片
|
private Drawable icon;//图片
|
||||||
String company;//公司
|
private String company;//公司
|
||||||
int size;//软件的大小
|
private int size;//软件的大小
|
||||||
String version;//软件的版本号
|
private String version;//软件的版本号
|
||||||
String packageName;//软件的包名
|
private String packageName;//软件的包名
|
||||||
int versionCode;
|
private int versionCode;
|
||||||
boolean isNeedUpdate = false;
|
private boolean isNeedUpdate = false;
|
||||||
|
private boolean canUnintall = true;
|
||||||
|
|
||||||
public LocalApp() {
|
public LocalApp() {
|
||||||
}
|
}
|
||||||
@@ -84,4 +88,12 @@ public class LocalApp {
|
|||||||
public void setPackageName(String packageName) {
|
public void setPackageName(String packageName) {
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCanUnintall() {
|
||||||
|
return canUnintall;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCanUnintall(boolean canUnintall) {
|
||||||
|
this.canUnintall = canUnintall;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public class UpdateAppInfo implements Serializable {
|
|||||||
private String appName;
|
private String appName;
|
||||||
private String packageName;
|
private String packageName;
|
||||||
private int versionCode;
|
private int versionCode;
|
||||||
private int newVersionCode;
|
private long newVersionCode;
|
||||||
private String newVersionName;
|
private String newVersionName;
|
||||||
private String versionName;
|
private String versionName;
|
||||||
private String URL;
|
private String URL;
|
||||||
@@ -40,11 +40,11 @@ public class UpdateAppInfo implements Serializable {
|
|||||||
this.versionCode = versionCode;
|
this.versionCode = versionCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNewVersionCode() {
|
public long getNewVersionCode() {
|
||||||
return newVersionCode;
|
return newVersionCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNewVersionCode(int newVersionCode) {
|
public void setNewVersionCode(long newVersionCode) {
|
||||||
this.newVersionCode = newVersionCode;
|
this.newVersionCode = newVersionCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,15 @@ import com.appstore.uiui.base.LazyLoadFragment;
|
|||||||
import com.appstore.uiui.base.RefreshManager;
|
import com.appstore.uiui.base.RefreshManager;
|
||||||
import com.appstore.uiui.bean.AppInfo;
|
import com.appstore.uiui.bean.AppInfo;
|
||||||
import com.appstore.uiui.bean.AppInfos;
|
import com.appstore.uiui.bean.AppInfos;
|
||||||
|
import com.appstore.uiui.bean.Banner;
|
||||||
import com.appstore.uiui.bean.BaseResponse;
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
import com.appstore.uiui.bean.ImageUrl;
|
import com.appstore.uiui.bean.ImageUrl;
|
||||||
import com.appstore.uiui.network.NetWorkManager;
|
import com.appstore.uiui.network.NetInterfaceManager;
|
||||||
import com.appstore.uiui.network.api.BannerImage;
|
import com.appstore.uiui.network.api.BannerImage;
|
||||||
import com.appstore.uiui.network.api.QueryAllApp;
|
import com.appstore.uiui.network.api.QueryAllApp;
|
||||||
import com.appstore.uiui.utils.LogUtils;
|
import com.appstore.uiui.utils.LogUtils;
|
||||||
import com.appstore.uiui.utils.Utils;
|
import com.appstore.uiui.utils.Utils;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||||
@@ -56,10 +58,12 @@ import io.reactivex.schedulers.Schedulers;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class FeaturedFragment extends LazyLoadFragment implements RefreshManager.RefreshInterface {
|
public class FeaturedFragment extends LazyLoadFragment implements RefreshManager.RefreshInterface {
|
||||||
|
private String TAG = FeaturedFragment.class.getSimpleName();
|
||||||
|
|
||||||
private RecyclerView mRvResult;
|
private RecyclerView mRvResult;
|
||||||
private SmartRefreshLayout mRefreshLayout;
|
private SmartRefreshLayout mRefreshLayout;
|
||||||
private BannerViewPager<String, BannerViewHolder> mViewPager;
|
private BannerViewPager<String, BannerViewHolder> mViewPager;
|
||||||
private ImageView imageView;
|
private ImageView imageView, iv_banner;
|
||||||
private List<AppInfos> appInfoList;//
|
private List<AppInfos> appInfoList;//
|
||||||
private List<AppInfo> newAppInfoList = new ArrayList<>();
|
private List<AppInfo> newAppInfoList = new ArrayList<>();
|
||||||
private AppAdapter adapter;
|
private AppAdapter adapter;
|
||||||
@@ -68,7 +72,6 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
|
|
||||||
private installReceiver myReceiver;
|
private installReceiver myReceiver;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private String TAG = "FeaturedFragment";
|
|
||||||
|
|
||||||
public FeaturedFragment() {
|
public FeaturedFragment() {
|
||||||
|
|
||||||
@@ -159,6 +162,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
((SimpleItemAnimator) mRvResult.getItemAnimator()).setSupportsChangeAnimations(false);
|
((SimpleItemAnimator) mRvResult.getItemAnimator()).setSupportsChangeAnimations(false);
|
||||||
// mRvResult.setItemAnimator(null);
|
// mRvResult.setItemAnimator(null);
|
||||||
imageView = view.findViewById(R.id.imageView);
|
imageView = view.findViewById(R.id.imageView);
|
||||||
|
iv_banner = view.findViewById(R.id.iv_banner);
|
||||||
mRefreshLayout = view.findViewById(R.id.featured_refresh_layout);
|
mRefreshLayout = view.findViewById(R.id.featured_refresh_layout);
|
||||||
RefreshManager.getInstance().register(this);
|
RefreshManager.getInstance().register(this);
|
||||||
mViewPager = view.findViewById(R.id.banner_view);
|
mViewPager = view.findViewById(R.id.banner_view);
|
||||||
@@ -193,9 +197,43 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
// OKGO.getAllAppInfo(handler);
|
// OKGO.getAllAppInfo(handler);
|
||||||
getAllAppInfo();
|
getAllAppInfo();
|
||||||
// OKGO.getBannerImg(handler);
|
// OKGO.getBannerImg(handler);
|
||||||
getBannerImg();
|
// getBannerImg();
|
||||||
|
getBanner();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getBanner() {
|
||||||
|
NetInterfaceManager.getInstance().getBannerObservable()
|
||||||
|
.subscribe(new Observer<BaseResponse<Banner>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e("getBanner", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<Banner> bannerBaseResponse) {
|
||||||
|
Log.e("getBanner", "onNext: ");
|
||||||
|
if (bannerBaseResponse.code == 200) {
|
||||||
|
String imgURL = bannerBaseResponse.data.getBanner_img();
|
||||||
|
Glide.with(iv_banner).load(imgURL).into(iv_banner);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("getBanner", "onError: " + e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getBanner", "onComplete: ");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
@@ -208,8 +246,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
|
|
||||||
|
|
||||||
private void getAllAppInfo() {
|
private void getAllAppInfo() {
|
||||||
QueryAllApp allApp = NetWorkManager.getQueryAllAppControl();
|
NetInterfaceManager.getInstance().getQueryAllAppControl().getAllApp(Utils.getSerial())
|
||||||
allApp.getAllApp(Utils.getSerial())
|
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||||
@@ -237,6 +274,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
Log.e("getAllAppInfo", "onError: " + e.getMessage());
|
Log.e("getAllAppInfo", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -247,14 +285,15 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void getBannerImg() {
|
private void getBannerImg() {
|
||||||
BannerImage bannerImage = NetWorkManager.getBannerImageControl();
|
NetInterfaceManager.getInstance()
|
||||||
bannerImage.getImageURL(Utils.getSerial())
|
.getBannerImageControl()
|
||||||
|
.getImageURL(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseResponse<List<ImageUrl>>>() {
|
.subscribe(new Observer<BaseResponse<List<ImageUrl>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("getBannerImg", "onSubscribe: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -262,7 +301,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
int code = listBaseResponse.code;
|
int code = listBaseResponse.code;
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
List<ImageUrl> urlList = listBaseResponse.data;
|
List<ImageUrl> urlList = listBaseResponse.data;
|
||||||
if (null != urlList || urlList.size() != 0) {
|
if (null != urlList && urlList.size() != 0) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
for (ImageUrl url : urlList) {
|
for (ImageUrl url : urlList) {
|
||||||
list.add(url.getImg_url());
|
list.add(url.getImg_url());
|
||||||
@@ -286,17 +325,30 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
|||||||
})
|
})
|
||||||
.setInterval(5000)
|
.setInterval(5000)
|
||||||
.create(list);
|
.create(list);
|
||||||
|
mViewPager.setVisibility(View.VISIBLE);
|
||||||
|
iv_banner.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
iv_banner.setVisibility(View.VISIBLE);
|
||||||
|
mViewPager.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
iv_banner.setVisibility(View.VISIBLE);
|
||||||
|
mViewPager.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
Log.e("getBannerImg", "onError: " + e.getMessage());
|
Log.e("getBannerImg", "onError: " + e.getMessage());
|
||||||
|
iv_banner.setVisibility(View.VISIBLE);
|
||||||
|
mViewPager.setVisibility(View.GONE);
|
||||||
|
onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
Log.e("getBannerImg", "onComplete: ");
|
||||||
mRefreshLayout.finishRefresh();
|
mRefreshLayout.finishRefresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -29,6 +30,7 @@ import com.appstore.uiui.bean.UpdateAppInfo;
|
|||||||
import com.appstore.uiui.utils.ApkUtils;
|
import com.appstore.uiui.utils.ApkUtils;
|
||||||
import com.appstore.uiui.utils.ToastUtil;
|
import com.appstore.uiui.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ public class ManageFragment extends LazyLoadFragment {
|
|||||||
|
|
||||||
private RecyclerView mRvLocal;
|
private RecyclerView mRvLocal;
|
||||||
private ImageView iv_nodata;
|
private ImageView iv_nodata;
|
||||||
private TextView manage_tv_updateNum;
|
private TextView manage_tv_updateNum, manage_tv_appNum;
|
||||||
private List<LocalApp> localAppList;
|
private List<LocalApp> localAppList;
|
||||||
private List<UpdateAppInfo> updateAppInfoList;
|
private List<UpdateAppInfo> updateAppInfoList;
|
||||||
private List<AppInfo> applist;
|
private List<AppInfo> applist;
|
||||||
@@ -59,6 +61,7 @@ public class ManageFragment extends LazyLoadFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void initViews(View view) {
|
public void initViews(View view) {
|
||||||
manage_tv_updateNum = view.findViewById(R.id.manage_tv_updateNum);
|
manage_tv_updateNum = view.findViewById(R.id.manage_tv_updateNum);
|
||||||
|
manage_tv_appNum = view.findViewById(R.id.manage_tv_appNum);
|
||||||
manage_cl_localapp = view.findViewById(R.id.manage_cl_localapp);
|
manage_cl_localapp = view.findViewById(R.id.manage_cl_localapp);
|
||||||
manage_cl_localapp.setOnClickListener(new View.OnClickListener() {
|
manage_cl_localapp.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -99,6 +102,11 @@ public class ManageFragment extends LazyLoadFragment {
|
|||||||
super.onStart();
|
super.onStart();
|
||||||
mContext = getActivity();
|
mContext = getActivity();
|
||||||
initAPPData(handler);
|
initAPPData(handler);
|
||||||
|
List<LocalApp> localApps = getLocalApp();
|
||||||
|
if (localApps != null && localApps.size() > 0) {
|
||||||
|
manage_tv_appNum.setText(localApps.size() + "");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized private void initAPPData(final Handler handler) {
|
synchronized private void initAPPData(final Handler handler) {
|
||||||
@@ -118,7 +126,12 @@ public class ManageFragment extends LazyLoadFragment {
|
|||||||
bean.setPackageName(packageName);
|
bean.setPackageName(packageName);
|
||||||
Drawable icon = resolveInfoList.get(i).loadIcon(mContext.getPackageManager());
|
Drawable icon = resolveInfoList.get(i).loadIcon(mContext.getPackageManager());
|
||||||
bean.setIcon(icon);
|
bean.setIcon(icon);
|
||||||
|
if (packageName.equals(mContext.getPackageName()) || packageName.equals("com.android.uiuios")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
PackageInfo packageInfo = mContext.getPackageManager().getPackageInfo(packageName, 0);
|
PackageInfo packageInfo = mContext.getPackageManager().getPackageInfo(packageName, 0);
|
||||||
String versionCode = mContext.getPackageManager()
|
String versionCode = mContext.getPackageManager()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.appstore.uiui.jpush;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.appstore.uiui.MyApplication;
|
import com.appstore.uiui.base.BaseApplication;
|
||||||
|
|
||||||
import cn.jpush.android.api.CustomMessage;
|
import cn.jpush.android.api.CustomMessage;
|
||||||
import cn.jpush.android.api.JPushMessage;
|
import cn.jpush.android.api.JPushMessage;
|
||||||
@@ -39,6 +39,6 @@ public class MyJPushMessageReceiver extends JPushMessageReceiver {
|
|||||||
@Override
|
@Override
|
||||||
public void onMessage(Context context, CustomMessage customMessage) {
|
public void onMessage(Context context, CustomMessage customMessage) {
|
||||||
super.onMessage(context, customMessage);
|
super.onMessage(context, customMessage);
|
||||||
MyApplication.getInstance().manageCustomMessage(customMessage);
|
BaseApplication.getInstance().manageCustomMessage(customMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,29 +4,16 @@ import android.content.Context;
|
|||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.appstore.uiui.BuildConfig;
|
import com.appstore.uiui.BuildConfig;
|
||||||
import com.appstore.uiui.TextCode.MessageWhat;
|
|
||||||
import com.appstore.uiui.bean.AppInfo;
|
import com.appstore.uiui.bean.AppInfo;
|
||||||
import com.appstore.uiui.bean.BaseResponse;
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
import com.appstore.uiui.bean.bannerImage;
|
|
||||||
import com.appstore.uiui.network.URLs.UrlAddress;
|
|
||||||
import com.appstore.uiui.network.api.NewestAppUpdate;
|
import com.appstore.uiui.network.api.NewestAppUpdate;
|
||||||
import com.appstore.uiui.network.api.SNInfo;
|
|
||||||
import com.appstore.uiui.utils.FileUtils;
|
import com.appstore.uiui.utils.FileUtils;
|
||||||
import com.appstore.uiui.utils.LogUtils;
|
import com.appstore.uiui.utils.JGYUtils;
|
||||||
import com.appstore.uiui.utils.SPUtils;
|
|
||||||
import com.appstore.uiui.utils.ToastUtil;
|
|
||||||
import com.appstore.uiui.utils.Utils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
@@ -42,8 +29,9 @@ public class HTTPInterface {
|
|||||||
|
|
||||||
|
|
||||||
public static void checkUpdate(final Context context, String packageName, String versionCode) {
|
public static void checkUpdate(final Context context, String packageName, String versionCode) {
|
||||||
NewestAppUpdate newestAppUpdate = NetWorkManager.getNewestAppUpdateControl();
|
NetInterfaceManager.getInstance()
|
||||||
newestAppUpdate.getAppUpdate(packageName, versionCode)
|
.getNewestAppUpdateControl()
|
||||||
|
.getAppUpdate(packageName, versionCode, JGYUtils.getInstance().checkAppPlatform())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.appstore.uiui.network;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Environment;
|
||||||
|
|
||||||
|
import com.appstore.uiui.bean.Banner;
|
||||||
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
|
import com.appstore.uiui.network.URLs.UrlAddress;
|
||||||
|
import com.appstore.uiui.network.api.BannerImage;
|
||||||
|
import com.appstore.uiui.network.api.DownloadApp;
|
||||||
|
import com.appstore.uiui.network.api.GetBanner;
|
||||||
|
import com.appstore.uiui.network.api.NewestAppUpdate;
|
||||||
|
import com.appstore.uiui.network.api.QueryAllApp;
|
||||||
|
import com.appstore.uiui.network.api.SNInfo;
|
||||||
|
import com.appstore.uiui.network.api.SearchApp;
|
||||||
|
import com.appstore.uiui.network.api.QueryPackageApp;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import io.reactivex.Scheduler;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.Cache;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import retrofit2.CallAdapter;
|
||||||
|
import retrofit2.Converter;
|
||||||
|
import retrofit2.Retrofit;
|
||||||
|
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||||
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
|
|
||||||
|
public class NetInterfaceManager {
|
||||||
|
private static NetInterfaceManager sInstance;
|
||||||
|
private Context mContext;
|
||||||
|
private static Retrofit mRetrofit;
|
||||||
|
|
||||||
|
public static final String ROOT_URL = UrlAddress.ROOT_URL;
|
||||||
|
public static final String HTTP_KEY = "YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=";
|
||||||
|
|
||||||
|
private NetInterfaceManager(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
if (null == mRetrofit) {
|
||||||
|
mRetrofit = new Retrofit.Builder()
|
||||||
|
.client(OK_HTTP_CLIENT)
|
||||||
|
.baseUrl(ROOT_URL)
|
||||||
|
.addConverterFactory(gsonConverterFactory)
|
||||||
|
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
if (sInstance == null) {
|
||||||
|
sInstance = new NetInterfaceManager(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static NetInterfaceManager getInstance() {
|
||||||
|
if (sInstance == null) {
|
||||||
|
throw new IllegalStateException("You must be init NetworkManager first");
|
||||||
|
}
|
||||||
|
return sInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final long cacheSize = 1024 * 1024 * 32;// 缓存文件最大限制大小20M
|
||||||
|
private static String cacheDirectory = Environment.getExternalStorageDirectory() + "/okttpcaches"; // 设置缓存文件路径
|
||||||
|
private static Cache cache = new Cache(new File(cacheDirectory), cacheSize); //
|
||||||
|
private static final OkHttpClient OK_HTTP_CLIENT;
|
||||||
|
private static final int timeOut = 5;
|
||||||
|
|
||||||
|
static {
|
||||||
|
//如果无法生存缓存文件目录,检测权限使用已经加上,检测手机是否把文件读写权限禁止了
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
builder.connectTimeout(timeOut, TimeUnit.SECONDS); // 设置连接超时时间
|
||||||
|
builder.writeTimeout(timeOut, TimeUnit.SECONDS);// 设置写入超时时间
|
||||||
|
builder.readTimeout(timeOut, TimeUnit.SECONDS);// 设置读取数据超时时间
|
||||||
|
builder.retryOnConnectionFailure(true);// 设置进行连接失败重试
|
||||||
|
builder.cache(cache);// 设置缓存
|
||||||
|
OK_HTTP_CLIENT = builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CallAdapter.Factory rxJavaCallAdapterFactory = RxJava2CallAdapterFactory.create();
|
||||||
|
private static Converter.Factory gsonConverterFactory = GsonConverterFactory.create();
|
||||||
|
|
||||||
|
public Observable<BaseResponse<Banner>> getBannerObservable() {
|
||||||
|
return mRetrofit.create(GetBanner.class)
|
||||||
|
.getBanner()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SNInfo getuserInfoControl() {
|
||||||
|
return mRetrofit.create(SNInfo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public QueryAllApp getQueryAllAppControl() {
|
||||||
|
return mRetrofit.create(QueryAllApp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SearchApp getSearchAppControl() {
|
||||||
|
return mRetrofit.create(SearchApp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerImage getBannerImageControl() {
|
||||||
|
return mRetrofit.create(BannerImage.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DownloadApp getDownloadAppControl() {
|
||||||
|
return mRetrofit.create(DownloadApp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewestAppUpdate getNewestAppUpdateControl() {
|
||||||
|
return mRetrofit.create(NewestAppUpdate.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public QueryPackageApp getQueryPackageAppControl() {
|
||||||
|
return mRetrofit.create(QueryPackageApp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package com.appstore.uiui.network;
|
|
||||||
|
|
||||||
import android.os.Environment;
|
|
||||||
|
|
||||||
import com.appstore.uiui.network.URLs.UrlAddress;
|
|
||||||
import com.appstore.uiui.network.api.BannerImage;
|
|
||||||
import com.appstore.uiui.network.api.DownloadApp;
|
|
||||||
import com.appstore.uiui.network.api.NewestAppUpdate;
|
|
||||||
import com.appstore.uiui.network.api.QueryAllApp;
|
|
||||||
import com.appstore.uiui.network.api.SNInfo;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import okhttp3.Cache;
|
|
||||||
import okhttp3.OkHttpClient;
|
|
||||||
import retrofit2.CallAdapter;
|
|
||||||
import retrofit2.Converter;
|
|
||||||
import retrofit2.Retrofit;
|
|
||||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
|
||||||
import retrofit2.converter.gson.GsonConverterFactory;
|
|
||||||
|
|
||||||
public class NetWorkManager {
|
|
||||||
|
|
||||||
private static final String ROOT_URL = UrlAddress.ROOT_URL;
|
|
||||||
|
|
||||||
private static final long cacheSize = 1024 * 1024 * 20;// 缓存文件最大限制大小20M
|
|
||||||
private static String cacheDirectory = Environment.getExternalStorageDirectory() + "/okttpcaches"; // 设置缓存文件路径
|
|
||||||
private static Cache cache = new Cache(new File(cacheDirectory), cacheSize); //
|
|
||||||
private static final OkHttpClient client;
|
|
||||||
|
|
||||||
static {
|
|
||||||
//如果无法生存缓存文件目录,检测权限使用已经加上,检测手机是否把文件读写权限禁止了
|
|
||||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
|
||||||
builder.connectTimeout(8, TimeUnit.SECONDS); // 设置连接超时时间
|
|
||||||
builder.writeTimeout(8, TimeUnit.SECONDS);// 设置写入超时时间
|
|
||||||
builder.readTimeout(8, TimeUnit.SECONDS);// 设置读取数据超时时间
|
|
||||||
builder.retryOnConnectionFailure(true);// 设置进行连接失败重试
|
|
||||||
builder.cache(cache);// 设置缓存
|
|
||||||
client = builder.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static CallAdapter.Factory rxJavaCallAdapterFactory = RxJava2CallAdapterFactory.create();
|
|
||||||
private static Converter.Factory gsonConverterFactory = GsonConverterFactory.create();
|
|
||||||
|
|
||||||
private static SNInfo userInfoControl;
|
|
||||||
private static QueryAllApp queryAllAppControl;
|
|
||||||
private static BannerImage bannerImageControl;
|
|
||||||
private static DownloadApp downloadAppControl;
|
|
||||||
private static NewestAppUpdate newestAppUpdateControl;
|
|
||||||
|
|
||||||
|
|
||||||
public static SNInfo getuserInfoControl() {
|
|
||||||
if (null == userInfoControl) {
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
|
||||||
.client(client)
|
|
||||||
.baseUrl(ROOT_URL)
|
|
||||||
.addConverterFactory(gsonConverterFactory)
|
|
||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
|
||||||
.build();
|
|
||||||
userInfoControl = retrofit.create(SNInfo.class);
|
|
||||||
}
|
|
||||||
return userInfoControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static QueryAllApp getQueryAllAppControl() {
|
|
||||||
if (null == queryAllAppControl) {
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
|
||||||
.client(client)
|
|
||||||
.baseUrl(ROOT_URL)
|
|
||||||
.addConverterFactory(gsonConverterFactory)
|
|
||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
|
||||||
.build();
|
|
||||||
queryAllAppControl = retrofit.create(QueryAllApp.class);
|
|
||||||
}
|
|
||||||
return queryAllAppControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BannerImage getBannerImageControl() {
|
|
||||||
if (null == bannerImageControl) {
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
|
||||||
.client(client)
|
|
||||||
.baseUrl(ROOT_URL)
|
|
||||||
.addConverterFactory(gsonConverterFactory)
|
|
||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
|
||||||
.build();
|
|
||||||
bannerImageControl = retrofit.create(BannerImage.class);
|
|
||||||
}
|
|
||||||
return bannerImageControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DownloadApp getDownloadAppControl() {
|
|
||||||
if (null == downloadAppControl) {
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
|
||||||
.client(client)
|
|
||||||
.baseUrl(ROOT_URL)
|
|
||||||
.addConverterFactory(gsonConverterFactory)
|
|
||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
|
||||||
.build();
|
|
||||||
downloadAppControl = retrofit.create(DownloadApp.class);
|
|
||||||
}
|
|
||||||
return downloadAppControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NewestAppUpdate getNewestAppUpdateControl() {
|
|
||||||
if (null == newestAppUpdateControl) {
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
|
||||||
.client(client)
|
|
||||||
.baseUrl(ROOT_URL)
|
|
||||||
.addConverterFactory(gsonConverterFactory)
|
|
||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
|
||||||
.build();
|
|
||||||
newestAppUpdateControl = retrofit.create(NewestAppUpdate.class);
|
|
||||||
}
|
|
||||||
return newestAppUpdateControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -3,30 +3,35 @@ package com.appstore.uiui.network.URLs;
|
|||||||
public class UrlAddress {
|
public class UrlAddress {
|
||||||
public final static String ROOT_URL = "http://homework.uiuios.com/android/";
|
public final static String ROOT_URL = "http://homework.uiuios.com/android/";
|
||||||
|
|
||||||
public final static String GET_ALL_APPINFO = ROOT_URL + "app/queryAllApp";
|
public final static String GET_ALL_APPINFO = "app/queryAllApp";
|
||||||
//获取所有应用
|
//获取所有应用
|
||||||
public final static String GET_ALL_RANK = ROOT_URL + "App/rankings";
|
public final static String GET_PACKAGE_APP = "app/queryPackageApp";
|
||||||
//获取所有应用排行
|
|
||||||
public final static String GET_APPSEARCHE = ROOT_URL + "App/appSearch";
|
|
||||||
//搜索应用
|
|
||||||
public final static String GET_INFO_FROMESN = ROOT_URL + "sn/getSnInfo";
|
|
||||||
//通过SN获取绑定信息
|
|
||||||
public final static String GET_SORT_APP = ROOT_URL + "App/sortApp";
|
|
||||||
//app分类查询
|
|
||||||
public final static String SET_APP_INSTALL_INFO = ROOT_URL + "App/appInstall";
|
|
||||||
//发送app安装信息
|
|
||||||
public final static String SET_APP_UNINSTALL_INFO = ROOT_URL + "App/appUnload";
|
|
||||||
//发送app卸载信息
|
|
||||||
public final static String GET_APP_UPDATE = ROOT_URL + "Update/update";
|
|
||||||
//根据包名获取更新
|
|
||||||
public final static String GET_BANNER_IMG = ROOT_URL + "app/getBrand";
|
|
||||||
//获取banner图
|
|
||||||
public final static String GET_ALL_PACKAGENAME = ROOT_URL + "App/allPackageSn";
|
|
||||||
//获取所有应用包名
|
|
||||||
public final static String GET_SUBClASSFY = ROOT_URL + "Application/getSubClassfy";
|
|
||||||
//获取应用分类
|
|
||||||
public final static String SEND_DOWNLOADAPP = ROOT_URL + "app/downloadApp";
|
|
||||||
|
|
||||||
public final static String GET_NEWESTAPPUPDATE = ROOT_URL + "app/newestAppUpdate";
|
public final static String GET_ALL_RANK = "App/rankings";
|
||||||
|
//获取所有应用排行
|
||||||
|
public final static String GET_APPSEARCHE = "App/appSearch";
|
||||||
|
//搜索应用
|
||||||
|
public final static String GET_INFO_FROMESN = "sn/getSnInfo";
|
||||||
|
//通过SN获取绑定信息
|
||||||
|
public final static String GET_SORT_APP = "App/sortApp";
|
||||||
|
//app分类查询
|
||||||
|
public final static String SET_APP_INSTALL_INFO = "App/appInstall";
|
||||||
|
//发送app安装信息
|
||||||
|
public final static String SET_APP_UNINSTALL_INFO = "App/appUnload";
|
||||||
|
//发送app卸载信息
|
||||||
|
public final static String GET_APP_UPDATE = "Update/update";
|
||||||
|
//根据包名获取更新
|
||||||
|
public final static String GET_BANNER_IMG = "app/getBrand";
|
||||||
|
//获取banner图
|
||||||
|
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 SEND_DOWNLOADAPP = "app/downloadApp";
|
||||||
|
|
||||||
|
public final static String GET_NEWESTAPPUPDATE = "app/newestAppUpdate";
|
||||||
//根据包名获取更新
|
//根据包名获取更新
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.appstore.uiui.network.api;
|
||||||
|
|
||||||
|
import com.appstore.uiui.bean.Banner;
|
||||||
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
|
import com.appstore.uiui.network.URLs.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
|
||||||
|
public interface GetBanner {
|
||||||
|
@GET(UrlAddress.GET_BANNER)
|
||||||
|
Observable<BaseResponse<Banner>> getBanner(
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ public interface NewestAppUpdate {
|
|||||||
@GET(UrlAddress.GET_NEWESTAPPUPDATE)
|
@GET(UrlAddress.GET_NEWESTAPPUPDATE)
|
||||||
Observable<BaseResponse<AppInfo>> getAppUpdate(
|
Observable<BaseResponse<AppInfo>> getAppUpdate(
|
||||||
@Query("packageName") String packageName,
|
@Query("packageName") String packageName,
|
||||||
@Query("versionCode") String versionCode
|
@Query("versionCode") String versionCode,
|
||||||
|
@Query("type") int type
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.appstore.uiui.network.api;
|
||||||
|
|
||||||
|
import com.appstore.uiui.bean.AppInfo;
|
||||||
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
|
import com.appstore.uiui.network.URLs.UrlAddress;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface QueryPackageApp {
|
||||||
|
@GET(UrlAddress.GET_PACKAGE_APP)
|
||||||
|
Observable<BaseResponse<AppInfo>> getPackageApp(
|
||||||
|
@Query("packageName") String packageName,
|
||||||
|
@Query("versionCode") long versionCode
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.appstore.uiui.network.api;
|
||||||
|
|
||||||
|
import com.appstore.uiui.bean.AppInfo;
|
||||||
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
|
import com.appstore.uiui.network.URLs.UrlAddress;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface SearchApp {
|
||||||
|
@GET(UrlAddress.GET_ALL_APPINFO)
|
||||||
|
Observable<BaseResponse<List<AppInfo>>> getApp(
|
||||||
|
@Query("sn") String sn,
|
||||||
|
@Query("app_name") String app_name
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.appstore.uiui.KeepAliveConnection;
|
import com.appstore.uiui.KeepAliveConnection;
|
||||||
import com.appstore.uiui.bean.BaseResponse;
|
import com.appstore.uiui.bean.BaseResponse;
|
||||||
import com.appstore.uiui.network.NetWorkManager;
|
import com.appstore.uiui.network.NetInterfaceManager;
|
||||||
import com.appstore.uiui.network.api.DownloadApp;
|
import com.appstore.uiui.network.api.DownloadApp;
|
||||||
import com.appstore.uiui.utils.ApkUtils;
|
import com.appstore.uiui.utils.ApkUtils;
|
||||||
import com.appstore.uiui.utils.LogUtils;
|
import com.appstore.uiui.utils.LogUtils;
|
||||||
@@ -179,8 +179,9 @@ public class GuardService extends Service {
|
|||||||
String packageName = jsonObject.getString("app_package");
|
String packageName = jsonObject.getString("app_package");
|
||||||
File file = new File(downloadPath);
|
File file = new File(downloadPath);
|
||||||
int admin_id = (int) SPUtils.get(GuardService.this, "admin_id", -1);
|
int admin_id = (int) SPUtils.get(GuardService.this, "admin_id", -1);
|
||||||
DownloadApp downloadApp = NetWorkManager.getDownloadAppControl();
|
NetInterfaceManager.getInstance()
|
||||||
downloadApp.sendDownloadApp(packageName, file.length(), Utils.getSerial(), admin_id)
|
.getDownloadAppControl()
|
||||||
|
.sendDownloadApp(packageName, file.length(), Utils.getSerial(), admin_id)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseResponse>() {
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ package com.appstore.uiui.service;
|
|||||||
|
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Environment;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
|
||||||
import com.appstore.uiui.KeepAliveConnection;
|
import com.appstore.uiui.KeepAliveConnection;
|
||||||
import com.appstore.uiui.network.HTTPInterface;
|
import com.appstore.uiui.network.HTTPInterface;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class InitJpushServer extends Service {
|
public class InitJpushServer extends Service {
|
||||||
public InitJpushServer() {
|
public InitJpushServer() {
|
||||||
}
|
}
|
||||||
@@ -25,4 +28,16 @@ public class InitJpushServer extends Service {
|
|||||||
HTTPInterface.checkUpdate(InitJpushServer.this, "com.info.sn");
|
HTTPInterface.checkUpdate(InitJpushServer.this, "com.info.sn");
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
File file = new File(DOWNLOAD_PATH);
|
||||||
|
if (file.isFile() || !file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String DOWNLOAD_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + File.separator + "jgy";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ public class ApkUtils {
|
|||||||
return uid / PER_USER_RANGE;
|
return uid / PER_USER_RANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkIsUpdate(Context context, String packageName, int versionCode) {
|
public static boolean checkIsUpdate(Context context, String packageName, long versionCode) {
|
||||||
PackageManager packageManager = context.getPackageManager();
|
PackageManager packageManager = context.getPackageManager();
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
PackageInfo packageInfo = null;
|
PackageInfo packageInfo = null;
|
||||||
@@ -610,7 +610,7 @@ public class ApkUtils {
|
|||||||
return info != null;
|
return info != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isUpdate(Context context, String packageName, int versionCode) {
|
public static boolean isUpdate(Context context, String packageName, long versionCode) {
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
PackageInfo info = null;
|
PackageInfo info = null;
|
||||||
try {
|
try {
|
||||||
@@ -631,5 +631,15 @@ public class ApkUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<String> canremove_systemapp = new ArrayList<String>() {{
|
||||||
|
//预置的可以卸载的系统应用,判断出来为第三方
|
||||||
|
this.add("com.android.quicksearchbox");
|
||||||
|
this.add("com.android.calendar");
|
||||||
|
this.add("com.android.dreams.basic");
|
||||||
|
this.add("com.android.musicfx");
|
||||||
|
this.add("com.android.email");
|
||||||
|
this.add("com.jiaoguanyi.sysc");
|
||||||
|
}};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
320
app/src/main/java/com/appstore/uiui/utils/JGYUtils.java
Normal file
@@ -0,0 +1,320 @@
|
|||||||
|
package com.appstore.uiui.utils;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.ContextWrapper;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.BatteryManager;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.appstore.uiui.BuildConfig;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
|
||||||
|
|
||||||
|
public class JGYUtils {
|
||||||
|
private static final String TAG = JGYUtils.class.getSimpleName();
|
||||||
|
|
||||||
|
private static JGYUtils sInstance;
|
||||||
|
private Context mContext;
|
||||||
|
public static int MTKPlatform = 1;
|
||||||
|
public static int ZhanruiPlatform = 2;
|
||||||
|
public static int UnknowPlatform = 0;
|
||||||
|
public static String MTKTag = "MTK";
|
||||||
|
public static String ZhanruiTag = "展锐";
|
||||||
|
|
||||||
|
|
||||||
|
private JGYUtils(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
if (sInstance == null) {
|
||||||
|
sInstance = new JGYUtils(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JGYUtils getInstance() {
|
||||||
|
if (sInstance == null) {
|
||||||
|
throw new IllegalStateException("You must be init JGYUtils first");
|
||||||
|
}
|
||||||
|
return sInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isOfficialVersion() {
|
||||||
|
String channelValue = JGYUtils.getInstance().getStringMetaData();
|
||||||
|
return "official".equals(channelValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNewlyVersion() {
|
||||||
|
String channelValue = JGYUtils.getInstance().getStringMetaData();
|
||||||
|
return "beta".equals(channelValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isBetaVersion() {
|
||||||
|
String channelValue = JGYUtils.getInstance().getStringMetaData();
|
||||||
|
return "beta".equals(channelValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private int getBatteryLevel() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
BatteryManager batteryManager = (BatteryManager) mContext.getSystemService(Context.BATTERY_SERVICE);
|
||||||
|
return batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
|
||||||
|
} else {
|
||||||
|
Intent intent = new ContextWrapper(mContext).registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
|
||||||
|
return (intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1) * 100) /
|
||||||
|
intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private PowerManager.WakeLock wakeLock = null;
|
||||||
|
private static final String mWakeLockName = "BackupService";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取电源锁,保持该服务在屏幕熄灭时仍然获取CPU时,保持运行
|
||||||
|
*/
|
||||||
|
@SuppressLint("InvalidWakeLockTag")
|
||||||
|
private synchronized void acquireWakeLock() {
|
||||||
|
if (null == wakeLock) {
|
||||||
|
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||||
|
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
|
||||||
|
| PowerManager.ON_AFTER_RELEASE, mWakeLockName);
|
||||||
|
if (null != wakeLock) {
|
||||||
|
Log.e("fht", "acquireWakeLock!");
|
||||||
|
wakeLock.acquire();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 释放设备电源锁
|
||||||
|
*/
|
||||||
|
private synchronized void releaseWakeLock() {
|
||||||
|
if (null != wakeLock) {
|
||||||
|
Log.e("fht", "releaseWakeLock!");
|
||||||
|
wakeLock.release();
|
||||||
|
wakeLock = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ids 需要管控的ID
|
||||||
|
* @param packages 应用程序包名
|
||||||
|
*/
|
||||||
|
public void writeDeselectIDtoSystem(String ids, String packages) {
|
||||||
|
if (!TextUtils.isEmpty(ids) && !TextUtils.isEmpty(packages)) {
|
||||||
|
ArrayList<String> idArrayList = new ArrayList<>(Arrays.asList(ids.split(",")));
|
||||||
|
ArrayList<String> packageArrayList = new ArrayList<>(Arrays.asList(packages.split(",")));
|
||||||
|
LinkedHashSet<String> idHashSet = new LinkedHashSet<>(idArrayList);
|
||||||
|
LinkedHashSet<String> packageHashSet = new LinkedHashSet<>(packageArrayList);
|
||||||
|
ArrayList<String> idList = new ArrayList<>(idHashSet);
|
||||||
|
ArrayList<String> packageList = new ArrayList<>(packageHashSet);
|
||||||
|
StringBuilder idStringBuilder = new StringBuilder();
|
||||||
|
for (String id : idList) {
|
||||||
|
if (idStringBuilder.length() > 0) {
|
||||||
|
idStringBuilder.append(",");
|
||||||
|
}
|
||||||
|
idStringBuilder.append(id);
|
||||||
|
}
|
||||||
|
StringBuilder packageStringBuilder = new StringBuilder();
|
||||||
|
for (String pkg : packageList) {
|
||||||
|
if (packageStringBuilder.length() > 0) {
|
||||||
|
packageStringBuilder.append(",");
|
||||||
|
}
|
||||||
|
packageStringBuilder.append(pkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String olddeselectViewArray = Settings.System.getString(mContext.getContentResolver(), "qch_app_forbid_id");
|
||||||
|
Log.e("writeDeselectIDtoSystem", "olddeselectViewArray: " + olddeselectViewArray);
|
||||||
|
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "qch_app_forbid_id", packageStringBuilder.toString());
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "DeselectViewArray", idStringBuilder.toString());
|
||||||
|
Log.e("writeDeselectIDtoSystem", "qch_app_forbid_id: " + packageStringBuilder.toString());
|
||||||
|
Log.e("writeDeselectIDtoSystem", "deselectViewArray: " + idStringBuilder.toString());
|
||||||
|
} else {
|
||||||
|
Log.e("writeDeselectIDtoSystem", "writeDeselectIDtoSystem is null:");
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "qch_app_forbid_id", "");
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), "DeselectViewArray", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static void sendAllweb(Context context) {
|
||||||
|
Intent intent = new Intent("qch_app_website")
|
||||||
|
.setPackage("com.android.settings");
|
||||||
|
intent.putExtra("package_name", "Invalid");
|
||||||
|
context.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sendwebUrl(Context context) {
|
||||||
|
Intent intent = new Intent("qch_app_inside_website")
|
||||||
|
.setPackage("com.android.settings");
|
||||||
|
intent.putExtra("websitelist", "Invalid");
|
||||||
|
context.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从Manifest中获取meta-data值
|
||||||
|
* https://blog.csdn.net/yue_233/article/details/91453451
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getStringMetaData() {
|
||||||
|
ApplicationInfo appInfo = null;
|
||||||
|
try {
|
||||||
|
appInfo = mContext.getPackageManager().getApplicationInfo(mContext.getPackageName(), PackageManager.GET_META_DATA);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
String value = appInfo.metaData.getString("CHANNEL_VALUE");
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hookWebView() {
|
||||||
|
int sdkInt = Build.VERSION.SDK_INT;
|
||||||
|
try {
|
||||||
|
Class<?> factoryClass = Class.forName("android.webkit.WebViewFactory");
|
||||||
|
Field field = factoryClass.getDeclaredField("sProviderInstance");
|
||||||
|
field.setAccessible(true);
|
||||||
|
Object sProviderInstance = field.get(null);
|
||||||
|
if (sProviderInstance != null) {
|
||||||
|
Log.i(TAG, "sProviderInstance isn't null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Method getProviderClassMethod;
|
||||||
|
if (sdkInt > 22) {
|
||||||
|
getProviderClassMethod = factoryClass.getDeclaredMethod("getProviderClass");
|
||||||
|
} else if (sdkInt == 22) {
|
||||||
|
getProviderClassMethod = factoryClass.getDeclaredMethod("getFactoryClass");
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "Don't need to Hook WebView");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getProviderClassMethod.setAccessible(true);
|
||||||
|
Class<?> factoryProviderClass = (Class<?>) getProviderClassMethod.invoke(factoryClass);
|
||||||
|
Class<?> delegateClass = Class.forName("android.webkit.WebViewDelegate");
|
||||||
|
Constructor<?> delegateConstructor = delegateClass.getDeclaredConstructor();
|
||||||
|
delegateConstructor.setAccessible(true);
|
||||||
|
if (sdkInt < 26) {//低于Android O版本
|
||||||
|
Constructor<?> providerConstructor = factoryProviderClass.getConstructor(delegateClass);
|
||||||
|
if (providerConstructor != null) {
|
||||||
|
providerConstructor.setAccessible(true);
|
||||||
|
sProviderInstance = providerConstructor.newInstance(delegateConstructor.newInstance());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Field chromiumMethodName = factoryClass.getDeclaredField("CHROMIUM_WEBVIEW_FACTORY_METHOD");
|
||||||
|
chromiumMethodName.setAccessible(true);
|
||||||
|
String chromiumMethodNameStr = (String) chromiumMethodName.get(null);
|
||||||
|
if (chromiumMethodNameStr == null) {
|
||||||
|
chromiumMethodNameStr = "create";
|
||||||
|
}
|
||||||
|
Method staticFactory = factoryProviderClass.getMethod(chromiumMethodNameStr, delegateClass);
|
||||||
|
if (staticFactory != null) {
|
||||||
|
sProviderInstance = staticFactory.invoke(null, delegateConstructor.newInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sProviderInstance != null) {
|
||||||
|
field.set("sProviderInstance", sProviderInstance);
|
||||||
|
Log.i(TAG, "Hook success!");
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "Hook failed!");
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.w(TAG, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忽略电池优化
|
||||||
|
*/
|
||||||
|
private void ignoreBatteryOptimization(Context context) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
|
||||||
|
PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||||
|
|
||||||
|
boolean hasIgnored = powerManager.isIgnoringBatteryOptimizations(context.getPackageName());
|
||||||
|
// 判断当前APP是否有加入电池优化的白名单,如果没有,弹出加入电池优化的白名单的设置对话框。
|
||||||
|
if (!hasIgnored) {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||||
|
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int checkSNPlatform(String sn) {
|
||||||
|
String secondChars = sn.substring(1, 2);
|
||||||
|
if ("N".equalsIgnoreCase(secondChars)) {//MTK平台
|
||||||
|
return MTKPlatform;
|
||||||
|
} else if ("R".equalsIgnoreCase(secondChars)) {//展锐平台
|
||||||
|
return ZhanruiPlatform;
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "checkSNPlatform: " + "sn: " + sn + "没有对应平台");
|
||||||
|
return UnknowPlatform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int checkAppPlatform() {
|
||||||
|
String platform = BuildConfig.platform;
|
||||||
|
if ("MTK".equalsIgnoreCase(platform)) {
|
||||||
|
Log.i(TAG, "checkAppPlatform: " + "MTK平台");
|
||||||
|
return MTKPlatform;
|
||||||
|
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||||
|
Log.i(TAG, "checkAppPlatform: " + "展锐平台");
|
||||||
|
return ZhanruiPlatform;
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||||
|
return UnknowPlatform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSamePlatform(String platform) {
|
||||||
|
String AppPlatform = BuildConfig.platform;
|
||||||
|
if ("ZhanRui".equals(AppPlatform)) {
|
||||||
|
return ZhanruiTag.equals(platform);
|
||||||
|
} else {
|
||||||
|
return AppPlatform.equals(platform);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface GetAppPlatformCallback {
|
||||||
|
void AppPlatform(int platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
|
||||||
|
String platform = BuildConfig.platform;
|
||||||
|
if ("MTK".equalsIgnoreCase(platform)) {
|
||||||
|
getAppPlatformCallback.AppPlatform(MTKPlatform);
|
||||||
|
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||||
|
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
|
||||||
|
} else {
|
||||||
|
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,31 +6,31 @@ import com.appstore.uiui.BuildConfig;
|
|||||||
|
|
||||||
public class LogUtils {
|
public class LogUtils {
|
||||||
public static void v(String tag, String msg) {
|
public static void v(String tag, String msg) {
|
||||||
if (BuildConfig.LOG_DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.v(tag, msg);
|
Log.v(tag, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void d(String tag, String msg) {
|
public static void d(String tag, String msg) {
|
||||||
if (BuildConfig.LOG_DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.d(tag, msg);
|
Log.d(tag, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void i(String tag, String msg) {
|
public static void i(String tag, String msg) {
|
||||||
if (BuildConfig.LOG_DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.i(tag, msg);
|
Log.i(tag, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void w(String tag, String msg) {
|
public static void w(String tag, String msg) {
|
||||||
if (BuildConfig.LOG_DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.w(tag, msg);
|
Log.w(tag, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void e(String tag, String msg) {
|
public static void e(String tag, String msg) {
|
||||||
if (BuildConfig.LOG_DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.e(tag, msg);
|
Log.e(tag, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ package com.appstore.uiui.utils;
|
|||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.appstore.uiui.MyApplication;
|
import com.appstore.uiui.base.BaseApplication;
|
||||||
|
|
||||||
public class ServiceAliveUtils {
|
public class ServiceAliveUtils {
|
||||||
|
|
||||||
public static boolean isServiceAlice() {
|
public static boolean isServiceAlice() {
|
||||||
boolean isServiceRunning = false;
|
boolean isServiceRunning = false;
|
||||||
ActivityManager manager =
|
ActivityManager manager =
|
||||||
(ActivityManager) MyApplication.getInstance().getAppContext().getSystemService(Context.ACTIVITY_SERVICE);
|
(ActivityManager) BaseApplication.getInstance().getAppContext().getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
if (manager == null) {
|
if (manager == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class ToastUtil {
|
|||||||
mainHandler.post(new Runnable() {
|
mainHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (BuildConfig.LOG_DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
if (toast != null) {
|
if (toast != null) {
|
||||||
toast.setText(msg);
|
toast.setText(msg);
|
||||||
toast.show();
|
toast.show();
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable-xhdpi/banner.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 2.1 KiB |
14
app/src/main/res/drawable/btn_shap_delete.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<solid
|
||||||
|
android:color="@color/red" />
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="30dp"
|
||||||
|
android:topRightRadius="30dp"
|
||||||
|
android:bottomLeftRadius="30dp"
|
||||||
|
android:bottomRightRadius="30dp" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
14
app/src/main/res/drawable/btn_shap_open.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?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="30dp"
|
||||||
|
android:topRightRadius="30dp"
|
||||||
|
android:bottomLeftRadius="30dp"
|
||||||
|
android:bottomRightRadius="30dp" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
android:shape="rectangle"
|
android:shape="rectangle"
|
||||||
android:useLevel="false">
|
android:useLevel="false">
|
||||||
<!--实心 -->
|
<!--实心 -->
|
||||||
<solid android:color="@color/white" />
|
<solid android:color="@color/default_color" />
|
||||||
<corners android:radius="25dp" />
|
<corners android:radius="25dp" />
|
||||||
<size android:width="32dp"
|
<size android:width="32dp"
|
||||||
android:height="32dp"/>
|
android:height="32dp"/>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="36dp"
|
android:layout_marginBottom="36dp"
|
||||||
android:text="版权申明"
|
android:text="回到桌面"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/default_color"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:overScrollMode="never"
|
android:background="@color/white"
|
||||||
android:background="@color/white">
|
android:overScrollMode="never">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -85,7 +85,8 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="今日头条"
|
android:text="今日头条"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16" />
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
<RatingBar
|
<RatingBar
|
||||||
@@ -96,18 +97,17 @@
|
|||||||
android:rating="3" />
|
android:rating="3" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_company"
|
android:id="@+id/detali_tv_size"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:layout_weight="1"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:gravity="center_vertical"
|
android:text="大小" />
|
||||||
android:singleLine="true"
|
|
||||||
android:text="北京字节跳动网络技术有限公司" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
|
android:id="@+id/scrollView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
@@ -132,8 +132,8 @@
|
|||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:text="应用介绍"
|
android:text="应用介绍"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:visibility="gone"
|
android:textStyle="bold"
|
||||||
android:textStyle="bold">
|
android:visibility="gone">
|
||||||
|
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
@@ -154,9 +154,9 @@
|
|||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:text="更新"
|
android:text="更新"
|
||||||
android:visibility="gone"
|
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:textStyle="bold">
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
@@ -178,20 +178,22 @@
|
|||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:text="信息"
|
android:text="信息"
|
||||||
android:visibility="gone"
|
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:textStyle="bold">
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detali_tv_size"
|
android:id="@+id/detail_tv_company"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_weight="1"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:gravity="center_vertical"
|
||||||
android:text="大小" />
|
android:singleLine="true"
|
||||||
|
android:text="" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_version"
|
android:id="@+id/detail_tv_version"
|
||||||
@@ -199,8 +201,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:visibility="gone"
|
android:text="版本"
|
||||||
android:text="版本" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_update_time"
|
android:id="@+id/detail_tv_update_time"
|
||||||
@@ -208,8 +210,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:visibility="gone"
|
android:text="时间"
|
||||||
android:text="时间" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_Developers"
|
android:id="@+id/detail_tv_Developers"
|
||||||
@@ -217,8 +219,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:visibility="gone"
|
android:text="开发者"
|
||||||
android:text="开发者" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -36,10 +36,8 @@
|
|||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="20dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:visibility="gone"
|
android:layout_weight="1"
|
||||||
android:layout_weight="1">
|
android:visibility="visible">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -99,16 +97,17 @@
|
|||||||
app:tl_indicator_style="TRIANGLE"
|
app:tl_indicator_style="TRIANGLE"
|
||||||
app:tl_tab_space_equal="true"
|
app:tl_tab_space_equal="true"
|
||||||
app:tl_textBold="SELECT"
|
app:tl_textBold="SELECT"
|
||||||
app:tl_textsize="@dimen/sp_15"
|
app:tl_textSelectColor="@color/default_text_color"
|
||||||
app:tl_textSelectColor="@color/default_color"
|
app:tl_textUnselectColor="@color/install"
|
||||||
app:tl_textUnselectColor="@color/install" />
|
app:tl_textsize="@dimen/sp_17" />
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:id="@+id/main_view_pager"
|
android:id="@+id/main_view_pager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:overScrollMode="never"
|
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||||
@@ -19,11 +19,23 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_banner"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_230"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/banner"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
<com.zhpan.bannerview.BannerViewPager
|
<com.zhpan.bannerview.BannerViewPager
|
||||||
android:id="@+id/banner_view"
|
android:id="@+id/banner_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_230"
|
android:layout_height="@dimen/dp_230"
|
||||||
android:layout_margin="10dp" />
|
android:layout_margin="10dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -31,10 +43,11 @@
|
|||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/featured_rv_result"
|
android:id="@+id/featured_rv_result"
|
||||||
android:nestedScrollingEnabled="false"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:overScrollMode="never"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
|
|||||||
@@ -33,13 +33,25 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_my_task"
|
android:src="@drawable/icon_my_task"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/manage_tv_appNum"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/imageView1"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.5" />
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/imageView1"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -62,7 +74,7 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_download_task"
|
android:src="@drawable/icon_download_task"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -106,7 +118,7 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_update_task"
|
android:src="@drawable/icon_update_task"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -133,12 +145,12 @@
|
|||||||
android:text="0"
|
android:text="0"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/imageView2"
|
app:layout_constraintEnd_toStartOf="@+id/imageView3"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.5" />
|
app:layout_constraintVertical_bias="0.5" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView3"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
android:layout_weight="1.5"
|
android:layout_weight="1.5"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="今日头条"
|
android:text="今日头条"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/btn_style_none"
|
android:background="@drawable/btn_shap_open"
|
||||||
android:text="开始" />
|
android:text="开始" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -107,8 +107,8 @@
|
|||||||
android:layout_height="@dimen/dp_30"
|
android:layout_height="@dimen/dp_30"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="暂停"
|
android:text="暂停"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/btn_style_none" />
|
android:background="@drawable/btn_shap_open" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="225dp"
|
android:layout_width="180dp"
|
||||||
android:layout_height="400dp"
|
android:layout_height="400dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:cardCornerRadius="10dp">
|
app:cardCornerRadius="10dp">
|
||||||
|
|||||||
@@ -60,18 +60,17 @@
|
|||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/local_app_btn_download"
|
android:id="@+id/local_app_btn_delete"
|
||||||
android:layout_width="@dimen/dp_60"
|
android:layout_width="@dimen/dp_60"
|
||||||
android:layout_height="@dimen/dp_30"
|
android:layout_height="@dimen/dp_30"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:background="@drawable/btn_style_none"
|
android:background="@drawable/btn_shap_download"
|
||||||
android:stateListAnimator="@null"
|
android:stateListAnimator="@null"
|
||||||
android:text="删除"
|
android:text="删除"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/default_text_color"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/local_app_update"
|
android:id="@+id/local_app_update"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="36dp"
|
android:layout_marginBottom="36dp"
|
||||||
android:text="版权申明"
|
android:text="回到桌面"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/default_color"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:overScrollMode="never"
|
android:background="@color/white"
|
||||||
android:background="@color/white">
|
android:overScrollMode="never">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -85,7 +85,8 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="今日头条"
|
android:text="今日头条"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16" />
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
<RatingBar
|
<RatingBar
|
||||||
@@ -96,18 +97,18 @@
|
|||||||
android:rating="3" />
|
android:rating="3" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_company"
|
android:id="@+id/detali_tv_size"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:layout_weight="1"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:gravity="center_vertical"
|
android:text="大小" />
|
||||||
android:singleLine="true"
|
|
||||||
android:text="北京字节跳动网络技术有限公司" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
|
android:id="@+id/scrollView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
@@ -132,10 +133,8 @@
|
|||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:text="应用介绍"
|
android:text="应用介绍"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:visibility="gone"
|
android:textStyle="bold"
|
||||||
android:textStyle="bold">
|
android:visibility="gone" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detali_tv_content"
|
android:id="@+id/detali_tv_content"
|
||||||
@@ -143,9 +142,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:layout_marginRight="@dimen/dp_15">
|
android:layout_marginRight="@dimen/dp_15" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -155,10 +152,8 @@
|
|||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:text="更新"
|
android:text="更新"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:visibility="gone"
|
android:textStyle="bold"
|
||||||
android:textStyle="bold">
|
android:visibility="gone" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detali_tv_update"
|
android:id="@+id/detali_tv_update"
|
||||||
@@ -167,9 +162,7 @@
|
|||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
|
|
||||||
android:layout_marginRight="@dimen/dp_15">
|
android:layout_marginRight="@dimen/dp_15" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -179,19 +172,19 @@
|
|||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:text="信息"
|
android:text="信息"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:visibility="gone"
|
android:textStyle="bold"
|
||||||
android:textStyle="bold">
|
android:visibility="gone" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detali_tv_size"
|
android:id="@+id/detail_tv_company"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_weight="1"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:gravity="center_vertical"
|
||||||
android:text="大小" />
|
android:singleLine="true"
|
||||||
|
android:text="" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_version"
|
android:id="@+id/detail_tv_version"
|
||||||
@@ -199,8 +192,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:visibility="gone"
|
android:text="版本"
|
||||||
android:text="版本" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_update_time"
|
android:id="@+id/detail_tv_update_time"
|
||||||
@@ -208,8 +201,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:visibility="gone"
|
android:text="时间"
|
||||||
android:text="时间" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_tv_Developers"
|
android:id="@+id/detail_tv_Developers"
|
||||||
@@ -217,8 +210,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:visibility="gone"
|
android:text="开发者"
|
||||||
android:text="开发者" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -36,10 +36,8 @@
|
|||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="20dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:visibility="gone"
|
android:layout_weight="1"
|
||||||
android:layout_weight="1">
|
android:visibility="visible">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -95,19 +93,21 @@
|
|||||||
android:id="@+id/main_sliding_tab_layout"
|
android:id="@+id/main_sliding_tab_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
|
android:background="@color/white"
|
||||||
app:tl_indicator_style="TRIANGLE"
|
app:tl_indicator_style="TRIANGLE"
|
||||||
app:tl_tab_space_equal="true"
|
app:tl_tab_space_equal="true"
|
||||||
app:tl_textBold="SELECT"
|
app:tl_textBold="SELECT"
|
||||||
app:tl_textsize="@dimen/sp_15"
|
app:tl_textSelectColor="@color/default_text_color"
|
||||||
app:tl_textSelectColor="@color/default_color"
|
app:tl_textUnselectColor="@color/install"
|
||||||
app:tl_textUnselectColor="@color/install" />
|
app:tl_textsize="@dimen/sp_17" />
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:id="@+id/main_view_pager"
|
android:id="@+id/main_view_pager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:overScrollMode="never"
|
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -24,22 +24,45 @@
|
|||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/ic_back" />
|
android:src="@drawable/ic_back" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SearchView
|
<LinearLayout
|
||||||
android:id="@+id/search"
|
android:id="@+id/search_ll"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="@dimen/dp_40"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center"
|
||||||
android:layout_marginEnd="@dimen/dp_40"
|
android:gravity="center_vertical">
|
||||||
android:textColor="@color/default_text_color"
|
|
||||||
app:iconifiedByDefault="false"
|
|
||||||
app:queryHint="@string/search_edit"
|
|
||||||
app:searchIcon="@drawable/ic_menu_search">
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.SearchView>
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_40"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:src="@drawable/shap_search_left" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_40"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@color/search"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@drawable/icon_search" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit_search"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_40"
|
||||||
|
android:background="@drawable/shap_search_right"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:hint="@string/search_edit"
|
||||||
|
android:imeOptions="actionSearch"
|
||||||
|
android:inputType="text"
|
||||||
|
android:textColor="#a7a5a5">
|
||||||
|
|
||||||
|
</EditText>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/recyclerView"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||||
@@ -18,12 +18,22 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_banner"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_230"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/banner"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
<com.zhpan.bannerview.BannerViewPager
|
<com.zhpan.bannerview.BannerViewPager
|
||||||
android:id="@+id/banner_view"
|
android:id="@+id/banner_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_230"
|
android:layout_height="@dimen/dp_230"
|
||||||
android:layout_margin="10dp" />
|
android:layout_margin="10dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -31,10 +41,11 @@
|
|||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/featured_rv_result"
|
android:id="@+id/featured_rv_result"
|
||||||
android:nestedScrollingEnabled="false"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:overScrollMode="never"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
|
|||||||
@@ -33,13 +33,27 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_my_task"
|
android:src="@drawable/icon_my_task"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/manage_tv_appNum"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/imageView1"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.5" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/imageView1"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -62,7 +76,7 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_download_task"
|
android:src="@drawable/icon_download_task"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -106,7 +120,7 @@
|
|||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_update_task"
|
android:src="@drawable/icon_update_task"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -133,12 +147,12 @@
|
|||||||
android:text="0"
|
android:text="0"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/imageView2"
|
app:layout_constraintEnd_toStartOf="@+id/imageView3"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.5" />
|
app:layout_constraintVertical_bias="0.5" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView3"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -158,10 +172,10 @@
|
|||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/manage_rv_local"
|
android:id="@+id/manage_rv_local"
|
||||||
android:overScrollMode="never"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
android:layout_height="match_parent" />
|
android:overScrollMode="never" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_nodata"
|
android:id="@+id/iv_nodata"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
android:layout_weight="1.5"
|
android:layout_weight="1.5"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="今日头条"
|
android:text="今日头条"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|||||||
@@ -64,8 +64,8 @@
|
|||||||
android:layout_height="@dimen/dp_30"
|
android:layout_height="@dimen/dp_30"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/white"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:background="@drawable/btn_style_none"
|
android:background="@drawable/btn_shap_open"
|
||||||
android:text="开始" />
|
android:text="开始" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -107,8 +107,8 @@
|
|||||||
android:layout_height="@dimen/dp_30"
|
android:layout_height="@dimen/dp_30"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="暂停"
|
android:text="暂停"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/btn_style_none" />
|
android:background="@drawable/btn_shap_open" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="225dp"
|
android:layout_width="180dp"
|
||||||
android:layout_height="400dp"
|
android:layout_height="320dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
app:cardCornerRadius="10dp">
|
app:cardCornerRadius="10dp">
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="72dp"
|
||||||
android:background="@drawable/ll_selector"
|
android:background="@drawable/ll_selector"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@@ -14,17 +14,16 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/local_app_iv_icon"
|
android:id="@+id/local_app_iv_icon"
|
||||||
android:layout_width="60dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="64dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="16dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="64dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@@ -58,28 +57,47 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="@dimen/dp_64"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/local_app_btn_download"
|
android:id="@+id/local_app_btn_open"
|
||||||
android:layout_width="@dimen/dp_60"
|
android:layout_width="@dimen/dp_64"
|
||||||
android:layout_height="@dimen/dp_30"
|
android:layout_height="@dimen/dp_32"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:background="@drawable/btn_style_none"
|
android:background="@drawable/btn_shap_open"
|
||||||
android:stateListAnimator="@null"
|
android:stateListAnimator="@null"
|
||||||
android:text="删除"
|
android:text="打开"
|
||||||
android:textColor="@color/default_color"
|
android:textColor="@color/white"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/local_app_btn_delete"
|
||||||
|
android:layout_width="@dimen/dp_64"
|
||||||
|
android:layout_height="@dimen/dp_32"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:background="@drawable/btn_shap_delete"
|
||||||
|
android:stateListAnimator="@null"
|
||||||
|
android:text="删除"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/local_app_update"
|
android:id="@+id/local_app_update"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginRight="24dp"
|
||||||
android:text="已安装"
|
android:text="已安装"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -7,14 +7,14 @@
|
|||||||
<color name="white">#FFFFFF</color>
|
<color name="white">#FFFFFF</color>
|
||||||
<color name="black">#000000</color>
|
<color name="black">#000000</color>
|
||||||
<color name="gray">#f5f4f4</color>
|
<color name="gray">#f5f4f4</color>
|
||||||
<color name="install">#959393</color>
|
<color name="install">#b6b6b6</color>
|
||||||
<color name="default_text_color">#868686</color>
|
<color name="default_text_color">#333333</color>
|
||||||
<color name="default_color">#4880ff</color>
|
<color name="default_color">#4880ff</color>
|
||||||
<color name="download">#ffffff</color>
|
<color name="download">#ffffff</color>
|
||||||
<color name="backgroundcolor">#ffffff</color>
|
<color name="backgroundcolor">#ffffff</color>
|
||||||
<color name="search">#F1F1F1</color>
|
<color name="search">#F1F1F1</color>
|
||||||
<color name="red">#d64743</color>
|
<color name="red">#d64743</color>
|
||||||
<color name="blue">#00a0e9</color>
|
<color name="blue">#00a0e9</color>
|
||||||
<color name="adapter_selector_default">#E9E9E9</color>
|
<color name="adapter_selector_default">#d8d8d8</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||