version:8.0
fix: update:接口请求优化,搜索功能完善
@@ -45,8 +45,8 @@ android {
|
||||
productFlavors {
|
||||
official {
|
||||
flavorDimensions "default"
|
||||
versionCode 62
|
||||
versionName "7.1"
|
||||
versionCode 71
|
||||
versionName "8.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,8 +190,8 @@ dependencies {
|
||||
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0' //1.0.5及以前版本的老用户升级需谨慎,API改动过大
|
||||
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0' //没有使用特殊Header,可以不加这行
|
||||
//glide
|
||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||||
implementation 'com.github.bumptech.glide:glide:4.14.2'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
|
||||
//磁盘缓存
|
||||
implementation 'com.jakewharton:disklrucache:2.0.2'
|
||||
//aria
|
||||
@@ -200,7 +200,7 @@ dependencies {
|
||||
//动态权限框架
|
||||
implementation 'com.hjq:xxpermissions:6.0'
|
||||
//okhttp
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
//Retrofit
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
@@ -227,7 +227,7 @@ dependencies {
|
||||
//更换字体框架
|
||||
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
|
||||
//工具类
|
||||
implementation 'com.blankj:utilcodex:1.31.0'
|
||||
implementation 'com.blankj:utilcodex:1.31.1'
|
||||
//沉浸状态栏
|
||||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
public class DetailsActivity extends BaseActivity {
|
||||
private static final String TAG = DetailsActivity.class.getSimpleName();
|
||||
|
||||
|
||||
@BindView(R.id.detail_tv_title)
|
||||
TextView tv_title;
|
||||
@BindView(R.id.detail_tv_name)
|
||||
@@ -86,6 +85,9 @@ public class DetailsActivity extends BaseActivity {
|
||||
private installReceiver myReceiver;
|
||||
private AppInfo appInfo;
|
||||
|
||||
boolean installed;
|
||||
boolean update;
|
||||
|
||||
@Override
|
||||
protected int setLayoutResourceID() {
|
||||
return R.layout.activity_details;
|
||||
@@ -94,16 +96,13 @@ public class DetailsActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void initView() {
|
||||
ButterKnife.bind(this);
|
||||
Aria.download(this).register();
|
||||
rv_image.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
CustomSnapHelper snapHelper = new CustomSnapHelper();
|
||||
snapHelper.attachToRecyclerView(rv_image);
|
||||
imageAdapter = new ImageAdapter();
|
||||
rv_image.setAdapter(imageAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
Aria.download(this).register();
|
||||
appInfo = (AppInfo) getIntent().getSerializableExtra("appinfo");
|
||||
if (appInfo == null) {
|
||||
ToastUtil.show("获取引用信息失败,返回重试");
|
||||
@@ -111,12 +110,6 @@ public class DetailsActivity extends BaseActivity {
|
||||
} else {
|
||||
getPackageApp(appInfo.getApp_package(), appInfo.getApp_version_code());
|
||||
}
|
||||
// final DownloadTask downloadTask = OkDownload.getInstance().getTask(appInfo.getApp_url());
|
||||
// if (downloadTask != null) {
|
||||
// downloadTask.register(new FileDownloadListener(appInfo.getApp_url()));
|
||||
// refresh(downloadTask.progress);
|
||||
// }
|
||||
// tv_title.setText(appInfo.getApp_name());
|
||||
tv_name.setText(appInfo.getApp_name());
|
||||
tv_company.setText(appInfo.getApp_developer());
|
||||
detali_tv_size.setText("大小\t" + "(" + StorageUtils.byteToMB(appInfo.getApp_size()) + ")");
|
||||
@@ -127,10 +120,13 @@ public class DetailsActivity extends BaseActivity {
|
||||
detali_tv_version.setText("版本:" + appInfo.getApp_version_name());
|
||||
rating_bar.setRating((float) appInfo.getApp_score());
|
||||
Glide.with(this).asBitmap().load(appInfo.getApp_img()).transform(new GlideCircleWithBorder(this)).into(iv_icon);
|
||||
|
||||
setImage(appInfo);
|
||||
final boolean installed = ApkUtils.isInstalled(DetailsActivity.this, appInfo.getApp_package());
|
||||
final boolean update = ApkUtils.isUpdate(DetailsActivity.this, appInfo.getApp_package(), appInfo.getApp_version_code());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
installed = ApkUtils.isInstalled(DetailsActivity.this, appInfo.getApp_package());
|
||||
update = ApkUtils.isUpdate(DetailsActivity.this, appInfo.getApp_package(), appInfo.getApp_version_code());
|
||||
if (installed) {
|
||||
if (update) {
|
||||
tv_download.setText("更新" + "(" + StorageUtils.byteToMB(appInfo.getApp_size()) + ")");
|
||||
@@ -358,6 +354,7 @@ public class DetailsActivity extends BaseActivity {
|
||||
if (packageName.equalsIgnoreCase(appInfo.getApp_package())) {
|
||||
tv_download.setText("打开");
|
||||
}
|
||||
initData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.uiui.appstore.activity;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -29,9 +28,10 @@ import com.uiui.appstore.fragment.FeaturedFragment;
|
||||
import com.uiui.appstore.fragment.ManageFragment;
|
||||
import com.uiui.appstore.network.NetInterfaceManager;
|
||||
import com.uiui.appstore.service.GuardService;
|
||||
import com.uiui.appstore.service.main.MainService;
|
||||
import com.uiui.appstore.service.MyDownloadService;
|
||||
import com.uiui.appstore.service.StepService;
|
||||
import com.uiui.appstore.service.main.MainService;
|
||||
import com.uiui.appstore.utils.JGYUtils;
|
||||
import com.uiui.appstore.utils.SPUtils;
|
||||
import com.uiui.appstore.utils.ToastUtil;
|
||||
import com.uiui.appstore.utils.Utils;
|
||||
@@ -40,9 +40,9 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getUserInfo();
|
||||
// getUserInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,8 +183,7 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void hasPermission(List<String> granted, boolean isAll) {
|
||||
if (isAll) {
|
||||
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "POStemp";
|
||||
File file = new File(path);
|
||||
File file = new File(JGYUtils.getInstance().getDownLoadPath());
|
||||
file.mkdirs();
|
||||
} else {
|
||||
ToastUtil.show("需要授予所有权限才能正常使用本程序!");
|
||||
@@ -224,8 +223,7 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
synchronized private void getUserInfo() {
|
||||
private void getUserInfo() {
|
||||
NetInterfaceManager.getInstance().getuserInfoControl().getUserinfo(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@@ -275,7 +273,6 @@ public class MainActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void getAllAppPackageName() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getQueryAllAppObservable()
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.uiui.appstore.activity;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
@@ -9,6 +10,7 @@ import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -21,11 +23,14 @@ import com.uiui.appstore.base.BaseActivity;
|
||||
import com.uiui.appstore.bean.AppInfo;
|
||||
import com.uiui.appstore.bean.BaseResponse;
|
||||
import com.uiui.appstore.network.NetInterfaceManager;
|
||||
import com.uiui.appstore.utils.ToastUtil;
|
||||
import com.uiui.appstore.utils.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
@@ -33,31 +38,36 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
|
||||
public class SearcherActivity extends BaseActivity {
|
||||
private String TAG = SearcherActivity.class.getSimpleName();
|
||||
// private SearchView search;
|
||||
private static final String TAG = SearcherActivity.class.getSimpleName();
|
||||
private List<AppInfo> mAppInfoList = new ArrayList<>();
|
||||
private RecyclerView recyclerView;
|
||||
private AppAdapter madapter;
|
||||
private EditText edit_search;
|
||||
|
||||
@BindView(R.id.recyclerView)
|
||||
RecyclerView recyclerView;
|
||||
@BindView(R.id.edit_search)
|
||||
EditText edit_search;
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
|
||||
// @BindView(R.id.search)
|
||||
// SearchView search;
|
||||
|
||||
AppAdapter madapter;
|
||||
|
||||
@Override
|
||||
protected int setLayoutResourceID() {
|
||||
return R.layout.activity_searcher;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
// search = findViewById(R.id.search);
|
||||
ButterKnife.bind(this);
|
||||
// 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.setTextColor(Color.BLACK);
|
||||
// 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,18 +98,32 @@ public class SearcherActivity extends BaseActivity {
|
||||
edit_search.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEND || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
||||
//do something;
|
||||
((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);
|
||||
if (actionId == EditorInfo.IME_ACTION_SEND ||
|
||||
(event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
||||
switch (event.getAction()) {
|
||||
case KeyEvent.ACTION_UP:
|
||||
//do it
|
||||
if (actionId == EditorInfo.IME_ACTION_SEND || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
||||
//do something;
|
||||
((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 {
|
||||
int setting_admin_app = Settings.System.getInt(getContentResolver(), "setting_admin_app", 1);
|
||||
if (setting_admin_app == 0) {
|
||||
ToastUtil.debugShow("搜索功能已禁用");
|
||||
} else {
|
||||
searcheApp(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -115,36 +139,38 @@ public class SearcherActivity extends BaseActivity {
|
||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
Log.e("searcheApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||
Log.e("searcheApp", "onNext: " + 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>());
|
||||
madapter.setData(new ArrayList<>());
|
||||
ToastUtil.show("没有搜索到相关应用");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
Log.e("searcheApp", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
Log.e("searcheApp", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getAllAppPackageName() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getQueryAllAppObservable()
|
||||
NetInterfaceManager.getInstance()
|
||||
.getQueryAllAppObservable()
|
||||
.subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -175,23 +201,8 @@ public class SearcherActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void finish(View view) {
|
||||
finish();
|
||||
}
|
||||
|
||||
private Handler handler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(@NonNull Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
case 1:
|
||||
mAppInfoList = (List<AppInfo>) msg.obj;
|
||||
madapter.setData(mAppInfoList);
|
||||
madapter.notifyDataSetChanged();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.Holder> {
|
||||
mDownloadTask = task;
|
||||
// notifyDataSetChanged();
|
||||
for (int i = 0; i < mAppInfoList.size(); i++) {
|
||||
if (mAppInfoList.get(i).getApp_url().equals(task.getKey())) {
|
||||
if (mAppInfoList.get(i).getApp_url().equals(task.getEntity().getUrl())) {
|
||||
notifyItemChanged(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.uiui.appstore.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.uiui.appstore.R;
|
||||
import com.uiui.appstore.bean.AppClassBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ClassAdapter extends RecyclerView.Adapter<ClassAdapter.Holder> {
|
||||
private List<AppClassBean> mAppClassList;
|
||||
private Context mContext;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new Holder(LayoutInflater.from(mContext).inflate(R.layout.item_app_class, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
AppClassBean appClassBean = mAppClassList.get(position);
|
||||
Glide.with(mContext).load(appClassBean.getImg_url()).error(R.drawable.ic_app).into(holder.mImageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mAppClassList == null ? 0 : mAppClassList.size();
|
||||
}
|
||||
|
||||
public void setAppClassList(List<AppClassBean> appClassList) {
|
||||
this.mAppClassList = appClassList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void claerAppClassList() {
|
||||
this.mAppClassList = null;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
class Holder extends RecyclerView.ViewHolder {
|
||||
ImageView mImageView;
|
||||
|
||||
public Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mImageView = itemView.findViewById(R.id.item_iv);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.uiui.appstore.base;
|
||||
|
||||
import android.os.Environment;
|
||||
|
||||
public class FilePath {
|
||||
public static final String FileDownloadPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath();
|
||||
|
||||
}
|
||||
34
app/src/main/java/com/uiui/appstore/bean/AppClassBean.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.uiui.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppClassBean implements Serializable {
|
||||
private static final long serialVersionUID = -6605991530026729506L;
|
||||
int id;
|
||||
String name;
|
||||
String img_url;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getImg_url() {
|
||||
return img_url;
|
||||
}
|
||||
|
||||
public void setImg_url(String img_url) {
|
||||
this.img_url = img_url;
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
|
||||
import com.uiui.appstore.R;
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
|
||||
import com.uiui.appstore.R;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
@@ -37,6 +37,7 @@ public class GlideCircleWithBorder extends BitmapTransformation {
|
||||
// mBorderPaint.setStrokeWidth(mBorderWidth);
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
|
||||
return circleCrop(pool, toTransform);
|
||||
}
|
||||
@@ -90,15 +91,15 @@ public class GlideCircleWithBorder extends BitmapTransformation {
|
||||
paint2.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
canvas2.drawBitmap(result, 0, 0, paint2);
|
||||
|
||||
Bitmap bitmapshadow =BitmapFactory.decodeResource(mContext.getResources(), R.drawable.mask_shadow);
|
||||
Bitmap bitmap=Bitmap.createScaledBitmap(bitmapshadow,width+2,height+2,true);
|
||||
Canvas canvas3=new Canvas();
|
||||
Paint paint3=new Paint();
|
||||
canvas3.setBitmap(bitmap);
|
||||
canvas3.drawBitmap(bitmapshadow,0,0,paint3);
|
||||
canvas3.drawBitmap(result2,1,1,paint3);
|
||||
// Bitmap bitmapshadow = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.mask_shadow);
|
||||
// Bitmap bitmap = Bitmap.createScaledBitmap(bitmapshadow, width + 2, height + 2, true);
|
||||
// Canvas canvas3 = new Canvas();
|
||||
// Paint paint3 = new Paint();
|
||||
// canvas3.setBitmap(bitmap);
|
||||
// canvas3.drawBitmap(bitmapshadow, 0, 0, paint3);
|
||||
// canvas3.drawBitmap(result2, 1, 1, paint3);
|
||||
|
||||
return bitmap;
|
||||
return result2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
@@ -24,16 +25,18 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.uiui.appstore.BuildConfig;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.uiui.appstore.R;
|
||||
import com.uiui.appstore.activity.HintActivity;
|
||||
import com.uiui.appstore.adapter.AppAdapter;
|
||||
import com.uiui.appstore.adapter.BannerViewHolder;
|
||||
import com.uiui.appstore.base.LazyLoadFragment;
|
||||
import com.uiui.appstore.base.RefreshManager;
|
||||
import com.uiui.appstore.bean.AppClassBean;
|
||||
import com.uiui.appstore.bean.AppInfo;
|
||||
import com.uiui.appstore.bean.AppInfos;
|
||||
import com.uiui.appstore.bean.Banner;
|
||||
@@ -42,9 +45,6 @@ import com.uiui.appstore.bean.ImageUrl;
|
||||
import com.uiui.appstore.network.NetInterfaceManager;
|
||||
import com.uiui.appstore.utils.LogUtils;
|
||||
import com.uiui.appstore.utils.Utils;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.zhpan.bannerview.BannerViewPager;
|
||||
import com.zhpan.bannerview.constants.IndicatorSlideMode;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
@@ -56,9 +56,9 @@ import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
@@ -68,7 +68,8 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
*/
|
||||
|
||||
public class FeaturedFragment extends LazyLoadFragment implements RefreshManager.RefreshInterface {
|
||||
private String TAG = FeaturedFragment.class.getSimpleName();
|
||||
private static final String TAG = FeaturedFragment.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.featured_rv_result)
|
||||
RecyclerView mRvResult;
|
||||
@BindView(R.id.cl)
|
||||
@@ -81,10 +82,21 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
ImageView iv_nodata;
|
||||
@BindView(R.id.banner_view)
|
||||
BannerViewPager<String, BannerViewHolder> mViewPager;
|
||||
@BindView(R.id.iv_0)
|
||||
ImageView iv_0;
|
||||
@BindView(R.id.iv_1)
|
||||
ImageView iv_1;
|
||||
@BindView(R.id.iv_2)
|
||||
ImageView iv_2;
|
||||
@BindView(R.id.iv_3)
|
||||
ImageView iv_3;
|
||||
@BindView(R.id.iv_4)
|
||||
ImageView iv_4;
|
||||
|
||||
|
||||
private List<AppInfos> appInfoList;//
|
||||
private List<AppInfo> newAppInfoList = new ArrayList<>();
|
||||
private AppAdapter adapter;
|
||||
private AppAdapter mAppAdapter;
|
||||
private boolean isNotLoadBitmap;
|
||||
|
||||
public FeaturedFragment() {
|
||||
@@ -131,8 +143,8 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
|
||||
@Override
|
||||
public void initDatas() {
|
||||
adapter = new AppAdapter(newAppInfoList, getActivity());
|
||||
adapter.setHasStableIds(true);
|
||||
mAppAdapter = new AppAdapter(newAppInfoList, getActivity());
|
||||
mAppAdapter.setHasStableIds(true);
|
||||
int orientation = 0;
|
||||
orientation = getActivity().getResources().getConfiguration().orientation;
|
||||
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
@@ -144,11 +156,11 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
} else {
|
||||
mRvResult.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
}
|
||||
mRvResult.setAdapter(adapter);
|
||||
mRvResult.setAdapter(mAppAdapter);
|
||||
mRefreshLayout.setEnableLoadMore(false);
|
||||
mRefreshLayout.setEnableRefresh(true);
|
||||
mRefreshLayout.setOnRefreshListener(refreshlayout -> initAPPData());
|
||||
adapter.setData(newAppInfoList);
|
||||
mAppAdapter.setData(newAppInfoList);
|
||||
mRefreshLayout.autoRefresh();
|
||||
}
|
||||
|
||||
@@ -177,7 +189,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
registerReceiver();
|
||||
adapter.notifyDataSetChanged();
|
||||
mAppAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,7 +228,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
|| action.equals(Intent.ACTION_PACKAGE_REPLACED)
|
||||
|| action.equals(Intent.ACTION_PACKAGE_REMOVED)) {
|
||||
// adapter.setData(checkUpdateOrInstalled(newAppInfoList));
|
||||
adapter.notifyDataSetChanged();
|
||||
mAppAdapter.notifyDataSetChanged();
|
||||
Log.e("installReceiver", action);
|
||||
}
|
||||
|
||||
@@ -231,6 +243,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
getAdminApp();
|
||||
}
|
||||
getBanner();
|
||||
getAppClass();
|
||||
}
|
||||
|
||||
private void getBanner() {
|
||||
@@ -422,6 +435,57 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
});
|
||||
}
|
||||
|
||||
private void getAppClass() {
|
||||
NetInterfaceManager.getInstance().getAdminAppClassObservable()
|
||||
.subscribe(new Observer<BaseResponse<List<AppClassBean>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppClass", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<AppClassBean>> listBaseResponse) {
|
||||
Log.e("getAppClass", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AppClassBean> appClassList = listBaseResponse.data;
|
||||
if (appClassList != null && appClassList.size() != 0) {
|
||||
setClass(appClassList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppClass", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppClass", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setClass(List<AppClassBean> appClassList) {
|
||||
if (appClassList == null || appClassList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < appClassList.size(); i++) {
|
||||
AppClassBean appClassBean = appClassList.get(i);
|
||||
int imageviewId = getActivity().getResources().getIdentifier("iv_" + (i), "id", getActivity().getPackageName());
|
||||
int textviewId = getActivity().getResources().getIdentifier("tv_" + (i), "id", getActivity().getPackageName());
|
||||
ImageView imageView = getActivity().findViewById(imageviewId);
|
||||
try {
|
||||
TextView textView = getActivity().findViewById(textviewId);
|
||||
Glide.with(getActivity()).load(appClassBean.getImg_url()).error(R.drawable.ic_app).into(imageView);
|
||||
textView.setText(appClassBean.getName());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setClass: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setAllAppdata(BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||
int code = listBaseResponse.code;
|
||||
if (code == 200) {
|
||||
@@ -429,8 +493,8 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
newAppInfoList = infos;
|
||||
mRvResult.setVisibility(View.VISIBLE);
|
||||
iv_nodata.setVisibility(View.GONE);
|
||||
adapter.setData(newAppInfoList);
|
||||
adapter.notifyDataSetChanged();
|
||||
mAppAdapter.setData(newAppInfoList);
|
||||
mAppAdapter.notifyDataSetChanged();
|
||||
} else {
|
||||
mRvResult.setVisibility(View.GONE);
|
||||
iv_nodata.setImageDrawable(getActivity().getDrawable(R.drawable.app_nodata));
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.tencent.android.tpush.XGPushManager;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiui.appstore.bean.AppClassBean;
|
||||
import com.uiui.appstore.bean.AppInfo;
|
||||
import com.uiui.appstore.bean.Banner;
|
||||
import com.uiui.appstore.bean.BaseResponse;
|
||||
@@ -20,10 +21,10 @@ import com.uiui.appstore.gson.GsonUtils;
|
||||
import com.uiui.appstore.manager.ConnectManager;
|
||||
import com.uiui.appstore.manager.ConnectMode;
|
||||
import com.uiui.appstore.network.api.AdminApp;
|
||||
import com.uiui.appstore.network.api.AdminAppClassApi;
|
||||
import com.uiui.appstore.network.api.BannerImage;
|
||||
import com.uiui.appstore.network.api.DownloadApp;
|
||||
import com.uiui.appstore.network.api.GetBanner;
|
||||
import com.uiui.appstore.network.api.GetBatchApi;
|
||||
import com.uiui.appstore.network.api.NewestAppUpdate;
|
||||
import com.uiui.appstore.network.api.QueryAllApp;
|
||||
import com.uiui.appstore.network.api.QueryPackageApp;
|
||||
@@ -139,9 +140,10 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
|
||||
public SNInfo getuserInfoControl() {
|
||||
return mRetrofit.create(SNInfo.class);
|
||||
public Observable<BaseResponse<List<AppInfo>>> getAdminAppObservable() {
|
||||
return mRetrofit.create(AdminApp.class).getAdminApp()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<AppInfo>>> getQueryAllAppObservable() {
|
||||
@@ -151,6 +153,17 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<AppClassBean>>> getAdminAppClassObservable() {
|
||||
return mRetrofit.create(AdminAppClassApi.class)
|
||||
.getAdminAppClassApi()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public SNInfo getuserInfoControl() {
|
||||
return mRetrofit.create(SNInfo.class);
|
||||
}
|
||||
|
||||
public SearchApp getSearchAppControl() {
|
||||
return mRetrofit.create(SearchApp.class);
|
||||
}
|
||||
@@ -171,51 +184,11 @@ public class NetInterfaceManager {
|
||||
return mRetrofit.create(QueryPackageApp.class);
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<AppInfo>>> getAdminAppObservable() {
|
||||
return mRetrofit.create(AdminApp.class).getAdminApp()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<BatchID>> getBatchApiControl() {
|
||||
return mRetrofit.create(GetBatchApi.class)
|
||||
.getBatch(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public interface onCompleteCallback {
|
||||
void onComplete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置推送标签
|
||||
*
|
||||
* @param lifecycle
|
||||
* @param callback
|
||||
*/
|
||||
public void setPushTags(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||
ConnectMode connectMode = ConnectMode.SIX_HOUR;
|
||||
if (refresh) {
|
||||
connectMode = ConnectMode.ONE_HOUR;
|
||||
}
|
||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_BATCH, connectMode)) {
|
||||
setPushTags(lifecycle, callback);
|
||||
} else {
|
||||
String jsonString = cacheHelper.getAsString(UrlAddress.GET_BATCH);
|
||||
//为 "" 是已经请求成功的
|
||||
if (jsonString == null) {
|
||||
setPushTags(lifecycle, callback);
|
||||
} else {
|
||||
Set tagSets = mMMKV.decodeStringSet(UrlAddress.GET_BATCH);
|
||||
Log.e("setPushTags", "tagSets: " + tagSets);
|
||||
clearAndAppendTags(tagSets);
|
||||
callback.onComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setPushTags(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||
public void setPushTags(onCompleteCallback callback) {
|
||||
Set set = new HashSet();
|
||||
JGYUtils.getInstance().getAppPlatform(platform -> {
|
||||
if (platform == JGYUtils.MTKPlatform) {
|
||||
@@ -228,47 +201,8 @@ public class NetInterfaceManager {
|
||||
set.add(JGYUtils.UMTK11Tag);
|
||||
}
|
||||
});
|
||||
getBatchApiControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<BatchID>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("setPushTags", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<BatchID> response) {
|
||||
Log.e("setPushTags", "onNext: " + response);
|
||||
if (response.code == 200) {
|
||||
BatchID batchID = response.data;
|
||||
String batch = batchID.getBatch_id();
|
||||
Log.e("setPushTags", "onNext: " + batch);
|
||||
if (!TextUtils.isEmpty(batch)) {
|
||||
set.add(batch);
|
||||
} else {
|
||||
Log.e("setPushTags", "onNext: " + "batch empty");
|
||||
}
|
||||
cacheHelper.put(UrlAddress.GET_BATCH, GsonUtils.toJSONString(response.data));
|
||||
} else {
|
||||
cacheHelper.put(UrlAddress.GET_BATCH, "");
|
||||
}
|
||||
mMMKV.encode(UrlAddress.GET_BATCH, set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("setPushTags", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("setPushTags", "onComplete: ");
|
||||
Log.e("setPushTags", "tagSets: " + set);
|
||||
clearAndAppendTags(set);
|
||||
callback.onComplete();
|
||||
}
|
||||
});
|
||||
clearAndAppendTags(set);
|
||||
callback.onComplete();
|
||||
}
|
||||
|
||||
private void clearAndAppendTags(Set tagSets) {
|
||||
|
||||
@@ -1,40 +1,21 @@
|
||||
package com.uiui.appstore.network;
|
||||
|
||||
public class UrlAddress {
|
||||
public final static String ROOT_URL = "https://led.zuoyepad.com/android/";
|
||||
|
||||
/*获取批次*/
|
||||
public static final String GET_BATCH = "sn/getBatch";
|
||||
final static String ROOT_URL = "https://led.zuoyepad.com/android/";
|
||||
|
||||
//获取所有应用
|
||||
public final static String GET_ALL_APPINFO = "app/queryAllApp";
|
||||
//获取管理员应用分类
|
||||
public final static String GET_ADMIN_APP_CLASS = "app/getAdminAppClass";
|
||||
//获取管理员所有应用
|
||||
public final static String GET_ADMIN_APP = "getAdminApp";
|
||||
//获取应用详情
|
||||
public final static String GET_PACKAGE_APP = "app/queryPackageApp";
|
||||
//获取所有应用排行
|
||||
public final static String GET_ALL_RANK = "App/rankings";
|
||||
//搜索应用
|
||||
public final static String GET_APPSEARCHE = "App/appSearch";
|
||||
//通过SN获取绑定信息
|
||||
public final static String GET_INFO_FROMESN = "sn/getSnInfo";
|
||||
//app分类查询
|
||||
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";
|
||||
//根据包名获取更新
|
||||
public final static String GET_APP_UPDATE = "Update/update";
|
||||
//获取banner图
|
||||
public final static String GET_BANNER_IMG = "app/getBrand";
|
||||
public final static String GET_BANNER = "sn/getBanner";
|
||||
|
||||
//获取所有应用包名
|
||||
public final static String GET_ALL_PACKAGENAME = "App/allPackageSn";
|
||||
//获取应用分类
|
||||
public final static String GET_SUBClASSFY = "Application/getSubClassfy";
|
||||
|
||||
public final static String SEND_DOWNLOADAPP = "app/downloadApp";
|
||||
//根据包名获取更新
|
||||
public final static String GET_NEWESTAPPUPDATE = "app/newestAppUpdate";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.uiui.appstore.network.api;
|
||||
|
||||
import com.uiui.appstore.bean.AppClassBean;
|
||||
import com.uiui.appstore.bean.BaseResponse;
|
||||
import com.uiui.appstore.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
|
||||
public interface AdminAppClassApi {
|
||||
@GET(UrlAddress.GET_ADMIN_APP_CLASS)
|
||||
Observable<BaseResponse<List<AppClassBean>>> getAdminAppClassApi();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.uiui.appstore.network.api;
|
||||
|
||||
import com.uiui.appstore.bean.BaseResponse;
|
||||
import com.uiui.appstore.bean.BatchID;
|
||||
import com.uiui.appstore.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetBatchApi {
|
||||
@GET(UrlAddress.GET_BATCH)
|
||||
Observable<BaseResponse<BatchID>> getBatch(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getSnTag() {
|
||||
NetInterfaceManager.getInstance().setPushTags(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
NetInterfaceManager.getInstance().setPushTags(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setSnTag();
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
|
||||
import com.uiui.appstore.KeepAliveConnection;
|
||||
import com.uiui.appstore.network.HTTPInterface;
|
||||
import com.uiui.appstore.utils.JGYUtils;
|
||||
import com.uiui.appstore.utils.SPUtils;
|
||||
import com.uiui.appstore.utils.ToastUtil;
|
||||
|
||||
@@ -32,13 +33,10 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
public class MainService extends Service implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
||||
private static final String TAG = MainService.class.getSimpleName();
|
||||
|
||||
private final String DOWNLOAD_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + File.separator + "uiui";
|
||||
|
||||
public MainSPresenter mPresenter;
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
Log.e(TAG, "网络未连接");
|
||||
@@ -49,6 +47,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
Log.e(TAG, "网络已连接");
|
||||
ToastUtil.show("网络已连接");
|
||||
HTTPInterface.checkUpdate(MainService.this);
|
||||
HTTPInterface.checkUpdate(MainService.this, "com.uiui.sn");
|
||||
mPresenter.getSnTag();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
start.onstar(System.currentTimeMillis());
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
@@ -96,10 +95,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
mPresenter.attachView(this);
|
||||
NetworkUtils.registerNetworkStatusChangedListener(this);
|
||||
|
||||
Observable.create(subscribe)
|
||||
.throttleFirst(3, TimeUnit.HOURS)
|
||||
.subscribe(timeObserver);
|
||||
File file = new File(DOWNLOAD_PATH);
|
||||
File file = new File(JGYUtils.getInstance().getDownLoadPath());
|
||||
if (file.isFile() || !file.exists()) {
|
||||
file.delete();
|
||||
file.mkdirs();
|
||||
@@ -115,51 +111,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
mPresenter.detachView();
|
||||
}
|
||||
|
||||
private interface Start {
|
||||
void onstar(long time);
|
||||
}
|
||||
|
||||
private Start start;
|
||||
|
||||
private final ObservableOnSubscribe<Long> subscribe = new ObservableOnSubscribe<Long>() {
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter emitter) throws Exception {
|
||||
start = new Start() {
|
||||
@Override
|
||||
public void onstar(long time) {
|
||||
emitter.onNext(time);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
private Observer<Long> timeObserver = new Observer<Long>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("TimeObserver", "Disposable: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Long aLong) {
|
||||
Log.e("TimeObserver", "onNext: " + aLong);
|
||||
int isLogined = (int) SPUtils.get(MainService.this, "isLogined", 2);
|
||||
if (isLogined == 2) return;
|
||||
HTTPInterface.checkUpdate(MainService.this);
|
||||
HTTPInterface.checkUpdate(MainService.this, "com.uiui.sn");
|
||||
// HTTPInterface.checkUpdate(InitJpushServer.this, "com.uiui.os");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("TimeObserver", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("TimeObserver", "onComplete: ");
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void setSnTag() {
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.tencent.android.tpush.XGPushTextMessage;
|
||||
import com.uiui.appstore.tpush.common.NotificationService;
|
||||
import com.uiui.appstore.tpush.po.XGNotification;
|
||||
import com.uiui.appstore.utils.FileUtils;
|
||||
import com.uiui.appstore.utils.JGYUtils;
|
||||
import com.uiui.appstore.utils.ToastUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -337,7 +338,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
Aria.download(this).load(downloadEntity.getId()).cancel(true);
|
||||
}
|
||||
}
|
||||
File file = new File(Environment.getExternalStoragePublicDirectory("Download") + "/Sninfo/apk");
|
||||
File file = new File(JGYUtils.getInstance().getDownLoadPath());
|
||||
file.mkdirs();
|
||||
FileUtils.ariaDownload(context, url, jsonObject);
|
||||
Aria.download(this).resumeAllTask();
|
||||
|
||||
@@ -3,10 +3,9 @@ package com.uiui.appstore.utils;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.uiui.appstore.base.FilePath;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -28,7 +27,7 @@ public class FileUtils {
|
||||
/**
|
||||
* 获取单个文件的MD5值
|
||||
*
|
||||
* @param file 文件
|
||||
* @param file 文件
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -58,11 +57,11 @@ public class FileUtils {
|
||||
public static void ariaDownload(Context context, String url, JsonObject jsonObject) {
|
||||
String fileName = getFileNamefromURL(url);
|
||||
JsonElement jsonElement = jsonObject.get("MD5");
|
||||
if (jsonElement!=null){
|
||||
if (jsonElement != null) {
|
||||
String urlMD5 = jsonElement.getAsString();
|
||||
Log.e("ariaDownload", "urlMD5=" + urlMD5);
|
||||
}
|
||||
File file = new File(FilePath.FileDownloadPath + "/uiui/" + fileName);
|
||||
File file = new File(JGYUtils.getInstance().getDownLoadPath());
|
||||
if (file.exists() && !file.isDirectory()) {
|
||||
String filenameMD5 = getMD5fromFileName(url);
|
||||
|
||||
@@ -75,16 +74,16 @@ public class FileUtils {
|
||||
} else {
|
||||
Aria.download(context)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(FilePath.FileDownloadPath + "/uiui/" + fileName, true)
|
||||
.setFilePath(JGYUtils.getInstance().getDownLoadPath() + fileName)
|
||||
.ignoreFilePathOccupy()
|
||||
.setExtendField(jsonObject.toString())
|
||||
.create(); //启动下载}
|
||||
// SaveListUtils.addDownLoadList(app_package);
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
Aria.download(context)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(FilePath.FileDownloadPath + "/uiui/" + fileName, true)
|
||||
.setFilePath(JGYUtils.getInstance().getDownLoadPath() + fileName)
|
||||
.ignoreFilePathOccupy()
|
||||
.setExtendField(jsonObject.toString())
|
||||
.create(); //启动下载}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,19 @@ import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.uiui.appstore.BuildConfig;
|
||||
import com.uiui.appstore.receiver.BootReceiver;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -63,6 +67,11 @@ public class JGYUtils {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public String getDownLoadPath() {
|
||||
String path = ContextCompat.getExternalFilesDirs(mContext, Environment.DIRECTORY_DOWNLOADS)[0].getAbsolutePath();
|
||||
return path + File.separator;
|
||||
}
|
||||
|
||||
public static boolean isOfficialVersion() {
|
||||
String channelValue = JGYUtils.getInstance().getStringMetaData();
|
||||
return "official".equals(channelValue);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.uiui.appstore.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 定义水平方向的距离
|
||||
*/
|
||||
public class HorizontalItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private int space;//定义2个Item之间的距离
|
||||
|
||||
public HorizontalItemDecoration(int space, Context mContext) {
|
||||
this.space = dip2px(space, mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
int position = parent.getChildAdapterPosition(view);
|
||||
int totalCount = parent.getAdapter().getItemCount();
|
||||
if (position == 0) {//第一个
|
||||
outRect.left = space;
|
||||
outRect.right = space / 2;
|
||||
} else if (position == totalCount - 1) {//最后一个
|
||||
outRect.left = space / 2;
|
||||
outRect.right = space;
|
||||
} else {//中间其它的
|
||||
outRect.left = space / 2;
|
||||
outRect.right = space / 2;
|
||||
}
|
||||
}
|
||||
|
||||
public int dip2px(float dpValue, Context context) {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dpValue * scale + 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable-xhdpi/icon_0.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_1.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_2.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_3.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_4.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 150 KiB |
@@ -1,52 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayout4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="finish"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
android:src="@drawable/ic_back"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="应用详情"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/activity_font_size"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/search_iv_back" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/white"
|
||||
android:overScrollMode="never">
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toTopOf="@id/constraintLayout2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout4">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -132,15 +136,14 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:background="@color/white"
|
||||
android:overScrollMode="never" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="应用介绍"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
@@ -150,16 +153,16 @@
|
||||
android:id="@+id/detali_tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15" />
|
||||
android:layout_marginRight="@dimen/dp_16" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="更新"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
@@ -169,16 +172,16 @@
|
||||
android:id="@+id/detali_tv_update"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15" />
|
||||
android:layout_marginRight="@dimen/dp_16" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="信息"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
@@ -189,7 +192,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
@@ -199,8 +202,8 @@
|
||||
android:id="@+id/detail_tv_version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="版本"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -208,8 +211,8 @@
|
||||
android:id="@+id/detail_tv_update_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="时间"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -217,19 +220,19 @@
|
||||
android:id="@+id/detail_tv_Developers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="开发者"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/detail_tv_download"
|
||||
@@ -242,6 +245,10 @@
|
||||
android:stateListAnimator="@null"
|
||||
android:text="安装"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -9,61 +9,66 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/activity_title_height"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="finish"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/search_ll"
|
||||
<RelativeLayout
|
||||
android:id="@+id/search_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:visibility="visible">
|
||||
|
||||
|
||||
<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/ic_menu_search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_search"
|
||||
<LinearLayout
|
||||
android:id="@+id/search_ll"
|
||||
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">
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
</EditText>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/shap_search_left" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@color/search"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_menu_search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:background="@drawable/shap_search_right"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/search_edit"
|
||||
android:padding="@dimen/dp_2"
|
||||
android:textColor="#a7a5a5"
|
||||
android:textSize="@dimen/sp_9" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -48,12 +48,181 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/banner_view">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rv_class"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_0"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_0"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="购物"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_0" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_1"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="热门"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_1" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_2"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="养生"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_3"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="影音"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_4"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="娱乐"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_4" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/featured_rv_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never" />
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv_class" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_nodata"
|
||||
|
||||
@@ -1,69 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayout4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="finish"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
android:src="@drawable/ic_back"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="应用详情"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/activity_font_size"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/search_iv_back" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/white"
|
||||
android:overScrollMode="never">
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toTopOf="@id/constraintLayout2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout4">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="5dp">
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_4">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/detail_iv_icon"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@mipmap/ic_launcher" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -92,8 +96,8 @@
|
||||
style="@style/myRatingBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:isIndicator="true"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:isIndicator="true"
|
||||
android:rating="3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_tv_name" />
|
||||
@@ -110,8 +114,8 @@
|
||||
android:id="@+id/detali_tv_version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="版本"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="版本"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detali_tv_size" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
@@ -129,9 +133,8 @@
|
||||
android:id="@+id/detail_rv_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never" />
|
||||
</HorizontalScrollView>
|
||||
@@ -139,8 +142,8 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="应用介绍"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
@@ -150,16 +153,16 @@
|
||||
android:id="@+id/detali_tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15" />
|
||||
android:layout_marginRight="@dimen/dp_16" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="更新"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
@@ -169,16 +172,16 @@
|
||||
android:id="@+id/detali_tv_update"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15" />
|
||||
android:layout_marginRight="@dimen/dp_16" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="信息"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
@@ -189,7 +192,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
@@ -199,8 +202,8 @@
|
||||
android:id="@+id/detail_tv_version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="版本"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -208,8 +211,8 @@
|
||||
android:id="@+id/detail_tv_update_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="时间"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -217,19 +220,19 @@
|
||||
android:id="@+id/detail_tv_Developers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:text="开发者"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/detail_tv_download"
|
||||
@@ -242,7 +245,11 @@
|
||||
android:stateListAnimator="@null"
|
||||
android:text="安装"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
</RelativeLayout>
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -9,61 +9,66 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/activity_title_height"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="finish"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/search_ll"
|
||||
<RelativeLayout
|
||||
android:id="@+id/search_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:visibility="visible">
|
||||
|
||||
|
||||
<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/ic_menu_search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_search"
|
||||
<LinearLayout
|
||||
android:id="@+id/search_ll"
|
||||
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">
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
</EditText>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/shap_search_left" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@color/search"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_menu_search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_search"
|
||||
android:padding="@dimen/dp_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:background="@drawable/shap_search_right"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/search_edit"
|
||||
android:textColor="#a7a5a5"
|
||||
android:textSize="@dimen/sp_9" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -48,6 +48,171 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/banner_view">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rv_class"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_0"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_0"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="购物"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_0" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_1"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="热门"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_1" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_2"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="养生"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_3"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="影音"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_4"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:maxLines="1"
|
||||
android:text="娱乐"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_4" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/featured_rv_result"
|
||||
android:layout_width="match_parent"
|
||||
@@ -57,7 +222,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv_class" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_nodata"
|
||||
|
||||
17
app/src/main/res/layout/item_app_class.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_iv"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||