update:2020.03.06 10.55
217
app/app.iml
Normal file
@@ -1,4 +1,6 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
def appName() {
|
||||
return "UIUIAPPStore"
|
||||
@@ -15,8 +17,8 @@ android {
|
||||
applicationId "com.appstore.uiui"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
versionCode 10
|
||||
versionName "1.1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
//极光
|
||||
ndk {
|
||||
@@ -143,4 +145,12 @@ dependencies {
|
||||
implementation 'cn.jiguang.sdk:jpush:3.4.1' // 此处以JPush 3.4.1 版本为例。
|
||||
implementation 'cn.jiguang.sdk:jcore:2.2.4' // 此处以JCore 2.2.4 版本为例。
|
||||
|
||||
implementation 'com.zhpan.library:bannerview:2.6.4'
|
||||
compile "androidx.core:core-ktx:+"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.appstore.uiui.activity;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RatingBar;
|
||||
import android.widget.TextView;
|
||||
@@ -26,7 +27,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DetailsActivity extends BaseActivity {
|
||||
private TextView tv_title, tv_name, tv_company, tv_update_time, tv_version, tv_content, tv_download;
|
||||
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 RatingBar rating_bar;
|
||||
private ImageView iv_icon;
|
||||
private RecyclerView rv_image;
|
||||
@@ -40,7 +42,7 @@ public class DetailsActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
tv_title = findViewById(R.id.detail_tv_title);
|
||||
// tv_title = findViewById(R.id.detail_tv_title);
|
||||
tv_name = findViewById(R.id.detail_tv_name);
|
||||
tv_company = findViewById(R.id.detail_tv_company);
|
||||
tv_update_time = findViewById(R.id.detail_tv_update_time);
|
||||
@@ -50,6 +52,9 @@ public class DetailsActivity extends BaseActivity {
|
||||
rating_bar = findViewById(R.id.detail_rating_bar);
|
||||
iv_icon = findViewById(R.id.detail_iv_icon);
|
||||
rv_image = findViewById(R.id.detail_rv_image);
|
||||
detali_tv_size = findViewById(R.id.detali_tv_size);
|
||||
detail_tv_Developers = findViewById(R.id.detail_tv_Developers);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,11 +64,13 @@ public class DetailsActivity extends BaseActivity {
|
||||
ToastUtil.show("获取引用信息失败,返回重试");
|
||||
return;
|
||||
}
|
||||
tv_title.setText(appInfo.getApp_name());
|
||||
// tv_title.setText(appInfo.getApp_name());
|
||||
tv_name.setText(appInfo.getApp_name());
|
||||
tv_company.setText(appInfo.getApp_developer());
|
||||
tv_update_time.setText("更新时间:" + appInfo.getCreatetime());
|
||||
tv_version.setText("最新版本:" + appInfo.getApp_version_name());
|
||||
detali_tv_size.setText("大小\t" + appInfo.getApp_size() + "MB");
|
||||
detail_tv_Developers.setText("供应商\t" + appInfo.getApp_developer());
|
||||
tv_update_time.setText("时间\t" + appInfo.getCreatetime());
|
||||
tv_version.setText("版本\t" + appInfo.getApp_version_name());
|
||||
tv_content.setText(appInfo.getApp_desc());
|
||||
rating_bar.setRating((float) appInfo.getApp_score());
|
||||
Glide.with(this).asBitmap().load(appInfo.getApp_img()).into(iv_icon);
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.Adapter;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -27,7 +28,7 @@ public class DownloadManagerActivity extends BaseActivity implements XExecutor.O
|
||||
private RecyclerView recyclerView;
|
||||
private DownloadManagerAdapter adapter;
|
||||
private OkDownload okDownload;
|
||||
|
||||
private ImageView iv_notask;
|
||||
@Override
|
||||
protected int setLayoutResourceID() {
|
||||
return R.layout.activity_download_manager;
|
||||
@@ -36,6 +37,8 @@ public class DownloadManagerActivity extends BaseActivity implements XExecutor.O
|
||||
@Override
|
||||
protected void initView() {
|
||||
recyclerView = findViewById(R.id.recyclerView);
|
||||
iv_notask=findViewById(R.id.iv_notask);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,6 +48,13 @@ public class DownloadManagerActivity extends BaseActivity implements XExecutor.O
|
||||
adapter.updateData(DownloadManagerAdapter.TYPE_ING);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
recyclerView.setAdapter(adapter);
|
||||
if (adapter.getItemCount() == 0) {
|
||||
iv_notask.setVisibility(View.VISIBLE);
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
} else {
|
||||
iv_notask.setVisibility(View.GONE);
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
okDownload.addOnAllTaskEndListener(this);
|
||||
}
|
||||
|
||||
@@ -85,6 +95,13 @@ public class DownloadManagerActivity extends BaseActivity implements XExecutor.O
|
||||
if (msg.what == 100) {
|
||||
adapter.updateData(DownloadManagerAdapter.TYPE_ING);
|
||||
adapter.notifyDataSetChanged();
|
||||
if (adapter.getItemCount() == 0) {
|
||||
iv_notask.setVisibility(View.VISIBLE);
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
} else {
|
||||
iv_notask.setVisibility(View.GONE);
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.appstore.uiui.R;
|
||||
import com.appstore.uiui.adapter.LocalAppAdapter;
|
||||
@@ -22,14 +23,16 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LocalManagerActivity extends BaseActivity implements RefreshManager.RefreshInterface {
|
||||
private RecyclerView mRvApp;
|
||||
private SmartRefreshLayout mRefreshLayout;
|
||||
private List<LocalApp> localAppList;
|
||||
private List<LocalApp> localAppList = new ArrayList<>();
|
||||
private LocalAppAdapter adapter;
|
||||
private ImageView iv_nodata;
|
||||
|
||||
@Override
|
||||
protected int setLayoutResourceID() {
|
||||
@@ -39,9 +42,9 @@ public class LocalManagerActivity extends BaseActivity implements RefreshManager
|
||||
@Override
|
||||
protected void initView() {
|
||||
mRvApp = findViewById(R.id.local_app_rv_app);
|
||||
iv_nodata = findViewById(R.id.iv_nodata);
|
||||
mRefreshLayout = findViewById(R.id.local_app_refresh_layout);
|
||||
RefreshManager.getInstance().register(this);
|
||||
localAppList = new ArrayList<>();
|
||||
|
||||
mRefreshLayout.setEnableLoadMore(false);
|
||||
mRefreshLayout.setEnableRefresh(true);
|
||||
@@ -82,7 +85,7 @@ public class LocalManagerActivity extends BaseActivity implements RefreshManager
|
||||
LocalApp bean = new LocalApp();
|
||||
bean.setAppName(resolveInfoList.get(i).loadLabel(getApplicationContext().getPackageManager()).toString());
|
||||
String packageName = resolveInfoList.get(i).activityInfo.packageName;
|
||||
if (packageName.equals(getApplicationContext().getPackageName())||packageName.equals("com.android.uiuios")){
|
||||
if (packageName.equals(getApplicationContext().getPackageName()) || packageName.equals("com.android.uiuios")) {
|
||||
continue;
|
||||
}
|
||||
bean.setPackageName(packageName);
|
||||
@@ -94,7 +97,9 @@ public class LocalManagerActivity extends BaseActivity implements RefreshManager
|
||||
String versionCode = getApplicationContext().getPackageManager()
|
||||
.getPackageInfo(packageName, 0).versionName;
|
||||
bean.setVersion(versionCode);
|
||||
|
||||
String appInstallDir = packageInfo.applicationInfo.publicSourceDir;
|
||||
int size = Integer.valueOf((int) new File(appInstallDir).length());
|
||||
bean.setSize(size);
|
||||
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) {
|
||||
//第三方应用
|
||||
localAppList.add(bean);
|
||||
@@ -110,7 +115,13 @@ public class LocalManagerActivity extends BaseActivity implements RefreshManager
|
||||
}
|
||||
adapter.notifyDataSetChanged();
|
||||
mRefreshLayout.finishRefresh();
|
||||
|
||||
if (localAppList.size() == 0) {
|
||||
mRvApp.setVisibility(View.GONE);
|
||||
iv_nodata.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mRvApp.setVisibility(View.VISIBLE);
|
||||
iv_nodata.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -102,16 +102,16 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.Holder> {
|
||||
if (appInfo.isInstall()) {
|
||||
if (appInfo.isUpdate()) {
|
||||
holder.btnDownLoad.setText("更新");
|
||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.green));
|
||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.install));
|
||||
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_style_none));
|
||||
} else {
|
||||
holder.btnDownLoad.setText("打开");
|
||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.black));
|
||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.white));
|
||||
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_style_open));
|
||||
}
|
||||
} else {
|
||||
holder.btnDownLoad.setText("下载");
|
||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.green));
|
||||
holder.btnDownLoad.setText("安装");
|
||||
holder.btnDownLoad.setTextColor(mContext.getColor(R.color.install));
|
||||
holder.btnDownLoad.setBackground(mContext.getDrawable(R.drawable.btn_style_none));
|
||||
if (downloadTask != null) {
|
||||
holder.refresh(downloadTask.progress);
|
||||
@@ -180,7 +180,7 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.Holder> {
|
||||
void refresh(Progress progress) {
|
||||
switch (progress.status) {
|
||||
case Progress.NONE:
|
||||
btnDownLoad.setText("下载");
|
||||
btnDownLoad.setText("安装");
|
||||
break;
|
||||
case Progress.PAUSE:
|
||||
btnDownLoad.setText("继续");
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.appstore.uiui.adapter;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.appstore.uiui.R;
|
||||
import com.appstore.uiui.view.CornerImageView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.zhpan.bannerview.holder.ViewHolder;
|
||||
|
||||
public class BannerViewHolder implements ViewHolder<String> {
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.item_net;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind(View itemView, String path, int position, int size) {
|
||||
CornerImageView imageView = itemView.findViewById(R.id.banner_image);
|
||||
imageView.setRoundCorner(imageView.getContext().getResources().getDimensionPixelOffset(R.dimen.dp_5));
|
||||
Glide.with(imageView).load(path).into(imageView);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.format.Formatter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -59,7 +60,8 @@ public class LocalAppAdapter extends RecyclerView.Adapter<LocalAppAdapter.LocalA
|
||||
ApkUtils.uninstall(context, localApp.getPackageName());
|
||||
}
|
||||
});
|
||||
|
||||
String totalLength = Formatter.formatFileSize(context, localApp.getSize());
|
||||
holder.tvCompany.setText(totalLength);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.appstore.uiui.base;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@@ -19,14 +23,19 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
}
|
||||
setStatusBar();
|
||||
setContentView(setLayoutResourceID());
|
||||
initView();
|
||||
initData();
|
||||
setListener();
|
||||
}
|
||||
|
||||
protected abstract int setLayoutResourceID();
|
||||
|
||||
protected abstract void initView();
|
||||
|
||||
protected abstract void initData();
|
||||
|
||||
protected abstract void setListener();
|
||||
|
||||
// @Override
|
||||
@@ -37,6 +46,56 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
// }
|
||||
// }
|
||||
|
||||
protected void setStatusBar() {
|
||||
//这里做了两件事情,1.使状态栏透明并使contentView填充到状态栏 2.预留出状态栏的位置,防止界面上的控件离顶部靠的太近。这样就可以实现开头说的第二种情况的沉浸式状态栏了
|
||||
setTransparent(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态栏全透明
|
||||
*
|
||||
* @param activity 需要设置的activity
|
||||
*/
|
||||
public static void setTransparent(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
return;
|
||||
}
|
||||
transparentStatusBar(activity);
|
||||
setRootView(activity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使状态栏透明
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||
private static void transparentStatusBar(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
// activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
//需要设置这个flag contentView才能延伸到状态栏
|
||||
// activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
//状态栏覆盖在contentView上面,设置透明使contentView的背景透出来
|
||||
activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
} else {
|
||||
//让contentView延伸到状态栏并且设置状态栏颜色透明
|
||||
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置根布局参数
|
||||
*/
|
||||
private static void setRootView(Activity activity) {
|
||||
ViewGroup parent = (ViewGroup) activity.findViewById(android.R.id.content);
|
||||
for (int i = 0, count = parent.getChildCount(); i < count; i++) {
|
||||
View childView = parent.getChildAt(i);
|
||||
if (childView instanceof ViewGroup) {
|
||||
childView.setFitsSystemWindows(true);
|
||||
((ViewGroup) childView).setClipToPadding(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initViewFull(final Activity activity) {
|
||||
activity.getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
@@ -64,7 +123,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
}.start();
|
||||
}
|
||||
});
|
||||
//设置无标题
|
||||
//设置无标题
|
||||
activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
activity.getWindow().getDecorView().setSystemUiVisibility(
|
||||
|
||||
@@ -11,7 +11,7 @@ public class LocalApp {
|
||||
String appName;//名字
|
||||
Drawable icon;//图片
|
||||
String company;//公司
|
||||
String size;//软件的大小
|
||||
int size;//软件的大小
|
||||
String version;//软件的版本号
|
||||
String packageName;//软件的包名
|
||||
int versionCode;
|
||||
@@ -53,11 +53,11 @@ public class LocalApp {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getSize() {
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(String size) {
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
|
||||
44
app/src/main/java/com/appstore/uiui/bean/bannerImage.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.appstore.uiui.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class bannerImage implements Serializable {
|
||||
String title;
|
||||
String id;
|
||||
String desc;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
String img;
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.appstore.uiui.R;
|
||||
import com.appstore.uiui.adapter.AppAdapter;
|
||||
import com.appstore.uiui.adapter.BannerViewHolder;
|
||||
import com.appstore.uiui.base.LazyLoadFragment;
|
||||
import com.appstore.uiui.base.RefreshManager;
|
||||
import com.appstore.uiui.bean.AppInfo;
|
||||
@@ -26,12 +27,18 @@ import com.appstore.uiui.network.URLs.Url;
|
||||
import com.appstore.uiui.utils.ApkUtils;
|
||||
import com.appstore.uiui.utils.LogUtils;
|
||||
import com.appstore.uiui.utils.ToastUtil;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.zhpan.bannerview.BannerViewPager;
|
||||
import com.zhpan.bannerview.constants.IndicatorSlideMode;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
import com.zhpan.bannerview.holder.HolderCreator;
|
||||
import com.zhpan.bannerview.utils.BannerUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -45,9 +52,10 @@ import java.util.List;
|
||||
public class FeaturedFragment extends LazyLoadFragment implements RefreshManager.RefreshInterface {
|
||||
private RecyclerView mRvResult;
|
||||
private SmartRefreshLayout mRefreshLayout;
|
||||
private BannerViewPager<String, BannerViewHolder> mViewPager;
|
||||
|
||||
private List<AppInfos> appInfoList;//
|
||||
private List<AppInfo> newAppInfoList=new ArrayList<>();
|
||||
private List<AppInfo> newAppInfoList = new ArrayList<>();
|
||||
private AppAdapter adapter;
|
||||
|
||||
private boolean isNotLoadBitmap;
|
||||
@@ -92,7 +100,23 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
mRvResult = view.findViewById(R.id.featured_rv_result);
|
||||
mRefreshLayout = view.findViewById(R.id.featured_refresh_layout);
|
||||
RefreshManager.getInstance().register(this);
|
||||
|
||||
mViewPager = view.findViewById(R.id.banner_view);
|
||||
mViewPager
|
||||
.setIndicatorSlideMode(IndicatorSlideMode.SMOOTH)
|
||||
.setHolderCreator(new HolderCreator<BannerViewHolder>() {
|
||||
@Override
|
||||
public BannerViewHolder createViewHolder() {
|
||||
return new BannerViewHolder();
|
||||
}
|
||||
})
|
||||
.setIndicatorColor(getResources().getColor(R.color.colorAccent), getResources().getColor(R.color.colorAccent))
|
||||
.setOnPageClickListener(new BannerViewPager.OnPageClickListener() {
|
||||
@Override
|
||||
public void onPageClick(int position) {
|
||||
ToastUtils.showShort("position:" + position);
|
||||
}
|
||||
})
|
||||
.setInterval(5000);
|
||||
isNotLoadBitmap = false;
|
||||
|
||||
|
||||
@@ -121,6 +145,7 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
|
||||
synchronized private void initAPPData(final Handler handler) {
|
||||
OKGOPost.getAllAppInfo(handler);
|
||||
OKGOPost.getBannerImg(handler);
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +169,28 @@ public class FeaturedFragment extends LazyLoadFragment implements RefreshManager
|
||||
adapter.setData(checkUpdateOrInstalled(newAppInfoList));
|
||||
adapter.notifyDataSetChanged();
|
||||
break;
|
||||
|
||||
case 200:
|
||||
List<String> list = (List<String>) msg.obj;
|
||||
mViewPager
|
||||
.setPageMargin(getResources().getDimensionPixelOffset(R.dimen.dp_5))
|
||||
.setRevealWidth(BannerUtils.dp2px(0))
|
||||
.setPageStyle(PageStyle.MULTI_PAGE)
|
||||
.setHolderCreator(new HolderCreator<BannerViewHolder>() {
|
||||
@Override
|
||||
public BannerViewHolder createViewHolder() {
|
||||
return new BannerViewHolder();
|
||||
}
|
||||
})
|
||||
.setIndicatorColor(getResources().getColor(R.color.colorAccent), getResources().getColor(R.color.colorAccent))
|
||||
.setOnPageClickListener(new BannerViewPager.OnPageClickListener() {
|
||||
@Override
|
||||
public void onPageClick(int position) {
|
||||
ToastUtils.showShort("position:" + position);
|
||||
}
|
||||
})
|
||||
.setInterval(5000)
|
||||
.create(list);
|
||||
break;
|
||||
}
|
||||
mRefreshLayout.finishRefresh();
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -17,7 +18,9 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.appstore.uiui.R;
|
||||
import com.appstore.uiui.activity.DownloadManagerActivity;
|
||||
import com.appstore.uiui.activity.LocalManagerActivity;
|
||||
import com.appstore.uiui.activity.MainActivity;
|
||||
import com.appstore.uiui.adapter.LocalAppAdapter;
|
||||
import com.appstore.uiui.adapter.UpdateAppAdapter;
|
||||
import com.appstore.uiui.base.LazyLoadFragment;
|
||||
@@ -40,13 +43,14 @@ import java.util.List;
|
||||
public class ManageFragment extends LazyLoadFragment {
|
||||
|
||||
private RecyclerView mRvLocal;
|
||||
private ImageView iv_nodata;
|
||||
private TextView manage_tv_updateNum;
|
||||
private List<LocalApp> localAppList;
|
||||
private List<UpdateAppInfo> updateAppInfoList;
|
||||
private List<AppInfo> applist;
|
||||
private List<String> packageNameList = new ArrayList<>();
|
||||
private UpdateAppAdapter adapter;
|
||||
private LinearLayout manage_ll_localapp;
|
||||
private LinearLayout manage_ll_localapp, manage_ll_downlaod;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
@@ -63,6 +67,15 @@ public class ManageFragment extends LazyLoadFragment {
|
||||
startActivity(new Intent(getActivity(), LocalManagerActivity.class));
|
||||
}
|
||||
});
|
||||
manage_ll_downlaod = view.findViewById(R.id.manage_ll_downlaod);
|
||||
manage_ll_downlaod.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(getActivity(), DownloadManagerActivity.class));
|
||||
|
||||
}
|
||||
});
|
||||
iv_nodata = view.findViewById(R.id.iv_nodata);
|
||||
mRvLocal = view.findViewById(R.id.manage_rv_local);
|
||||
updateAppInfoList = new ArrayList<>();
|
||||
adapter = new UpdateAppAdapter(updateAppInfoList, getContext());
|
||||
@@ -162,6 +175,13 @@ public class ManageFragment extends LazyLoadFragment {
|
||||
updateDta(applist);
|
||||
updateNum = updateAppInfoList.size();
|
||||
manage_tv_updateNum.setText(updateNum + "");
|
||||
if (updateNum == 0) {
|
||||
iv_nodata.setVisibility(View.VISIBLE);
|
||||
mRvLocal.setVisibility(View.GONE);
|
||||
} else {
|
||||
iv_nodata.setVisibility(View.GONE);
|
||||
mRvLocal.setVisibility(View.VISIBLE);
|
||||
}
|
||||
adapter.notifyDataSetChanged();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.appstore.uiui.network;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.Image;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@@ -8,10 +9,12 @@ import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.appstore.uiui.TextCode.MessageWhat;
|
||||
import com.appstore.uiui.base.UserInfo;
|
||||
import com.appstore.uiui.bean.AppInfo;
|
||||
import com.appstore.uiui.bean.bannerImage;
|
||||
import com.appstore.uiui.network.URLs.Url;
|
||||
import com.appstore.uiui.utils.LogUtils;
|
||||
import com.appstore.uiui.utils.SPUtils;
|
||||
@@ -21,6 +24,7 @@ import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -353,6 +357,43 @@ public class OKGOPost {
|
||||
});
|
||||
}
|
||||
|
||||
public static void getBannerImg(final Handler handler) {
|
||||
OkGo.<String>get(Url.GET_BANNER_IMG).execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
try {
|
||||
JSONObject body = JSON.parseObject(response.body());
|
||||
int code = body.getInteger("code");
|
||||
String msg = body.getString("msg");
|
||||
if (code == 200) {
|
||||
Message message = new Message();
|
||||
List<bannerImage> data = JSON.parseArray(body.getString("data"), bannerImage.class);
|
||||
if (data != null) {
|
||||
List<String> urlList = new ArrayList<>();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
urlList.add(data.get(0).getImg());
|
||||
}
|
||||
message.what = 200;
|
||||
message.obj = urlList;
|
||||
} else {
|
||||
message.what = -200;
|
||||
}
|
||||
handler.sendMessage(message);
|
||||
} else {
|
||||
Log.e("checkUpdateByPackage", msg);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("checkUpdateByPackage", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<String> response) {
|
||||
super.onError(response);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,4 +19,6 @@ public class Url {
|
||||
//发送app卸载信息
|
||||
public final static String GET_APP_UPDATE = NETWORK_HOME_ADDRESS + "/Update/update";
|
||||
//根据包名获取更新
|
||||
public final static String GET_BANNER_IMG = NETWORK_HOME_ADDRESS + "/Slideshow/getImg";
|
||||
|
||||
}
|
||||
|
||||
19
app/src/main/java/com/appstore/uiui/view/CornerImageView.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.appstore.uiui.view
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
|
||||
|
||||
import com.zhpan.bannerview.provider.ViewStyleSetter
|
||||
|
||||
class CornerImageView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : AppCompatImageView(context, attrs, defStyleAttr) {
|
||||
|
||||
fun setRoundCorner(radius: Int) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val viewStyleSetter = ViewStyleSetter(this)
|
||||
viewStyleSetter.setRoundRect(radius.toFloat())
|
||||
}
|
||||
}
|
||||
}
|
||||
36
app/src/main/res/drawable/btn_style_delete.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 连框颜色值 -->
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#f9493c" />
|
||||
<corners android:radius="@dimen/dp_25" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 主体背景颜色值 -->
|
||||
<item
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp">
|
||||
<shape>
|
||||
<!-- <gradient-->
|
||||
<!-- android:angle="90"-->
|
||||
<!-- android:centerColor="#FFFFFF"-->
|
||||
<!-- android:centerX="0.5"-->
|
||||
<!-- android:centerY="0.5"-->
|
||||
<!-- android:endColor="#FFFFFF"-->
|
||||
<!-- android:startColor="#FFFFFF"-->
|
||||
<!-- android:type="linear" />-->
|
||||
|
||||
<padding
|
||||
android:bottom="2dp"
|
||||
android:left="2dp"
|
||||
android:right="2dp"
|
||||
android:top="2dp" />
|
||||
<!-- 应该是圆角 -->
|
||||
<corners android:radius="@dimen/dp_25" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 连框颜色值 -->
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#55b68a" />
|
||||
<solid android:color="#d9d9d9" />
|
||||
<corners android:radius="@dimen/dp_25" />
|
||||
|
||||
</shape>
|
||||
@@ -15,14 +15,14 @@
|
||||
android:right="1dp"
|
||||
android:top="1dp">
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="#FFFFFF"
|
||||
android:centerX="0.5"
|
||||
android:centerY="0.5"
|
||||
android:endColor="#FFFFFF"
|
||||
android:startColor="#FFFFFF"
|
||||
android:type="linear" />
|
||||
<!-- <gradient-->
|
||||
<!-- android:angle="90"-->
|
||||
<!-- android:centerColor="#FFFFFF"-->
|
||||
<!-- android:centerX="0.5"-->
|
||||
<!-- android:centerY="0.5"-->
|
||||
<!-- android:endColor="#FFFFFF"-->
|
||||
<!-- android:startColor="#FFFFFF"-->
|
||||
<!-- android:type="linear" />-->
|
||||
|
||||
<padding
|
||||
android:bottom="2dp"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 连框颜色值 -->
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#000000" />
|
||||
<solid android:color="#f09818" />
|
||||
<corners android:radius="@dimen/dp_25" />
|
||||
|
||||
</shape>
|
||||
@@ -15,14 +15,14 @@
|
||||
android:right="1dp"
|
||||
android:top="1dp">
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="#FFFFFF"
|
||||
android:centerX="0.5"
|
||||
android:centerY="0.5"
|
||||
android:endColor="#FFFFFF"
|
||||
android:startColor="#FFFFFF"
|
||||
android:type="linear" />
|
||||
<!-- <gradient-->
|
||||
<!-- android:angle="90"-->
|
||||
<!-- android:centerColor="#FFFFFF"-->
|
||||
<!-- android:centerX="0.5"-->
|
||||
<!-- android:centerY="0.5"-->
|
||||
<!-- android:endColor="#FFFFFF"-->
|
||||
<!-- android:startColor="#FFFFFF"-->
|
||||
<!-- android:type="linear" />-->
|
||||
|
||||
<padding
|
||||
android:bottom="2dp"
|
||||
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/drawable/icon_nodata.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
app/src/main/res/drawable/icon_notask.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#f45c28" />
|
||||
<solid android:color="#f09819" />
|
||||
|
||||
</shape>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#EBEBEB" />
|
||||
<solid android:color="#d4d0d0" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_25"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="#EBEBEB" />
|
||||
android:color="#d4d0d0" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topRightRadius="@dimen/dp_25"
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
android:id="@+id/search_iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:onClick="finish"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="finish"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="应用"
|
||||
android:text="应用详情"
|
||||
android:textColor="#8c8b8b"
|
||||
android:textSize="17sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -80,7 +80,8 @@
|
||||
android:singleLine="true"
|
||||
android:text="今日头条"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp" />
|
||||
android:textSize="@dimen/sp_11"
|
||||
/>
|
||||
|
||||
|
||||
<RatingBar
|
||||
@@ -115,7 +116,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:text="应用详情">
|
||||
android:text="应用介绍"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold">
|
||||
|
||||
</TextView>
|
||||
|
||||
@@ -124,25 +127,79 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginRight="@dimen/dp_15">
|
||||
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_tv_update_time"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="更新日期:2017年10月23日" />
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="更新"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold">
|
||||
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detali_tv_update"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
|
||||
android:layout_marginRight="@dimen/dp_15">
|
||||
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:text="信息"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold">
|
||||
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
|
||||
android:id="@+id/detali_tv_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:text="大小" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_tv_version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="版本号:1.31.4.10" />
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:text="版本" />
|
||||
|
||||
<TextView
|
||||
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:text="时间" />
|
||||
|
||||
<TextView
|
||||
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:text="供应商" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -151,27 +208,26 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/detail_btn_download"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerInParent="true"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<TextView
|
||||
<Button
|
||||
android:id="@+id/detail_tv_download"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/btn_style_open"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:stateListAnimator="@null"
|
||||
android:text="安装"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="15sp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -36,14 +36,32 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
tools:listitem="@layout/item_download_manager">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
tools:listitem="@layout/item_download_manager">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_notask"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_notask"
|
||||
android:visibility="gone">
|
||||
|
||||
</ImageView>
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -10,8 +10,8 @@
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
android:id="@+id/search_iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:onClick="finish"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="finish"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_back" />
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/local_app_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -47,11 +48,29 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/local_app_rv_app"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_local_app"/>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/local_app_rv_app"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_local_app" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_nodata"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_nodata"
|
||||
android:visibility="gone">
|
||||
|
||||
</ImageView>
|
||||
</RelativeLayout>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -55,10 +55,10 @@
|
||||
android:src="@drawable/shap_search_left" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="#EBEBEB"
|
||||
android:background="#d4d0d0"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_serach"></ImageView>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
android:background="@drawable/shap_search_right"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/search_edit"
|
||||
android:textColor="#c1bfbf">
|
||||
android:textColor="#ffffff">
|
||||
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
@@ -82,6 +82,7 @@
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="20dp"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_action_bar">
|
||||
|
||||
</ImageView>
|
||||
@@ -96,7 +97,7 @@
|
||||
app:tl_indicator_style="TRIANGLE"
|
||||
app:tl_tab_space_equal="true"
|
||||
app:tl_textBold="SELECT"
|
||||
app:tl_textSelectColor="#000000"
|
||||
app:tl_textSelectColor="#f09818"
|
||||
app:tl_textUnselectColor="#8c8b8b" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
|
||||
@@ -9,10 +9,23 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/featured_rv_result"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_margin="10dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/featured_rv_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -28,6 +28,29 @@
|
||||
android:background="@drawable/ic_kind_detail" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/manage_ll_downlaod"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="下载管理"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@drawable/ic_kind_detail" />
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/include_line_horizontal" />
|
||||
|
||||
@@ -42,9 +65,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:text="可升级应用"
|
||||
android:textSize="10sp" />
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/manage_tv_updateNum"
|
||||
@@ -53,17 +76,34 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="0"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<include layout="@layout/include_line_horizontal" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/manage_rv_local"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/manage_rv_local"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_nodata"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_nodata"
|
||||
android:visibility="gone">
|
||||
|
||||
</ImageView>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -75,7 +75,7 @@
|
||||
android:id="@+id/app_btn_download"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:textColor="#55b68a"
|
||||
android:textColor="#000000"
|
||||
android:stateListAnimator="@null"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="10dp"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="350dp"
|
||||
android:layout_width="225dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_margin="10dp"
|
||||
app:cardCornerRadius="10dp">
|
||||
|
||||
|
||||
@@ -65,10 +65,11 @@
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/btn_style_open"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/btn_style_delete"
|
||||
android:stateListAnimator="@null"
|
||||
android:text="删除"
|
||||
android:textColor="#ffffff"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
|
||||
32
app/src/main/res/layout/item_net.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.appstore.uiui.view.CornerImageView
|
||||
android:id="@+id/banner_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<!--<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="#66000000"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_describe"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>-->
|
||||
|
||||
</RelativeLayout>
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 5.8 KiB |
@@ -6,7 +6,9 @@
|
||||
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="black">#000000</color>
|
||||
<color name="gray">#c1bcbc</color>
|
||||
<color name="gray">#f5f4f4</color>
|
||||
<color name="install">#646464</color>
|
||||
|
||||
<color name="download">#d9d9d9</color>
|
||||
<color name="backgroundcolor">#d4d0d0</color>
|
||||
<color name="green">#55b68a</color>
|
||||
|
||||