version:1.7
fix: update:增加抢购,修复bug
@@ -16,8 +16,8 @@ android {
|
||||
applicationId "com.uiuios.aios"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 3
|
||||
versionName "1.2"
|
||||
versionCode 8
|
||||
versionName "1.7"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -50,7 +50,7 @@ android {
|
||||
|
||||
signingConfigs {
|
||||
zhanRui {
|
||||
storeFile file("src/doc/zhanxun.keystore")
|
||||
storeFile file("keystore/zhanxun.keystore")
|
||||
storePassword "123456"
|
||||
keyAlias "zhanxun"
|
||||
keyPassword "123456"
|
||||
@@ -59,24 +59,43 @@ android {
|
||||
}
|
||||
|
||||
mtk {
|
||||
storeFile file("src/doc/xueshibaoos.jks")
|
||||
storeFile file("keystore/xueshibaoos.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "xueshibaoos"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
mtk12 {
|
||||
storeFile file("keystore/mtkAndroid12.keystore")
|
||||
storePassword "123456"
|
||||
keyAlias "mtk12"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
MTKAndroid12Release.initWith(release)
|
||||
MTKAndroid12Release {
|
||||
signingConfig signingConfigs.mtk12
|
||||
}
|
||||
|
||||
MTKAndroid12Debug.initWith(debug)
|
||||
MTKAndroid12Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.mtk12
|
||||
}
|
||||
|
||||
zhanRuiRelease.initWith(release)
|
||||
zhanRuiRelease {
|
||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
|
||||
zhanRuiDebug.initWith(debug)
|
||||
zhanRuiDebug {
|
||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.zhanRui
|
||||
@@ -84,7 +103,6 @@ android {
|
||||
|
||||
debug {
|
||||
// 显示Log
|
||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||
versionNameSuffix "-debug"
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
@@ -102,7 +120,6 @@ android {
|
||||
|
||||
release {
|
||||
// 不显示Log
|
||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||
//混淆
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
@@ -118,7 +135,6 @@ android {
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
output.outputFileName = new File(outputFile, fileName)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,6 +163,8 @@ dependencies {
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
|
||||
implementation "androidx.room:room-runtime:2.4.3"
|
||||
annotationProcessor "androidx.room:room-compiler:2.4.3"
|
||||
|
||||
|
||||
BIN
app/keystore/mtkAndroid12.keystore
Normal file
@@ -74,7 +74,14 @@
|
||||
android:restoreAnyVersion="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".activity.ControlActivity"></activity>
|
||||
<activity android:name=".activity.ControlActivity" />
|
||||
<activity android:name=".activity.QuickAppActivity" />
|
||||
<activity android:name=".activity.SpikeListActivity" />
|
||||
<activity android:name=".activity.InfoListActivity" />
|
||||
<activity
|
||||
android:name=".activity.DetailsActivity"
|
||||
android:screenOrientation="userPortrait"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".activity.main.MainActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
|
||||
@@ -782,7 +782,7 @@ public class ControlActivity extends AppCompatActivity {
|
||||
int gamma = BrightnessUtils.convertLinearToGamma(brightness, 1, 255);
|
||||
Log.e(TAG, "getHardware: gamma = " + gamma);
|
||||
long percentage = Math.round((((double) gamma / 65535) * 100f));
|
||||
tv_brightness.setText(percentage + "%");
|
||||
// tv_brightness.setText(percentage + "%");
|
||||
Log.e(TAG, "getHardware: percentage = " + percentage);
|
||||
seekbar_brightness.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
@@ -793,7 +793,7 @@ public class ControlActivity extends AppCompatActivity {
|
||||
Log.e(TAG, "onProgressChanged: gamma = " + gamma);
|
||||
long percentage = Math.round((((double) gamma / 65535) * 100f));
|
||||
Log.e(TAG, "onProgressChanged: percentage = " + percentage);
|
||||
tv_brightness.setText(percentage + "%");
|
||||
// tv_brightness.setText(percentage + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
119
app/src/main/java/com/uiuios/aios/activity/DetailsActivity.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class DetailsActivity extends AppCompatActivity {
|
||||
@BindView(R.id.iv_details)
|
||||
ImageView iv_details;
|
||||
@BindView(R.id.iv_exit)
|
||||
ImageView iv_exit;
|
||||
@BindView(R.id.tv_buying_price)
|
||||
TextView tv_buying_price;
|
||||
@BindView(R.id.tv_original_price)
|
||||
TextView tv_original_price;
|
||||
@BindView(R.id.tv_stock)
|
||||
TextView tv_stock;
|
||||
@BindView(R.id.tv_subsidy)
|
||||
TextView tv_subsidy;
|
||||
@BindView(R.id.tv_price)
|
||||
TextView tv_price;
|
||||
@BindView(R.id.tv_title)
|
||||
TextView tv_title;
|
||||
@BindView(R.id.tv_details)
|
||||
TextView tv_details;
|
||||
@BindView(R.id.tv_certified)
|
||||
TextView tv_certified;
|
||||
@BindView(R.id.tv_ship)
|
||||
TextView tv_ship;
|
||||
@BindView(R.id.tv_insurance)
|
||||
TextView tv_insurance;
|
||||
@BindView(R.id.tv_sale)
|
||||
TextView tv_sale;
|
||||
@BindView(R.id.tv_type)
|
||||
TextView tv_type;
|
||||
@BindView(R.id.ll_buy)
|
||||
LinearLayout ll_buy;
|
||||
|
||||
private GoodsInfo mGoodsInfo;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
UltimateBarX.statusBar(this)
|
||||
.transparent()
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
.light(true)
|
||||
.apply();
|
||||
UltimateBarX.navigationBar(this)
|
||||
.transparent()
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
.light(true)
|
||||
.apply();
|
||||
setContentView(R.layout.activity_details);
|
||||
ButterKnife.bind(this);
|
||||
Intent intent = getIntent();
|
||||
if (intent == null) return;
|
||||
GoodsInfo goodsInfo = (GoodsInfo) intent.getSerializableExtra("GoodsInfo");
|
||||
if (goodsInfo == null) return;
|
||||
mGoodsInfo = goodsInfo;
|
||||
Glide.with(iv_details).load(mGoodsInfo.getDetails_img()).into(iv_details);
|
||||
ViewTreeObserver observer = iv_details.getViewTreeObserver();
|
||||
observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
ViewGroup.LayoutParams layoutParams = iv_details.getLayoutParams();
|
||||
int width = iv_details.getWidth();
|
||||
layoutParams.height = width;
|
||||
iv_details.setLayoutParams(layoutParams);
|
||||
}
|
||||
});
|
||||
iv_exit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
tv_stock.setText("库存:" + mGoodsInfo.getStock());
|
||||
tv_subsidy.setText("官方补贴" + (mGoodsInfo.getOriginal_price() - mGoodsInfo.getBuying_price()));
|
||||
tv_buying_price.setText("¥" + mGoodsInfo.getBuying_price());
|
||||
tv_original_price.setText("原价:" + mGoodsInfo.getOriginal_price() + "元");
|
||||
tv_price.setText("抢购:" + mGoodsInfo.getBuying_price() + "元");
|
||||
tv_title.setText(mGoodsInfo.getGoods_name());
|
||||
tv_details.setText(mGoodsInfo.getGoods_desc());
|
||||
tv_certified.setText(mGoodsInfo.getEnsure());
|
||||
tv_ship.setText(mGoodsInfo.getDeliver_goods());
|
||||
tv_insurance.setText(mGoodsInfo.getInsure());
|
||||
tv_sale.setText(mGoodsInfo.getAfter_sales());
|
||||
ll_buy.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Uri uri = Uri.parse(goodsInfo.getJump_url());
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
tv_type.setText(mGoodsInfo.getType());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
|
||||
public class InfoListActivity extends BaseActivity {
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_info_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.adapter.AppSelectedAdapter;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
import com.uiuios.aios.bean.AppSelectBean;
|
||||
import com.uiuios.aios.view.GridSpaceItemDecoration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class QuickAppActivity extends BaseActivity {
|
||||
public static final String QUICK_APP_KEY = "QuickAppKey";
|
||||
private AppSelectedAdapter mAppSelectedAdapter;
|
||||
|
||||
@BindView(R.id.rv_goods)
|
||||
RecyclerView recyclerView;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_quick_app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
mAppSelectedAdapter = new AppSelectedAdapter();
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
recyclerView.addItemDecoration(new GridSpaceItemDecoration(3,50,50));
|
||||
} else {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
|
||||
recyclerView.addItemDecoration(new GridSpaceItemDecoration(2,50,50));
|
||||
}
|
||||
recyclerView.setAdapter(mAppSelectedAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mAppSelectedAdapter.setAppSelectBeans(getPackageList());
|
||||
}
|
||||
|
||||
boolean listThirdParty = true;
|
||||
|
||||
private List<AppSelectBean> getPackageList() {
|
||||
PackageManager pm = getPackageManager();
|
||||
List<AppSelectBean> appSelectBeanList = new ArrayList<>();
|
||||
List<PackageInfo> applicationInfos = pm.getInstalledPackages(0);
|
||||
for (PackageInfo packageInfo : applicationInfos) {
|
||||
if (BuildConfig.APPLICATION_ID.equals(packageInfo.applicationInfo.packageName)) {
|
||||
continue;
|
||||
}
|
||||
final boolean isSystem = (packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
|
||||
if (!listThirdParty || !isSystem) {
|
||||
AppSelectBean appSelectBean = new AppSelectBean(packageInfo.applicationInfo.loadLabel(pm).toString(), packageInfo.applicationInfo.packageName, packageInfo.applicationInfo.loadIcon(pm));
|
||||
appSelectBeanList.add(appSelectBean);
|
||||
}
|
||||
}
|
||||
return appSelectBeanList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.adapter.GoodsAdapter;
|
||||
import com.uiuios.aios.adapter.GoodsListAdapter;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class SpikeListActivity extends BaseActivity {
|
||||
@BindView(R.id.recyclerView)
|
||||
RecyclerView recyclerView;
|
||||
@BindView(R.id.iv1)
|
||||
ImageView iv1;
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
|
||||
private GoodsListAdapter mGoodsAdapter;
|
||||
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
UltimateBarX.statusBar(this)
|
||||
.transparent()
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
.light(true)
|
||||
.apply();
|
||||
UltimateBarX.navigationBar(this)
|
||||
.transparent()
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
.light(true)
|
||||
.apply();
|
||||
return R.layout.activity_spike_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
mGoodsAdapter = new GoodsListAdapter();
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
recyclerView.setAdapter(mGoodsAdapter);
|
||||
iv_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
getGoodsInfo();
|
||||
}
|
||||
|
||||
private void getGoodsInfo() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getGoodsListObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycleSubject, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<GoodsInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getGoods", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<GoodsInfo>> listBaseResponse) {
|
||||
Log.e("getGoods", "onNext: " + listBaseResponse);
|
||||
List<GoodsInfo> goodsInfos = listBaseResponse.data;
|
||||
if (goodsInfos != null && goodsInfos.size() != 0) {
|
||||
iv1.setVisibility(android.view.View.GONE);
|
||||
mGoodsAdapter.setGoodsInfoList(goodsInfos);
|
||||
} else {
|
||||
iv1.setVisibility(android.view.View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getGoods", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getGoods", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import cn.jzvd.Jzvd;
|
||||
public class AlarmClockActivity extends BaseActivity implements AlarmClockContact.ClockView {
|
||||
private static final String TAG = AlarmClockActivity.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.recyclerView)
|
||||
@BindView(R.id.rv_goods)
|
||||
RecyclerView recyclerView;
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
|
||||
@@ -73,10 +73,15 @@ public class ContactActivity extends BaseActivity implements ContactContact.Cont
|
||||
|
||||
@Override
|
||||
public void setContact(List<Contact> contactList) {
|
||||
if (contactList != null) {
|
||||
mContactAdapter.setContactList(contactList);
|
||||
if (contactList == null || contactList.size() == 0) {
|
||||
tv_people.setText("暂无数据");
|
||||
} else {
|
||||
tv_people.setText(contactList.size() + "人");
|
||||
}
|
||||
|
||||
Contact contact = new Contact();
|
||||
contact.setName("拨号");
|
||||
contact.setMobile(ContactAdapter.DIALER_PACKAGE);
|
||||
contactList.add(0, contact);
|
||||
mContactAdapter.setContactList(contactList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,19 @@ package com.uiuios.aios.activity.contact;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.Contact;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.network.URLAddress;
|
||||
import com.uiuios.aios.utils.GsonUtils;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
@@ -19,6 +26,7 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
public class ContactPresenter implements ContactContact.Presenter {
|
||||
private Context mContext;
|
||||
private ContactContact.ContactView mView;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
@@ -58,12 +66,28 @@ public class ContactPresenter implements ContactContact.Presenter {
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<Contact>> listBaseResponse) {
|
||||
Log.e("getContactList", "onNext: " + listBaseResponse);
|
||||
mView.setContact(listBaseResponse.data);
|
||||
if (listBaseResponse.code == 200) {
|
||||
mMMKV.putString(URLAddress.GET_MAIL_LIST, GsonUtils.toJsonString(listBaseResponse.data));
|
||||
mView.setContact(listBaseResponse.data);
|
||||
} else {
|
||||
mMMKV.putString(URLAddress.GET_MAIL_LIST, "");
|
||||
mView.setContact(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getContactList", "onError: " + e.getMessage());
|
||||
String jsonString = mMMKV.getString(URLAddress.GET_MAIL_LIST, null);
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<List<Contact>>() {
|
||||
}.getType();
|
||||
List<Contact> contacts = gson.fromJson(jsonString, type);
|
||||
if (contacts == null) {
|
||||
mView.setContact(new ArrayList<>());
|
||||
}else {
|
||||
mView.setContact(contacts);
|
||||
}
|
||||
onComplete();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.uiuios.aios.bean.DesktopIcon;
|
||||
import com.uiuios.aios.fragment.AppListFragment;
|
||||
import com.uiuios.aios.base.BaseFragmentPagerAdapter;
|
||||
import com.uiuios.aios.fragment.custom.CustomFragment;
|
||||
import com.uiuios.aios.fragment.SecondFragment;
|
||||
import com.uiuios.aios.fragment.second.SecondFragment;
|
||||
import com.uiuios.aios.service.NotificationService;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.bean.ActivityBean;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityAdapter extends RecyclerView.Adapter<ActivityAdapter.Holder> {
|
||||
private static final String TAG = ActivityAdapter.class.getSimpleName();
|
||||
|
||||
private Context mContext;
|
||||
private List<ActivityBean> mActivityBeans;
|
||||
|
||||
public void setActivityBeans(List<ActivityBean> list) {
|
||||
this.mActivityBeans = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new ActivityAdapter.Holder(LayoutInflater.from(mContext).inflate(R.layout.item_activity, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
ActivityBean activityBean = mActivityBeans.get(position);
|
||||
Glide.with(holder.iv_img).load(activityBean.getFile()).into(holder.iv_img);
|
||||
holder.tv_location.setText(activityBean.getLocation());
|
||||
holder.tv_desc.setText(getTime(activityBean.getAdd_time()));
|
||||
|
||||
}
|
||||
|
||||
private String getTime(long second) {
|
||||
long ms = second * 1000L;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MM月dd日");
|
||||
Date date = new Date(ms);
|
||||
String time = sdf.format(date);
|
||||
Log.e(TAG, "getTime: " + time);
|
||||
return time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mActivityBeans == null ? 0 : mActivityBeans.size();
|
||||
}
|
||||
|
||||
class Holder extends RecyclerView.ViewHolder {
|
||||
ImageView iv_img;
|
||||
TextView tv_location, tv_desc;
|
||||
|
||||
public Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
iv_img = itemView.findViewById(R.id.iv_img);
|
||||
tv_location = itemView.findViewById(R.id.tv_location);
|
||||
tv_desc = itemView.findViewById(R.id.tv_desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.QuickAppActivity;
|
||||
import com.uiuios.aios.bean.AppSelectBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AppSelectedAdapter extends RecyclerView.Adapter<AppSelectedAdapter.Holder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<AppSelectBean> mAppSelectBeans;
|
||||
private int unselectedStatus = -1;
|
||||
private int selecedPosition = unselectedStatus;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
|
||||
public void setAppSelectBeans(List<AppSelectBean> appSelectBeanList) {
|
||||
this.mAppSelectBeans = appSelectBeanList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new Holder(LayoutInflater.from(mContext).inflate(R.layout.item_app_select, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
AppSelectBean appSelectBean = mAppSelectBeans.get(position);
|
||||
holder.iv_icon.setImageDrawable(appSelectBean.getIcon());
|
||||
holder.tv_name.setText(appSelectBean.getAppName());
|
||||
if (selecedPosition == position) {
|
||||
holder.iv_select.setImageDrawable(mContext.getDrawable(R.drawable.icon_selected));
|
||||
} else {
|
||||
holder.iv_select.setImageDrawable(mContext.getDrawable(R.drawable.icon_unselected));
|
||||
}
|
||||
holder.iv_select.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (position != selecedPosition) {
|
||||
holder.iv_select.setImageDrawable(mContext.getDrawable(R.drawable.icon_selected));
|
||||
selecedPosition = position;
|
||||
mMMKV.putString(QuickAppActivity.QUICK_APP_KEY, appSelectBean.getPackageName());
|
||||
} else {
|
||||
holder.iv_select.setImageDrawable(mContext.getDrawable(R.drawable.icon_unselected));
|
||||
selecedPosition = -1;
|
||||
mMMKV.putString(QuickAppActivity.QUICK_APP_KEY, "");
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mAppSelectBeans == null ? 0 : mAppSelectBeans.size();
|
||||
}
|
||||
|
||||
static class Holder extends RecyclerView.ViewHolder {
|
||||
ImageView iv_select, iv_icon;
|
||||
TextView tv_name;
|
||||
|
||||
Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
iv_select = itemView.findViewById(R.id.iv_select);
|
||||
iv_icon = itemView.findViewById(R.id.iv_icon);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.bean.ArticleInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ArticleAdapter extends RecyclerView.Adapter<ArticleAdapter.Holder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<ArticleInfo> mArticleBeanList;
|
||||
|
||||
public void setArticleBeanList(List<ArticleInfo> list) {
|
||||
this.mArticleBeanList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new ArticleAdapter.Holder(LayoutInflater.from(mContext).inflate(R.layout.item_article, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
ArticleInfo articleInfo = mArticleBeanList.get(position);
|
||||
Glide.with(holder.iv_img).load(articleInfo.getImg()).into(holder.iv_img);
|
||||
holder.tv_title.setText(articleInfo.getTitle());
|
||||
holder.tv_content.setText(articleInfo.getContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mArticleBeanList == null ? 0 : mArticleBeanList.size();
|
||||
}
|
||||
|
||||
class Holder extends RecyclerView.ViewHolder {
|
||||
NiceImageView iv_img;
|
||||
TextView tv_title, tv_content;
|
||||
|
||||
public Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
iv_img = itemView.findViewById(R.id.iv_img);
|
||||
tv_title = itemView.findViewById(R.id.tv_title);
|
||||
tv_content = itemView.findViewById(R.id.tv_content);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
private List<Contact> mContactList;
|
||||
private Context mContext;
|
||||
|
||||
public static final String DIALER_PACKAGE = "com.android.dialer";
|
||||
|
||||
public void setContactList(List<Contact> contactList) {
|
||||
this.mContactList = contactList;
|
||||
notifyDataSetChanged();
|
||||
@@ -44,7 +46,9 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
public void onClick(View view) {
|
||||
Intent intent1 = new Intent(Intent.ACTION_CALL);
|
||||
String phone = contact.getMobile();
|
||||
if (!TextUtils.isEmpty(phone)) {
|
||||
if (DIALER_PACKAGE.equals(phone)) {
|
||||
mContext.startActivity(new Intent(Intent.ACTION_DIAL));
|
||||
} else if (!TextUtils.isEmpty(phone)) {
|
||||
Uri data = Uri.parse("tel:" + phone);
|
||||
intent1.setData(data);
|
||||
mContext.startActivity(intent1);
|
||||
@@ -52,22 +56,27 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
|
||||
}
|
||||
});
|
||||
Glide.with(contactHolder.iv_head).load(contact.getAvatar()).error(R.drawable.default_head).into(contactHolder.iv_head);
|
||||
contactHolder.tv_name.setText(contact.getName());
|
||||
contactHolder.tv_phone.setText(contact.getMobile());
|
||||
if (DIALER_PACKAGE.equals(contact.getMobile())) {
|
||||
contactHolder.tv_phone.setText("");
|
||||
Glide.with(contactHolder.iv_head).load(R.drawable.icon_dialer).error(R.drawable.icon_dialer).into(contactHolder.iv_head);
|
||||
} else {
|
||||
contactHolder.tv_phone.setText(contact.getMobile());
|
||||
Glide.with(contactHolder.iv_head).load(contact.getAvatar()).error(R.drawable.default_head).into(contactHolder.iv_head);
|
||||
}
|
||||
int index = position % 3;
|
||||
switch (index) {
|
||||
case 0:
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.background_weather_rain));
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.contact_bg1));
|
||||
break;
|
||||
case 1:
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.background_weather_sun));
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.contact_bg2));
|
||||
break;
|
||||
case 2:
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.background_weather_sunny));
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.contact_bg3));
|
||||
break;
|
||||
default:
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.background_weather_rain));
|
||||
contactHolder.root.setBackground(mContext.getDrawable(R.drawable.contact_bg1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
92
app/src/main/java/com/uiuios/aios/adapter/GoodsAdapter.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.DetailsActivity;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GoodsAdapter extends RecyclerView.Adapter<GoodsAdapter.GoodsHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<GoodsInfo> goodsInfoList;
|
||||
|
||||
public void setGoodsInfoList(List<GoodsInfo> list) {
|
||||
this.goodsInfoList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GoodsHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new GoodsAdapter.GoodsHolder(LayoutInflater.from(mContext).inflate(R.layout.item_goods, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull GoodsHolder holder, int position) {
|
||||
GoodsInfo goodsInfo = goodsInfoList.get(position);
|
||||
if (!TextUtils.isEmpty(goodsInfo.getJump_url())) {
|
||||
// holder.tv_name.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Uri uri = Uri.parse(goodsInfo.getJump_url());
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
// mContext.startActivity(intent);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
Glide.with(holder.iv_goods).load(goodsInfo.getImg()).into(holder.iv_goods);
|
||||
holder.tv_name.setText(goodsInfo.getGoods_name());
|
||||
holder.tv_desc.setText(goodsInfo.getGoods_desc());
|
||||
holder.tv_price.setText("¥" + goodsInfo.getBuying_price());
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(mContext, DetailsActivity.class);
|
||||
intent.putExtra("GoodsInfo", goodsInfo);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
holder.tv_type.setText(goodsInfo.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return goodsInfoList == null ? 0 : goodsInfoList.size();
|
||||
}
|
||||
|
||||
static class GoodsHolder extends RecyclerView.ViewHolder {
|
||||
ConstraintLayout root;
|
||||
NiceImageView iv_goods;
|
||||
TextView tv_name, tv_desc, tv_buying_price, tv_price,tv_type;
|
||||
|
||||
public GoodsHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
iv_goods = itemView.findViewById(R.id.iv_img);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_desc = itemView.findViewById(R.id.tv_desc);
|
||||
tv_buying_price = itemView.findViewById(R.id.tv_buying_price);
|
||||
tv_price = itemView.findViewById(R.id.tv_price);
|
||||
tv_type = itemView.findViewById(R.id.tv_type);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.DetailsActivity;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GoodsListAdapter extends RecyclerView.Adapter<GoodsListAdapter.GoodsHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<GoodsInfo> goodsInfoList;
|
||||
|
||||
public void setGoodsInfoList(List<GoodsInfo> list) {
|
||||
this.goodsInfoList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GoodsHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new GoodsListAdapter.GoodsHolder(LayoutInflater.from(mContext).inflate(R.layout.item_goods_list, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull GoodsHolder holder, int position) {
|
||||
GoodsInfo goodsInfo = goodsInfoList.get(position);
|
||||
if (!TextUtils.isEmpty(goodsInfo.getJump_url())) {
|
||||
// holder.tv_name.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Uri uri = Uri.parse(goodsInfo.getJump_url());
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
// mContext.startActivity(intent);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
Glide.with(holder.iv_goods).load(goodsInfo.getImg()).into(holder.iv_goods);
|
||||
holder.tv_name.setText(goodsInfo.getGoods_name());
|
||||
holder.tv_desc.setText(goodsInfo.getGoods_desc());
|
||||
holder.tv_price.setText("全网低价¥" + goodsInfo.getOriginal_price());
|
||||
holder.tv_buying_price.setText("秒杀价格¥" + goodsInfo.getBuying_price());
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(mContext, DetailsActivity.class);
|
||||
intent.putExtra("GoodsInfo", goodsInfo);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
holder.tv_type.setText(goodsInfo.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return goodsInfoList == null ? 0 : goodsInfoList.size();
|
||||
}
|
||||
|
||||
static class GoodsHolder extends RecyclerView.ViewHolder {
|
||||
ConstraintLayout root;
|
||||
NiceImageView iv_goods;
|
||||
TextView tv_name, tv_desc, tv_buying_price, tv_price,tv_type;
|
||||
|
||||
public GoodsHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
iv_goods = itemView.findViewById(R.id.iv_img);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_desc = itemView.findViewById(R.id.tv_desc);
|
||||
tv_buying_price = itemView.findViewById(R.id.tv_buying_price);
|
||||
tv_price = itemView.findViewById(R.id.tv_price);
|
||||
tv_type = itemView.findViewById(R.id.tv_type);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.MediaPlayer;
|
||||
import android.text.TextUtils;
|
||||
@@ -8,12 +9,15 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.bean.AlarmClockData;
|
||||
import com.uiuios.aios.utils.FFmpegUtils;
|
||||
@@ -70,6 +74,32 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
} else {
|
||||
holder.tv_time.setText(time);
|
||||
}
|
||||
String file = alarmClockData.getFile();
|
||||
if (TextUtils.isEmpty(file)) {
|
||||
Glide.with(holder.iv_cover).load(R.drawable.home_reminder_icon).into(holder.iv_cover);
|
||||
} else {
|
||||
FFmpegUtils.loadVideoScreenshot(file, new Observer<Bitmap>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull Bitmap bitmap) {
|
||||
Glide.with(holder.iv_cover).load(bitmap).into(holder.iv_cover);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
String voice = alarmClockData.getVoice();
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -141,6 +171,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
TextView tv_voice;
|
||||
ConstraintLayout cl_voice;
|
||||
ConstraintLayout root;
|
||||
NiceImageView iv_cover;
|
||||
|
||||
public Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -149,6 +180,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
tv_time = itemView.findViewById(R.id.tv_time);
|
||||
tv_voice = itemView.findViewById(R.id.tv_voice);
|
||||
cl_voice = itemView.findViewById(R.id.cl_voice);
|
||||
iv_cover = itemView.findViewById(R.id.iv_cover);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
44
app/src/main/java/com/uiuios/aios/bean/AppSelectBean.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppSelectBean implements Serializable {
|
||||
private static final long serialVersionUID = 5054284058523960678L;
|
||||
|
||||
String appName;
|
||||
String packageName;
|
||||
Drawable icon;
|
||||
|
||||
public AppSelectBean(String appName, String packageName, Drawable icon) {
|
||||
this.appName = appName;
|
||||
this.packageName = packageName;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
public String getPackageName() {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
public Drawable getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(Drawable icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,24 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DesktopIcon implements Serializable , Parcelable {
|
||||
public class DesktopIcon implements Serializable, Parcelable {
|
||||
private static final long serialVersionUID = 3358230413497783708L;
|
||||
|
||||
String packageName;
|
||||
String className;
|
||||
Drawable icon;
|
||||
String lable;
|
||||
int position;
|
||||
|
||||
private DesktopIcon() {
|
||||
public DesktopIcon() {
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +60,14 @@ public class DesktopIcon implements Serializable , Parcelable {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Drawable getIcon() {
|
||||
return icon;
|
||||
}
|
||||
@@ -83,22 +92,24 @@ public class DesktopIcon implements Serializable , Parcelable {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public static DesktopIcon creatDesktopIcon(Context context, ApplicationInfo applicationInfo) {
|
||||
public static DesktopIcon creatDesktopIcon(Context context, ResolveInfo resolveInfo) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
DesktopIcon desktopIcon = new DesktopIcon();
|
||||
desktopIcon.setPackageName(applicationInfo.packageName);
|
||||
desktopIcon.setIcon(applicationInfo.loadIcon(pm));
|
||||
desktopIcon.setLable(applicationInfo.loadLabel(pm).toString());
|
||||
desktopIcon.setPackageName(resolveInfo.activityInfo.packageName);
|
||||
desktopIcon.setClassName(resolveInfo.activityInfo.name);
|
||||
desktopIcon.setIcon(resolveInfo.loadIcon(pm));
|
||||
desktopIcon.setLable(resolveInfo.loadLabel(pm).toString());
|
||||
desktopIcon.setPosition(0);
|
||||
return desktopIcon;
|
||||
}
|
||||
|
||||
public static DesktopIcon creatDesktopIcon(Context context, ApplicationInfo applicationInfo, int position) {
|
||||
public static DesktopIcon creatDesktopIcon(Context context, ResolveInfo resolveInfo, int position) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
DesktopIcon desktopIcon = new DesktopIcon();
|
||||
desktopIcon.setPackageName(applicationInfo.packageName);
|
||||
desktopIcon.setIcon(applicationInfo.loadIcon(pm));
|
||||
desktopIcon.setLable(applicationInfo.loadLabel(pm).toString());
|
||||
desktopIcon.setPackageName(resolveInfo.activityInfo.packageName);
|
||||
desktopIcon.setClassName(resolveInfo.activityInfo.name);
|
||||
desktopIcon.setIcon(resolveInfo.loadIcon(pm));
|
||||
desktopIcon.setLable(resolveInfo.loadLabel(pm).toString());
|
||||
desktopIcon.setPosition(position);
|
||||
return desktopIcon;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class GoodsInfo implements Serializable {
|
||||
@@ -23,6 +25,13 @@ public class GoodsInfo implements Serializable {
|
||||
int stock;
|
||||
/*跳转链接*/
|
||||
String jump_url;
|
||||
String insure;
|
||||
String deliver_goods;
|
||||
String after_sales;
|
||||
String ensure;
|
||||
@SerializedName("class")
|
||||
String type;
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
@@ -104,4 +113,44 @@ public class GoodsInfo implements Serializable {
|
||||
public void setJump_url(String jump_url) {
|
||||
this.jump_url = jump_url;
|
||||
}
|
||||
|
||||
public String getInsure() {
|
||||
return insure;
|
||||
}
|
||||
|
||||
public void setInsure(String insure) {
|
||||
this.insure = insure;
|
||||
}
|
||||
|
||||
public String getDeliver_goods() {
|
||||
return deliver_goods;
|
||||
}
|
||||
|
||||
public void setDeliver_goods(String deliver_goods) {
|
||||
this.deliver_goods = deliver_goods;
|
||||
}
|
||||
|
||||
public String getAfter_sales() {
|
||||
return after_sales;
|
||||
}
|
||||
|
||||
public void setAfter_sales(String after_sales) {
|
||||
this.after_sales = after_sales;
|
||||
}
|
||||
|
||||
public String getEnsure() {
|
||||
return ensure;
|
||||
}
|
||||
|
||||
public void setEnsure(String ensure) {
|
||||
this.ensure = ensure;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -127,7 +128,7 @@ public class AppListFragment extends BaseFragment {
|
||||
ConstraintLayout constraintLayout = view.findViewById(R.id.btn_booktag);
|
||||
DesktopIcon desktopIcon = mDesktopIcons.get(index);
|
||||
if (desktopIcon != null) {
|
||||
String pkg =desktopIcon.getPackageName();
|
||||
String pkg = desktopIcon.getPackageName();
|
||||
Log.e(TAG, "getView: " + pkg);
|
||||
int i = IconUtils.appClassNameList.indexOf(pkg);
|
||||
if (i != -1) {
|
||||
@@ -172,6 +173,29 @@ public class AppListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onItemClick(View v, int index) {
|
||||
DesktopIcon desktopIcon = mDesktopIcons.get(index);
|
||||
if (desktopIcon != null) {
|
||||
Log.e(TAG, "onItemClick: " + desktopIcon.getPackageName());
|
||||
switch (desktopIcon.getPackageName()) {
|
||||
case "aios.exit":
|
||||
case "com.android.dialer":
|
||||
int qch_call_forbid = Settings.System.getInt(mContext.getContentResolver(), "aole_call_forbid", 0);
|
||||
if (qch_call_forbid == 1) {
|
||||
ToastUtil.show("电话功能被禁用");
|
||||
return;
|
||||
} else {
|
||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackageName());
|
||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackageName());
|
||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||
SendRunningApp(getActivity());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackageName());
|
||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackageName());
|
||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||
SendRunningApp(getActivity());
|
||||
}
|
||||
}
|
||||
if (desktopIcon != null) {
|
||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackageName());
|
||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackageName());
|
||||
@@ -183,6 +207,7 @@ public class AppListFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onLongClick(View v, int index) {
|
||||
DesktopIcon desktopIcon = mDesktopIcons.get(index);
|
||||
if (desktopIcon == null) return;
|
||||
String pkg = desktopIcon.getPackageName();
|
||||
Log.e(TAG, "onLongClick: " + pkg);
|
||||
switch (pkg) {
|
||||
|
||||
@@ -197,7 +197,7 @@ public class ViewPager2Adapter extends FragmentStateAdapter {
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Fragment getItem(int position) {
|
||||
// public SecondFragment getItem(int position) {
|
||||
// return mFragmentList.get(position);
|
||||
// }
|
||||
//
|
||||
|
||||
@@ -7,7 +7,10 @@ import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.wifi.WifiInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
@@ -49,6 +52,7 @@ import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.ControlActivity;
|
||||
import com.uiuios.aios.activity.EmergencyActivity;
|
||||
import com.uiuios.aios.activity.QuickAppActivity;
|
||||
import com.uiuios.aios.activity.alarm.AlarmClockActivity;
|
||||
import com.uiuios.aios.activity.code.HealthCodeActivity;
|
||||
import com.uiuios.aios.activity.contact.ContactActivity;
|
||||
@@ -113,8 +117,15 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
ConstraintLayout cl_contact;
|
||||
@BindView(R.id.cl_ai)
|
||||
ConstraintLayout cl_ai;
|
||||
@BindView(R.id.cl_app)
|
||||
ConstraintLayout cl_app;
|
||||
@BindView(R.id.cl_appstore)
|
||||
ConstraintLayout cl_appstore;
|
||||
@BindView(R.id.cl_wifi)
|
||||
ConstraintLayout cl_wifi;
|
||||
@BindView(R.id.cl_activation)
|
||||
ConstraintLayout cl_activation;
|
||||
|
||||
// @BindView(R.id.cl_exit)
|
||||
// ConstraintLayout cl_exit;
|
||||
@BindView(R.id.cl_control)
|
||||
@@ -123,8 +134,8 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
// ConstraintLayout cl_battery;
|
||||
// @BindView(R.id.tv_add)
|
||||
// TextView tv_add;
|
||||
// @BindView(R.id.tv_battery)
|
||||
// TextView tv_battery;
|
||||
@BindView(R.id.tv_battery)
|
||||
TextView tv_battery;
|
||||
@BindView(R.id.tv_location)
|
||||
TextView tv_location;
|
||||
@BindView(R.id.tv_weather)
|
||||
@@ -141,18 +152,23 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
RecyclerView rv_noti;
|
||||
// @BindView(R.id.rv_clock)
|
||||
// RecyclerView rv_clock;
|
||||
// @BindView(R.id.wifi_ssid)
|
||||
// TextView wifi_ssid;
|
||||
@BindView(R.id.iv_wifi)
|
||||
ImageView iv_wifi;
|
||||
@BindView(R.id.wifi_ssid)
|
||||
TextView wifi_ssid;
|
||||
@BindView(R.id.iv_sos)
|
||||
ImageView iv_sos;
|
||||
@BindView(R.id.rv_sos)
|
||||
RecyclerView rv_sos;
|
||||
@BindView(R.id.iv_note_nodata)
|
||||
ImageView iv_note_nodata;
|
||||
TextView iv_note_nodata;
|
||||
// @BindView(R.id.iv_head)
|
||||
// ImageView iv_head;
|
||||
// @BindView(R.id.tv_name)
|
||||
// TextView tv_name;
|
||||
@BindView(R.id.tv_name)
|
||||
TextView tv_name;
|
||||
@BindView(R.id.iv_app)
|
||||
ImageView iv_app;
|
||||
|
||||
|
||||
private String TAG = CustomFragment.class.getSimpleName();
|
||||
// private int[] mShaderColors = new int[]{0xFFfa3db5, 0xFFF8867E, 0xFFF79F6B, 0xFFF79F6B, 0xFFF79F6B, 0xFFF8867E, 0xFFfa3db5};
|
||||
@@ -219,24 +235,31 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
// wifi_ssid.setText("WiFi未连接");
|
||||
wifi_ssid.setText("WiFi未连接");
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_disconnect));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
if (networkType == NetworkUtils.NetworkType.NETWORK_WIFI) {
|
||||
// wifi_ssid.setText(getConnectWifiSsid());
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_connect));
|
||||
if (isNetworkOnline1()) {
|
||||
wifi_ssid.setText(getConnectWifiSsid() + "(已连接)");
|
||||
} else {
|
||||
wifi_ssid.setText("(未连接)");
|
||||
}
|
||||
} else {
|
||||
// wifi_ssid.setText("WiFi未连接");
|
||||
wifi_ssid.setText("WiFi未连接");
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_disconnect));
|
||||
}
|
||||
}
|
||||
|
||||
private String getConnectWifiSsid() {
|
||||
WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
Log.d("wifiInfo", wifiInfo.toString());
|
||||
Log.d("SSID", wifiInfo.getSSID());
|
||||
return wifiInfo.getSSID();
|
||||
Log.e("wifiInfo", wifiInfo.toString());
|
||||
Log.e("SSID", wifiInfo.getSSID());
|
||||
return wifiInfo.getSSID().replace("\"", "");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,6 +273,18 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
return mWifiInfo.isConnected();
|
||||
}
|
||||
|
||||
public boolean isNetworkOnline1() {
|
||||
boolean isOnline = false;
|
||||
try {
|
||||
ConnectivityManager manager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkCapabilities capabilities = manager.getNetworkCapabilities(manager.getActiveNetwork()); // need ACCESS_NETWORK_STATE permission
|
||||
isOnline = capabilities != null && capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return isOnline;
|
||||
}
|
||||
|
||||
private void registerAlarmClockReceiver() {
|
||||
if (null == mAlarmClockReceiver) {
|
||||
mAlarmClockReceiver = new AlarmClockReceiver();
|
||||
@@ -306,7 +341,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, 0);
|
||||
int elec = (level * 100) / scale;
|
||||
Log.i(TAG, "electricity:=" + elec + "%");
|
||||
// tv_battery.setText(elec + "%");
|
||||
tv_battery.setText(elec + "%");
|
||||
} else if (Intent.ACTION_POWER_CONNECTED.equals(action)
|
||||
|| Intent.ACTION_POWER_DISCONNECTED.equals(action)
|
||||
|| Intent.ACTION_BATTERY_LOW.equals(action)
|
||||
@@ -358,6 +393,8 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
Log.e(TAG, "initView: " + Utils.getBatteryLevel(mContext));
|
||||
registerBatteryReceiver();
|
||||
registerAlarmClockReceiver();
|
||||
wifi_ssid.requestFocus();
|
||||
|
||||
mContext.registerReceiver(mbatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
|
||||
if (Settings.Global.getInt(mCRv, "is_aihealth", 0) == 1) {
|
||||
cl_appstore.setVisibility(View.GONE);
|
||||
@@ -401,9 +438,15 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
rv_noti.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
rv_noti.setAdapter(notificationAdapter);
|
||||
if (isWifiConnect()) {
|
||||
// wifi_ssid.setText(getConnectWifiSsid());
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_connect));
|
||||
if (isNetworkOnline1()) {
|
||||
wifi_ssid.setText(getConnectWifiSsid() + "(已连接)");
|
||||
} else {
|
||||
wifi_ssid.setText("(未连接)");
|
||||
}
|
||||
} else {
|
||||
// wifi_ssid.setText("WiFi未连接");
|
||||
wifi_ssid.setText("WiFi未连接");
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_disconnect));
|
||||
}
|
||||
sosNnmberAdapter = new SOSNnmberAdapter();
|
||||
rv_sos.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
@@ -458,12 +501,42 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
openScheme(SchemeUtils.SCHEME_HAND);
|
||||
}
|
||||
});
|
||||
cl_app.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (TextUtils.isEmpty(quickAppPackagesName)) {
|
||||
startActivity(new Intent(mContext, QuickAppActivity.class));
|
||||
} else {
|
||||
ApkUtils.openPackage(mContext, quickAppPackagesName);
|
||||
}
|
||||
}
|
||||
});
|
||||
cl_app.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
startActivity(new Intent(mContext, QuickAppActivity.class));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
cl_appstore.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ApkUtils.openApp(mContext, "com.uiuios.appstore");
|
||||
}
|
||||
});
|
||||
cl_wifi.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
cl_activation.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ApkUtils.openPackage(mContext, "com.uiuios.sn");
|
||||
}
|
||||
});
|
||||
// cl_exit.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
@@ -554,11 +627,11 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
NetInterfaceManager.getInstance().getContactList(new NetInterfaceManager.ContactCallback() {
|
||||
@Override
|
||||
public void setContact(List<Contact> contactList) {
|
||||
if (contactList == null || contactList.size() == 0) {
|
||||
showNoData("温馨提示", "请在小程序上设置通讯录");
|
||||
} else {
|
||||
startActivity(new Intent(getActivity(), ContactActivity.class));
|
||||
}
|
||||
// if (contactList == null || contactList.size() == 0) {
|
||||
// showNoData("温馨提示", "请在小程序上设置通讯录");
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -568,12 +641,12 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
|
||||
@Override
|
||||
public void setEmpty() {
|
||||
showNoData("温馨提示", "请在小程序上设置通讯录");
|
||||
// showNoData("温馨提示", "请在小程序上设置通讯录");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
startActivity(new Intent(mContext, ContactActivity.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -627,6 +700,36 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
// setAlarm();
|
||||
getAlarmClock();
|
||||
setSosNumber();
|
||||
setQuickApp();
|
||||
checkActivation();
|
||||
}
|
||||
|
||||
private void checkActivation() {
|
||||
int activation = Settings.Global.getInt(mContext.getContentResolver(), "uiui_activation", 0);
|
||||
if (activation == 0) {
|
||||
tv_name.setText("未" +
|
||||
"激活");
|
||||
} else {
|
||||
tv_name.setText("已激活");
|
||||
}
|
||||
}
|
||||
|
||||
private String quickAppPackagesName;
|
||||
|
||||
private void setQuickApp() {
|
||||
quickAppPackagesName = mMMKV.getString(QuickAppActivity.QUICK_APP_KEY, "");
|
||||
if (!TextUtils.isEmpty(quickAppPackagesName)) {
|
||||
ApplicationInfo applicationInfo = null;
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
try {
|
||||
applicationInfo = pm.getApplicationInfo(quickAppPackagesName, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (applicationInfo != null) {
|
||||
iv_app.setImageDrawable(applicationInfo.loadIcon(pm));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void openScheme(String uri) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.uiuios.aios.fragment.second;
|
||||
|
||||
import com.uiuios.aios.base.BasePresenter;
|
||||
import com.uiuios.aios.base.BaseView;
|
||||
import com.uiuios.aios.bean.ActivityBean;
|
||||
import com.uiuios.aios.bean.ArticleInfo;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SecondContact {
|
||||
public interface Presenter extends BasePresenter<View> {
|
||||
void getGoods();
|
||||
void getArticle();
|
||||
void getActivityList();
|
||||
}
|
||||
|
||||
public interface View extends BaseView {
|
||||
void setGoods(List<GoodsInfo> goodsInfos);
|
||||
void setArticle(List<ArticleInfo> articleInfoList);
|
||||
void setActivityList(List<ActivityBean> activityList);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,33 @@
|
||||
package com.uiuios.aios.fragment;
|
||||
package com.uiuios.aios.fragment.second;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.InfoListActivity;
|
||||
import com.uiuios.aios.activity.SpikeListActivity;
|
||||
import com.uiuios.aios.adapter.ActivityAdapter;
|
||||
import com.uiuios.aios.adapter.ArticleAdapter;
|
||||
import com.uiuios.aios.adapter.GoodsAdapter;
|
||||
import com.uiuios.aios.base.BaseFragment;
|
||||
import com.uiuios.aios.bean.ActivityBean;
|
||||
import com.uiuios.aios.bean.ArticleInfo;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.DemandBean;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
@@ -37,31 +38,15 @@ import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* A simple {@link androidx.fragment.app.Fragment} subclass.
|
||||
* Use the {@link SecondFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetworkStatusChangedListener {
|
||||
public class SecondFragment extends BaseFragment implements SecondContact.View, NetworkUtils.OnNetworkStatusChangedListener {
|
||||
private static final String TAG = SecondFragment.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.iv_img)
|
||||
ImageView iv_img;
|
||||
@BindView(R.id.tv_goods_name)
|
||||
TextView tv_goods_name;
|
||||
@BindView(R.id.tv_goods_desc)
|
||||
TextView tv_goods_desc;
|
||||
@BindView(R.id.tv_buying_price)
|
||||
TextView tv_buying_price;
|
||||
@BindView(R.id.progressBar)
|
||||
ProgressBar progressBar;
|
||||
@BindView(R.id.tv_snapup)
|
||||
TextView tv_snapup;
|
||||
|
||||
@BindView(R.id.iv_aimg)
|
||||
ImageView iv_aimg;
|
||||
@BindView(R.id.tv_title)
|
||||
@@ -105,8 +90,8 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
|
||||
@BindView(R.id.cl_demand)
|
||||
ConstraintLayout cl_demand;
|
||||
@BindView(R.id.cl1)
|
||||
ConstraintLayout cl1;
|
||||
// @BindView(R.id.cl1)
|
||||
// ConstraintLayout cl1;
|
||||
@BindView(R.id.cl2)
|
||||
ConstraintLayout cl2;
|
||||
@BindView(R.id.cl3)
|
||||
@@ -114,6 +99,14 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
@BindView(R.id.cl4)
|
||||
ConstraintLayout cl4;
|
||||
|
||||
@BindView(R.id.rv_goods)
|
||||
RecyclerView rv_goods;
|
||||
@BindView(R.id.rv_article)
|
||||
RecyclerView rv_article;
|
||||
@BindView(R.id.rv_activity)
|
||||
RecyclerView rv_activity;
|
||||
|
||||
|
||||
@BindView(R.id.nv_pic)
|
||||
NiceImageView nv_pic;
|
||||
@BindView(R.id.tv_like)
|
||||
@@ -121,9 +114,19 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
@BindView(R.id.tv_comment)
|
||||
TextView tv_comment;
|
||||
|
||||
private View rootView;
|
||||
@BindView(R.id.tv_spike_more)
|
||||
TextView tv_spike_more;
|
||||
@BindView(R.id.tv_info_more)
|
||||
TextView tv_info_more;
|
||||
|
||||
private android.view.View rootView;
|
||||
private Context mContext;
|
||||
private ContentResolver mCRv;
|
||||
private SecondPresenter mPresenter;
|
||||
|
||||
private GoodsAdapter mGoodsAdapter;
|
||||
private ArticleAdapter mArticleAdapter;
|
||||
private ActivityAdapter mActivityAdapter;
|
||||
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||
@@ -158,12 +161,12 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static SecondFragment newInstance(String param1, String param2) {
|
||||
SecondFragment fragment = new SecondFragment();
|
||||
SecondFragment secondFragment = new SecondFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_PARAM1, param1);
|
||||
args.putString(ARG_PARAM2, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
secondFragment.setArguments(args);
|
||||
return secondFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,22 +180,63 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
public android.view.View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
rootView = inflater.inflate(R.layout.fragment_second, container, false);
|
||||
mContext = rootView.getContext();
|
||||
mCRv = mContext.getContentResolver();
|
||||
mPresenter = new SecondPresenter(mContext);
|
||||
mPresenter.attachView(this);
|
||||
mPresenter.setLifecycle(lifecycleSubject);
|
||||
ButterKnife.bind(this, rootView);
|
||||
initView();
|
||||
initData();
|
||||
return rootView;
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mGoodsAdapter = new GoodsAdapter();
|
||||
mArticleAdapter = new ArticleAdapter();
|
||||
mActivityAdapter = new ActivityAdapter();
|
||||
|
||||
rv_goods.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
rv_goods.setAdapter(mGoodsAdapter);
|
||||
rv_article.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
rv_article.setAdapter(mArticleAdapter);
|
||||
rv_activity.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
rv_activity.setAdapter(mActivityAdapter);
|
||||
|
||||
cl_activity.setOnClickListener(new android.view.View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(android.view.View view) {
|
||||
openApp(0);
|
||||
}
|
||||
});
|
||||
cl_demand.setOnClickListener(new android.view.View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(android.view.View view) {
|
||||
openApp(1);
|
||||
}
|
||||
});
|
||||
tv_spike_more.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(mContext, SpikeListActivity.class));
|
||||
}
|
||||
});
|
||||
tv_info_more.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(mContext, InfoListActivity.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
getGoods();
|
||||
getArticle();
|
||||
getActivityList();
|
||||
mPresenter.getGoods();
|
||||
mPresenter.getArticle();
|
||||
mPresenter.getActivityList();
|
||||
getDemandList();
|
||||
}
|
||||
|
||||
@@ -206,16 +250,16 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
NetInterfaceManager.getInstance().getDemandList(true, lifecycleSubject, new NetInterfaceManager.DemandListCallback() {
|
||||
@Override
|
||||
public void setDemandList(List<DemandBean> demandBeans) {
|
||||
cl4.setVisibility(View.VISIBLE);
|
||||
iv4.setVisibility(View.GONE);
|
||||
cl4.setVisibility(android.view.View.VISIBLE);
|
||||
iv4.setVisibility(android.view.View.GONE);
|
||||
DemandBean demandBean = demandBeans.get(0);
|
||||
setDemand(demandBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void noData() {
|
||||
cl4.setVisibility(View.GONE);
|
||||
iv4.setVisibility(View.VISIBLE);
|
||||
cl4.setVisibility(android.view.View.GONE);
|
||||
iv4.setVisibility(android.view.View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,34 +283,6 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
tv_address_d.setText(demandBean.getAddress());
|
||||
}
|
||||
|
||||
private void getActivityList() {
|
||||
NetInterfaceManager.getInstance().getActivityList(true, lifecycleSubject, new NetInterfaceManager.ActivitiesListCallback() {
|
||||
@Override
|
||||
public void setActivitiesList(List<ActivityBean> activityBeans) {
|
||||
cl3.setVisibility(View.VISIBLE);
|
||||
iv3.setVisibility(View.GONE);
|
||||
ActivityBean activityBean = activityBeans.get(0);
|
||||
setActivity(activityBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void noData() {
|
||||
cl3.setVisibility(View.GONE);
|
||||
iv3.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setActivity(ActivityBean activity) {
|
||||
Glide.with(iv_avatar_a).load(activity.getAvatar()).error(getResources().getDrawable(R.drawable.default_head)).into(iv_avatar_a);
|
||||
tv_title_a.setText(activity.getName());
|
||||
@@ -287,21 +303,6 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
return time;
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
cl_activity.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
openApp(0);
|
||||
}
|
||||
});
|
||||
cl_demand.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
openApp(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void openApp(int position) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
@@ -316,95 +317,37 @@ public class SecondFragment extends BaseFragment implements NetworkUtils.OnNetwo
|
||||
}
|
||||
}
|
||||
|
||||
private void getGoods() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getGoodsListObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycleSubject, FragmentEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<GoodsInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getGoods", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<GoodsInfo>> listBaseResponse) {
|
||||
Log.e("getGoods", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl1.setVisibility(View.VISIBLE);
|
||||
iv1.setVisibility(View.GONE);
|
||||
List<GoodsInfo> goodsInfoList = listBaseResponse.data;
|
||||
if (goodsInfoList != null && goodsInfoList.size() != 0) {
|
||||
GoodsInfo goodsInfo = goodsInfoList.get(0);
|
||||
setGoodsInfo(goodsInfo);
|
||||
}
|
||||
} else {
|
||||
cl1.setVisibility(View.GONE);
|
||||
iv1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getGoods", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getGoods", "onComplete: ");
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void setGoods(List<GoodsInfo> goodsInfos) {
|
||||
if (goodsInfos != null && goodsInfos.size() != 0) {
|
||||
iv1.setVisibility(android.view.View.GONE);
|
||||
mGoodsAdapter.setGoodsInfoList(goodsInfos);
|
||||
} else {
|
||||
iv1.setVisibility(android.view.View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setGoodsInfo(GoodsInfo goodsInfo) {
|
||||
Glide.with(iv_img).load(goodsInfo.getImg()).into(iv_img);
|
||||
tv_goods_name.setText(goodsInfo.getGoods_name());
|
||||
tv_goods_desc.setText(goodsInfo.getGoods_desc());
|
||||
tv_buying_price.setText(String.valueOf(goodsInfo.getBuying_price()));
|
||||
@Override
|
||||
public void setArticle(List<ArticleInfo> articleInfoList) {
|
||||
if (articleInfoList != null && articleInfoList.size() != 0) {
|
||||
// cl2.setVisibility(View.VISIBLE);
|
||||
iv2.setVisibility(android.view.View.GONE);
|
||||
mArticleAdapter.setArticleBeanList(articleInfoList);
|
||||
} else {
|
||||
// cl2.setVisibility(View.GONE);
|
||||
iv2.setVisibility(android.view.View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void getArticle() {
|
||||
NetInterfaceManager.getInstance().getArticleListObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycleSubject, FragmentEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<ArticleInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getArticle", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<ArticleInfo>> listBaseResponse) {
|
||||
Log.e("getArticle", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl2.setVisibility(View.VISIBLE);
|
||||
iv2.setVisibility(View.GONE);
|
||||
List<ArticleInfo> articleInfos = listBaseResponse.data;
|
||||
if (articleInfos != null && articleInfos.size() != 0) {
|
||||
ArticleInfo articleInfo = articleInfos.get(0);
|
||||
setArticleInfo(articleInfo);
|
||||
}
|
||||
} else {
|
||||
cl2.setVisibility(View.GONE);
|
||||
iv2.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getArticle", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getArticle", "onComplete: ");
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void setActivityList(List<ActivityBean> activityList) {
|
||||
if (activityList != null && activityList.size() != 0) {
|
||||
// cl3.setVisibility(android.view.View.VISIBLE);
|
||||
iv3.setVisibility(android.view.View.GONE);
|
||||
mActivityAdapter.setActivityBeans(activityList);
|
||||
} else {
|
||||
// cl3.setVisibility(android.view.View.GONE);
|
||||
iv3.setVisibility(android.view.View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setArticleInfo(ArticleInfo articleInfo) {
|
||||
Glide.with(iv_aimg).load(articleInfo.getImg()).into(iv_aimg);
|
||||
tv_title.setText(articleInfo.getTitle());
|
||||
tv_content.setText(articleInfo.getContent());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.uiuios.aios.fragment.second;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.uiuios.aios.bean.ActivityBean;
|
||||
import com.uiuios.aios.bean.ArticleInfo;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.GoodsInfo;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
public class SecondPresenter implements SecondContact.Presenter {
|
||||
|
||||
private static final String TAG = SecondPresenter.class.getSimpleName();
|
||||
private Context mContext;
|
||||
private SecondContact.View mView;
|
||||
|
||||
public SecondPresenter(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
private BehaviorSubject<FragmentEvent> lifecycle;
|
||||
|
||||
void setLifecycle(BehaviorSubject<FragmentEvent> lifecycle) {
|
||||
this.lifecycle = lifecycle;
|
||||
}
|
||||
|
||||
public BehaviorSubject<FragmentEvent> getLifecycle() {
|
||||
return lifecycle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachView(@NonNull SecondContact.View view) {
|
||||
this.mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detachView() {
|
||||
this.mView = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGoods() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getGoodsListObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<GoodsInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getGoods", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<GoodsInfo>> listBaseResponse) {
|
||||
Log.e("getGoods", "onNext: " + listBaseResponse);
|
||||
List<GoodsInfo> goodsInfos = listBaseResponse.data;
|
||||
mView.setGoods(goodsInfos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getGoods", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getGoods", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getArticle() {
|
||||
NetInterfaceManager.getInstance().getArticleListObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<ArticleInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getArticle", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<ArticleInfo>> listBaseResponse) {
|
||||
Log.e("getArticle", "onNext: " + listBaseResponse);
|
||||
mView.setArticle(listBaseResponse.data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getArticle", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getArticle", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getActivityList() {
|
||||
NetInterfaceManager.getInstance().getActivityList(true, getLifecycle(), new NetInterfaceManager.ActivitiesListCallback() {
|
||||
@Override
|
||||
public void setActivitiesList(List<ActivityBean> activityBeans) {
|
||||
mView.setActivityList(activityBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void noData() {
|
||||
mView.setActivityList(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.uiuios.aios.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -9,6 +10,7 @@ import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.baidu.location.LocationClientOption;
|
||||
import com.blankj.utilcode.util.SPUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
@@ -27,7 +29,6 @@ public class AmapManager {
|
||||
private LocationClientOption mOption;
|
||||
private BDLocation mLocation;
|
||||
private CacheHelper mCacheHelper;
|
||||
private MMKV mmkv = MMKV.defaultMMKV();
|
||||
|
||||
private static final String AMAPLOCATION_JSON_KEY = "MAPLOCATION_JSON_STRING";
|
||||
public static final String LONGITUDE_KEY = "map_longitude_key";
|
||||
@@ -38,6 +39,7 @@ public class AmapManager {
|
||||
private AmapManager(Context context) {
|
||||
this.mContext = context;
|
||||
this.mCacheHelper = new CacheHelper(context);
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||
initAmap();
|
||||
}
|
||||
|
||||
@@ -58,7 +60,10 @@ public class AmapManager {
|
||||
}
|
||||
|
||||
public void initAmap() {
|
||||
mLocationClient = new LocationClient(mContext);
|
||||
if (mLocationClient == null) {
|
||||
mLocationClient = new LocationClient(mContext);
|
||||
}
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||
mLocationClient.setLocOption(getDefaultLocationClientOption());
|
||||
mLocationClient.registerLocationListener(mListener);
|
||||
mLocationClient.stop();
|
||||
@@ -75,7 +80,7 @@ public class AmapManager {
|
||||
|
||||
public BDLocation getNowMapLocation() {
|
||||
if (mLocation == null) {
|
||||
String aMapLocationjson = mmkv.decodeString(AMAPLOCATION_JSON_KEY);
|
||||
String aMapLocationjson = SPUtils.getInstance().getString(AMAPLOCATION_JSON_KEY,"");
|
||||
if (TextUtils.isEmpty(aMapLocationjson)) {
|
||||
return null;
|
||||
}
|
||||
@@ -148,7 +153,7 @@ public class AmapManager {
|
||||
case BDLocation.TypeGpsLocation:// GPS定位结果
|
||||
case BDLocation.TypeNetWorkLocation:// 网络定位结果
|
||||
case BDLocation.TypeOffLineLocation:// 离线定位结果
|
||||
mmkv.encode(AMAPLOCATION_JSON_KEY, GsonUtils.toJsonString(location));
|
||||
SPUtils.getInstance().put(AMAPLOCATION_JSON_KEY, GsonUtils.toJsonString(location));
|
||||
Log.e(TAG, "onLocationChanged: " + "定位成功");
|
||||
Log.e(TAG, "onLocationChanged: longitude = " + location.getLongitude());
|
||||
Log.e(TAG, "onLocationChanged: latitude = " + location.getLatitude());
|
||||
@@ -282,6 +287,9 @@ public class AmapManager {
|
||||
// }
|
||||
Log.e(TAG, "AmapAddress: " + mCacheHelper.getAsString(ADDRESS_KEY));
|
||||
Log.e(TAG, "AmapError: " + mCacheHelper.getAsString(ERROR_KEY));
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-gps");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -299,7 +299,7 @@ public class NetInterfaceManager {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public Observer getUserIDObserver(onCompleteCallback callback) {
|
||||
public Observer<BaseResponse<UserId>> getUserIDObserver(onCompleteCallback callback) {
|
||||
return new Observer<BaseResponse<UserId>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
@@ -794,7 +794,7 @@ public class NetInterfaceManager {
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<SnInfo> snInfoBaseResponse) {
|
||||
Log.e("getSnInfo", "onNext: ");
|
||||
Log.e("getSnInfo", "onNext: " + snInfoBaseResponse);
|
||||
callback.setSnInfo(snInfoBaseResponse.data);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -59,11 +60,20 @@ public class ApkUtils {
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.uiuios");
|
||||
this.add("com.uiui.os");
|
||||
this.add("com.uiui.health");
|
||||
// this.add("com.uiui.health");
|
||||
this.add("com.tencent.android.qqdownloader");
|
||||
this.add("com.uiuios.appstore");
|
||||
// this.add("com.uiuios.appstore");
|
||||
this.add("com.joytv.live");
|
||||
}};
|
||||
|
||||
private static HashSet<String> excludeClassName = new HashSet<String>() {{
|
||||
this.add("com.android.dialer.app.calllog.CallLogActivity");
|
||||
}};
|
||||
|
||||
private static HashSet<String> showPackageName = new HashSet<String>() {{
|
||||
this.add("com.uiuios.sn");
|
||||
this.add("com.uiuios.browser");
|
||||
// this.add("com.uiuios.appstore");
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.android.gallery3d");
|
||||
this.add("com.android.settings");
|
||||
@@ -72,7 +82,8 @@ public class ApkUtils {
|
||||
this.add("com.mediatek.camera");
|
||||
this.add("com.android.mms");
|
||||
this.add("com.uiui.city");
|
||||
this.add("com.alldocube.store");
|
||||
this.add("com.uiui.health");
|
||||
// this.add("com.alldocube.store");
|
||||
this.add("com.android.fmradio");
|
||||
this.add("com.android.documentsui");
|
||||
this.add("com.android.calculator2");
|
||||
@@ -146,8 +157,7 @@ public class ApkUtils {
|
||||
public static ArrayList<DesktopIcon> queryFilterAppInfo(Context context) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
// 查询所有已经安装的应用程序
|
||||
List<ApplicationInfo> appInfos = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);// GET_UNINSTALLED_PACKAGES代表已删除,但还有安装目录的
|
||||
ArrayList<ApplicationInfo> applicationInfos = new ArrayList<>();
|
||||
List<ResolveInfo> resolveInfos = new ArrayList<>();
|
||||
|
||||
// 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent
|
||||
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
|
||||
@@ -158,69 +168,85 @@ public class ApkUtils {
|
||||
Set<String> allowPackages = new HashSet();
|
||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||
Log.i(TAG, "queryFilterAppInfo: " + resolveInfo.activityInfo.packageName);
|
||||
Log.i(TAG, "queryFilterAppInfo: " + resolveInfo.activityInfo.name);
|
||||
allowPackages.add(resolveInfo.activityInfo.packageName);
|
||||
}
|
||||
|
||||
for (ApplicationInfo app : appInfos) {
|
||||
if (appIsDisable(context, app.packageName)) {
|
||||
Log.e(TAG, "queryFilterAppInfo: disable = " + app.packageName);
|
||||
String appListString = Settings.System.getString(context.getContentResolver(), "only_jgy_shortcut_list");
|
||||
List<String> packageList = new ArrayList<>();
|
||||
if (!TextUtils.isEmpty(appListString)) {
|
||||
packageList = new ArrayList<>(Arrays.asList(appListString.split(",")));
|
||||
}
|
||||
int setting_other_appInstaller = Settings.Global.getInt(context.getContentResolver(), "setting_other_appInstaller", 1);
|
||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||
String pkg = resolveInfo.activityInfo.packageName;
|
||||
if (appIsDisable(context, pkg)) {
|
||||
Log.e(TAG, "queryFilterAppInfo: disable = " + pkg);
|
||||
continue;
|
||||
}
|
||||
if ((app.flags & ApplicationInfo.FLAG_SYSTEM) > 0)//通过flag排除系统应用,会将电话、短信也排除掉
|
||||
if (isSystemApp(context, pkg))//通过flag排除系统应用,会将电话、短信也排除掉
|
||||
{
|
||||
if (showPackageName.contains(app.packageName)) {
|
||||
applicationInfos.add(app);
|
||||
if (showPackageName.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
} else {
|
||||
// if(app.uid > 10000){//通过uid排除系统应用,在一些手机上效果不好
|
||||
// applicationInfos.add(app);
|
||||
// }
|
||||
if (allowPackages.contains(app.packageName) && !excludePackageName.contains(app.packageName)) {
|
||||
// if (allowPackages.contains(app.packageName)) {
|
||||
applicationInfos.add(app);
|
||||
if (setting_other_appInstaller == 0) {//不显示自己安装的
|
||||
if (packageList.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
} else {
|
||||
if (allowPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Settings.Global.getInt(context.getContentResolver(), "is_activity", 0) == 0) {
|
||||
applicationInfos.removeIf(applicationInfo -> "com.uiui.city".equals(applicationInfo.packageName));
|
||||
resolveInfos.removeIf(resolveInfo -> "com.uiui.city".equals(resolveInfo.activityInfo.packageName));
|
||||
// resolveInfos.removeIf(applicationInfo -> "com.uiui.sn".equals(applicationInfo.packageName));
|
||||
}
|
||||
|
||||
applicationInfos.sort(new Comparator<ApplicationInfo>() {
|
||||
resolveInfos.sort(new Comparator<ResolveInfo>() {
|
||||
@Override
|
||||
public int compare(ApplicationInfo o1, ApplicationInfo o2) {
|
||||
public int compare(ResolveInfo o1, ResolveInfo o2) {
|
||||
return Collator.getInstance(Locale.CHINESE).compare(o1.loadLabel(pm).toString(), o2.loadLabel(pm).toString());
|
||||
// return o1.loadLabel(pm).toString().compareTo(o2.loadLabel(pm).toString());
|
||||
}
|
||||
});
|
||||
applicationInfos.sort(new Comparator<ApplicationInfo>() {
|
||||
resolveInfos.sort(new Comparator<ResolveInfo>() {
|
||||
@Override
|
||||
public int compare(ApplicationInfo o1, ApplicationInfo o2) {
|
||||
if ((o1.flags & ApplicationInfo.FLAG_SYSTEM) <= (o2.flags & ApplicationInfo.FLAG_SYSTEM)) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
public int compare(ResolveInfo o1, ResolveInfo o2) {
|
||||
try {
|
||||
if ((pm.getApplicationInfo(o1.activityInfo.packageName, 0).flags & ApplicationInfo.FLAG_SYSTEM) <= (pm.getApplicationInfo(o2.activityInfo.packageName, 0).flags & ApplicationInfo.FLAG_SYSTEM)) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
ArrayList<DesktopIcon> desktopIcons = new ArrayList<>();
|
||||
HashMap<String, ApplicationInfo> infoHashMap = new HashMap<>();
|
||||
for (ApplicationInfo applicationInfo : applicationInfos) {
|
||||
infoHashMap.put(applicationInfo.packageName, applicationInfo);
|
||||
}
|
||||
for (int i = 0; i < defaultSort.size(); i++) {
|
||||
ApplicationInfo info = infoHashMap.get(defaultSort.get(i));
|
||||
if (info != null) {
|
||||
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, info, i));
|
||||
infoHashMap.remove(defaultSort.get(i));
|
||||
for (ResolveInfo applicationInfo : resolveInfos) {
|
||||
if (!excludeClassName.contains(applicationInfo.activityInfo.name)) {
|
||||
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, applicationInfo));
|
||||
}
|
||||
}
|
||||
|
||||
for (ApplicationInfo applicationInfo : infoHashMap.values()) {
|
||||
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, applicationInfo));
|
||||
}
|
||||
return desktopIcons;
|
||||
}
|
||||
|
||||
public static boolean isSystemApp(Context context, String pkg) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
ApplicationInfo applicationInfo = null;
|
||||
try {
|
||||
applicationInfo = pm.getApplicationInfo(pkg, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (applicationInfo == null) return false;
|
||||
return (applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0;
|
||||
}
|
||||
|
||||
private static boolean appIsDisable(Context context, String pkg) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
return pm.getApplicationEnabledSetting(pkg) == PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
||||
@@ -508,4 +534,4 @@ public class ApkUtils {
|
||||
return uid / PER_USER_RANGE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ public class BitmapUtils {
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
return Utils.getRoundedBitmap(bitmap, context);
|
||||
} else {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
return Utils.getRoundedBitmap(((BitmapDrawable) drawable).getBitmap(), context);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class GlideLoadUtils {
|
||||
if (fragment != null && fragment.getActivity() != null) {
|
||||
Glide.with(fragment).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,android.app.Fragment is null");
|
||||
Log.i(TAG, "Picture loading failed,android.app.SecondFragment is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
@@ -20,6 +26,7 @@ import android.util.Log;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -203,5 +210,53 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap getRoundedBitmap(Bitmap mBitmap, Context context) {
|
||||
Bitmap bgBitmap = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
|
||||
Bitmap mask = BitmapFactory.decodeResource(context.getResources(), R.drawable.mask);
|
||||
int width = mask.getWidth();
|
||||
int height = mask.getHeight();
|
||||
Bitmap bitmapScale = Bitmap.createScaledBitmap(mBitmap, width, height, true);
|
||||
bitmapScale.setDensity(context.getResources().getDisplayMetrics().densityDpi);
|
||||
// Palette p = Palette.from(mBitmap).generate();
|
||||
// Palette.Swatch vibrant = p.getVibrantSwatch();//有活力的
|
||||
// int color = vibrant.getRgb(); //样本中的像素数量
|
||||
|
||||
Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas();
|
||||
Paint paint = new Paint();
|
||||
|
||||
canvas.setBitmap(result);
|
||||
// canvas.drawColor(color);
|
||||
canvas.drawBitmap(mask, 0, 0, paint);
|
||||
// paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
canvas.drawBitmap(bitmapScale, 0, 0, paint);
|
||||
// return result;
|
||||
|
||||
Bitmap result2 = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas2 = new Canvas();
|
||||
Paint paint2 = new Paint();
|
||||
canvas2.setBitmap(result2);
|
||||
canvas2.drawBitmap(mask, 0, 0, paint2);
|
||||
paint2.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
canvas2.drawBitmap(result, 0, 0, paint2);
|
||||
return result2;
|
||||
|
||||
|
||||
// Canvas mCanvas = new Canvas();
|
||||
// mCanvas.setBitmap(bgBitmap);
|
||||
// Paint mPaint = new Paint();
|
||||
// RectF mRectM = new RectF(scaleM, scaleM, mBitmap.getWidth() - scaleM, mBitmap.getHeight() - scaleM); //设置剪裁圆角的区域
|
||||
// Rect mRect = new Rect(0, 0, mBitmap.getWidth(), mBitmap.getHeight());
|
||||
// RectF mRectF = mRectM;
|
||||
//
|
||||
// float roundPx = 15; //圆角半径
|
||||
// mPaint.setAntiAlias(true);
|
||||
// //Log.d("wy"+TAG,"mBitmap.getWidth()="+mBitmap.getWidth()+", mBitmap.getHeight()="+mBitmap.getHeight());
|
||||
// mCanvas.drawRoundRect(mRectF, roundPx, roundPx, mPaint);
|
||||
// mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
// mCanvas.drawBitmap(mBitmap, mRect, mRect, mPaint);
|
||||
// return bgBitmap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
25
app/src/main/java/com/uiuios/aios/view/CenterImageSpan.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.uiuios.aios.view;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.style.ImageSpan;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class CenterImageSpan extends ImageSpan {
|
||||
public CenterImageSpan(Drawable drawable) {
|
||||
super(drawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(@NonNull Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, @NonNull Paint paint) {
|
||||
Drawable b = getDrawable();
|
||||
Paint.FontMetricsInt fm = paint.getFontMetricsInt();
|
||||
int transY = (y + fm.descent + y + fm.ascent) / 2 - b.getBounds().bottom / 2;
|
||||
canvas.save();
|
||||
canvas.translate(x, transY);
|
||||
b.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.uiuios.aios.view;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 描述 : RecyclerView GridLayoutManager 等间距。
|
||||
* <p>
|
||||
* 等间距需满足两个条件:
|
||||
* 1.各个模块的大小相等,即 各列的left+right 值相等;
|
||||
* 2.各列的间距相等,即 前列的right + 后列的left = 列间距;
|
||||
* <p>
|
||||
* 在{@link #getItemOffsets(Rect, View, RecyclerView, RecyclerView.State)} 中针对 outRect 的left 和right 满足这两个条件即可
|
||||
* <p>
|
||||
* 作者 : shiguotao
|
||||
* 版本 : V1
|
||||
* 创建时间 : 2020/3/19 4:54 PM
|
||||
*/
|
||||
public class GridSpaceItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
private final String TAG = "GridSpaceItemDecoration";
|
||||
|
||||
private int mSpanCount;//横条目数量
|
||||
private int mRowSpacing;//行间距
|
||||
private int mColumnSpacing;// 列间距
|
||||
|
||||
/**
|
||||
* @param spanCount 列数
|
||||
* @param rowSpacing 行间距
|
||||
* @param columnSpacing 列间距
|
||||
*/
|
||||
public GridSpaceItemDecoration(int spanCount, int rowSpacing, int columnSpacing) {
|
||||
this.mSpanCount = spanCount;
|
||||
this.mRowSpacing = rowSpacing;
|
||||
this.mColumnSpacing = columnSpacing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
int position = parent.getChildAdapterPosition(view); // 获取view 在adapter中的位置。
|
||||
int column = position % mSpanCount; // view 所在的列
|
||||
|
||||
outRect.left = column * mColumnSpacing / mSpanCount; // column * (列间距 * (1f / 列数))
|
||||
outRect.right = mColumnSpacing - (column + 1) * mColumnSpacing / mSpanCount; // 列间距 - (column + 1) * (列间距 * (1f /列数))
|
||||
|
||||
Log.e(TAG, "position:" + position
|
||||
+ " columnIndex: " + column
|
||||
+ " left,right ->" + outRect.left + "," + outRect.right);
|
||||
|
||||
// 如果position > 行数,说明不是在第一行,则不指定行高,其他行的上间距为 top=mRowSpacing
|
||||
if (position >= mSpanCount) {
|
||||
outRect.top = mRowSpacing; // item top
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/battery_icon.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
app/src/main/res/drawable-hdpi/certified.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable-hdpi/details_back.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.7 KiB |
BIN
app/src/main/res/drawable-hdpi/home_quick_app.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 7.7 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_dialer.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_selected.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_unselected.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-hdpi/insurance.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-hdpi/mask.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-hdpi/search_icon.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable-hdpi/ship.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable-hdpi/wifi_connect.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
app/src/main/res/drawable-hdpi/wifi_disconnect.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
18
app/src/main/res/drawable/app_select_background.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#444444" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_8"
|
||||
android:bottomRightRadius="@dimen/dp_8"
|
||||
android:topLeftRadius="@dimen/dp_8"
|
||||
android:topRightRadius="@dimen/dp_8" />
|
||||
|
||||
<padding
|
||||
android:right="@dimen/dp_8"
|
||||
android:left="@dimen/dp_8"
|
||||
android:top="@dimen/dp_8"
|
||||
android:bottom="@dimen/dp_8"
|
||||
/>
|
||||
</shape>
|
||||
25
app/src/main/res/drawable/barcolor.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 设置背景色(黑色) -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_6" />
|
||||
<gradient
|
||||
android:endColor="@color/progress_bg"
|
||||
android:startColor="@color/progress_bg" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 设置进度条颜色(白色) -->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_6" />
|
||||
<gradient
|
||||
android:endColor="@color/red"
|
||||
android:startColor="@color/red" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
20
app/src/main/res/drawable/buying_bg.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="@color/red" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_4"
|
||||
android:topRightRadius="@dimen/dp_4"
|
||||
android:bottomLeftRadius="@dimen/dp_4"
|
||||
android:bottomRightRadius="@dimen/dp_4" />
|
||||
|
||||
<padding
|
||||
|
||||
android:left="@dimen/dp_4"
|
||||
android:right="@dimen/dp_4"
|
||||
android:top="@dimen/dp_2"
|
||||
android:bottom="@dimen/dp_2"/>
|
||||
</shape>
|
||||
17
app/src/main/res/drawable/class_bg.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#232323" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_2"
|
||||
android:bottomRightRadius="@dimen/dp_2"
|
||||
android:topLeftRadius="@dimen/dp_2"
|
||||
android:topRightRadius="@dimen/dp_2" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_1"
|
||||
android:left="@dimen/dp_2"
|
||||
android:right="@dimen/dp_2"
|
||||
android:top="@dimen/dp_1" />
|
||||
</shape>
|
||||
20
app/src/main/res/drawable/contact_bg1.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
|
||||
<padding
|
||||
android:top="4dp"
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
/>
|
||||
</shape>
|
||||
20
app/src/main/res/drawable/contact_bg2.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="#00d56b" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
|
||||
<padding
|
||||
android:top="4dp"
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
/>
|
||||
</shape>
|
||||
20
app/src/main/res/drawable/contact_bg3.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="#7f64cd" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
|
||||
<padding
|
||||
android:top="4dp"
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
/>
|
||||
</shape>
|
||||
@@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#0480ff" />
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_8"
|
||||
@@ -10,9 +10,9 @@
|
||||
android:topLeftRadius="@dimen/dp_8"
|
||||
android:topRightRadius="@dimen/dp_8" />
|
||||
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="4dp"-->
|
||||
<!-- android:left="20dp"-->
|
||||
<!-- android:right="20dp"-->
|
||||
<!-- android:top="4dp" />-->
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="4dp"-->
|
||||
<!-- android:left="20dp"-->
|
||||
<!-- android:right="20dp"-->
|
||||
<!-- android:top="4dp" />-->
|
||||
</shape>
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="@color/health_bg_color" />
|
||||
android:color="@color/white" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
|
||||
13
app/src/main/res/drawable/goods_list_bg.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="@color/white" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp"
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp" />
|
||||
</shape>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/default_background_color" />
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
|
||||
<padding
|
||||
android:bottom="0dp"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/lightGray" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
|
||||
<padding
|
||||
android:bottom="0dp"
|
||||
|
||||
18
app/src/main/res/drawable/noti_background.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#EAE8E8" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_32"
|
||||
android:bottomRightRadius="@dimen/dp_32"
|
||||
android:topLeftRadius="@dimen/dp_32"
|
||||
android:topRightRadius="@dimen/dp_32" />
|
||||
|
||||
<padding
|
||||
android:right="@dimen/dp_20"
|
||||
android:left="@dimen/dp_20"
|
||||
android:top="@dimen/dp_8"
|
||||
android:bottom="@dimen/dp_8"
|
||||
/>
|
||||
</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="@color/notice_blue" />
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="30dp"
|
||||
|
||||
8
app/src/main/res/drawable/search_bg.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- <solid android:color="#FFFFFF" />-->
|
||||
<stroke
|
||||
android:width="3px"
|
||||
android:color="#EA4F77" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
</shape>
|
||||
@@ -36,7 +36,7 @@
|
||||
<!-- android:width="1dp"-->
|
||||
<!-- android:color="#fff" />-->
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
<solid android:color="#0480ff" />
|
||||
<solid android:color="@color/default_blue" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
17
app/src/main/res/drawable/subsidy_bg.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#fdedbc" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_20"
|
||||
android:bottomRightRadius="@dimen/dp_20"
|
||||
android:topLeftRadius="@dimen/dp_20"
|
||||
android:topRightRadius="@dimen/dp_20" />
|
||||
|
||||
<padding
|
||||
android:top="@dimen/dp_4"
|
||||
android:right="@dimen/dp_8"
|
||||
android:left="@dimen/dp_8"
|
||||
android:bottom="@dimen/dp_4" />
|
||||
</shape>
|
||||
@@ -37,7 +37,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_back"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -135,7 +134,7 @@
|
||||
android:id="@+id/tv_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="WIFI"
|
||||
android:text="网络"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -157,7 +156,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_wifi"
|
||||
app:layout_constraintVertical_bias="0.2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -205,7 +203,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_sound"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_sound"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_sound" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -215,7 +212,6 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
|
||||
<com.uiuios.aios.view.RulerSeekBar
|
||||
android:id="@+id/seekBar"
|
||||
android:layout_width="0dp"
|
||||
@@ -307,7 +303,6 @@
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/tv_font_size" />-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -457,13 +452,12 @@
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="100%"
|
||||
android:text="亮度"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_24"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_brightness"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_brightness"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_brightness" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -502,7 +496,5 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,37 +13,120 @@
|
||||
android:id="@+id/constraintLayout5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_head"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_activation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxEms="8"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="未激活"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head" />
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_head"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxEms="8"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="未激活"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="@dimen/dp_144"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_activation"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi_disconnect"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_ssid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:singleLine="true"
|
||||
android:text="WiFi"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView6"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/battery_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_battery"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="100%"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView6"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_control"
|
||||
@@ -81,6 +164,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -132,7 +216,7 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="天气预报"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -196,20 +280,19 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="我的闹钟"
|
||||
android:textColor="@color/lightGray"
|
||||
android:text="爱心闹钟"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/iv_note_nodata"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/home_reminder_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/noti_background"
|
||||
android:text="暂无提醒"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -243,7 +326,7 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="紧急呼叫"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -345,7 +428,7 @@
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="一键加速"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
@@ -388,10 +471,8 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_health"
|
||||
android:layout_width="0dp"
|
||||
@@ -401,7 +482,8 @@
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
android:background="@drawable/custom_bg_health"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
@@ -410,7 +492,7 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="健康码"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -430,6 +512,44 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_app"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="快捷应用"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_app"
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_quick_app"
|
||||
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
|
||||
android:id="@+id/cl_contact"
|
||||
android:layout_width="0dp"
|
||||
@@ -448,7 +568,7 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="通讯录"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -495,7 +615,7 @@
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_appstore_icon"
|
||||
android:src="@drawable/systemapp_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -537,42 +657,42 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_control"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_4"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/custom_bg_health">-->
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_control"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_4"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/custom_bg_health">-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textView6"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_8"-->
|
||||
<!-- android:text="快捷设置"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textView6"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_8"-->
|
||||
<!-- android:text="快捷设置"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_68"-->
|
||||
<!-- android:layout_height="@dimen/dp_68"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/home_clinical_hand"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_68"-->
|
||||
<!-- android:layout_height="@dimen/dp_68"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/home_clinical_hand"-->
|
||||
<!-- 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>-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_exit"-->
|
||||
@@ -591,7 +711,7 @@
|
||||
<!-- android:layout_marginStart="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_4"-->
|
||||
<!-- android:text="切换系统"-->
|
||||
<!-- android:textColor="@color/lightGray"-->
|
||||
<!-- android:textColor="@color/title_gray"-->
|
||||
<!-- android:textSize="@dimen/sp_15"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.SecondFragment">
|
||||
tools:context="fragment.second.SecondFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -19,10 +19,10 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg">
|
||||
|
||||
@@ -30,20 +30,31 @@
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="秒杀抢购"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_spike_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -52,123 +63,13 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl1"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_goods"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView9">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_img"
|
||||
android:layout_width="152dp"
|
||||
android:layout_height="152dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goods_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:maxLines="1"
|
||||
android:text="商品名称"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_img" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goods_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:maxLines="5"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_img"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_goods_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_goods_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView14"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="购买信息"
|
||||
android:textColor="@color/red"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_img" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="秒杀价格"
|
||||
android:textColor="@color/red"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView14"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView16"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="¥"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView15"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_buying_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100.00"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView16"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView16" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/main_pb_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView15"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView15" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="@+id/progressBar"
|
||||
app:layout_constraintStart_toEndOf="@+id/progressBar"
|
||||
app:layout_constraintTop_toTopOf="@+id/progressBar"
|
||||
app:layout_constraintVertical_bias="0.5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_snapup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="立刻抢购"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView9"
|
||||
tools:layout_editor_absoluteX="0dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -181,10 +82,10 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg">
|
||||
|
||||
@@ -192,20 +93,31 @@
|
||||
android:id="@+id/textView13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="养生资讯"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_info_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -214,6 +126,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_article"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView13" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl2"
|
||||
android:layout_width="match_parent"
|
||||
@@ -233,11 +154,11 @@
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:text="sadas"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_aimg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_aimg" />
|
||||
@@ -246,7 +167,7 @@
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_aimg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -257,8 +178,8 @@
|
||||
android:id="@+id/tv_readnow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:text="阅读全文"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -270,17 +191,18 @@
|
||||
android:id="@+id/cl_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg">
|
||||
android:background="@drawable/custom_bg"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -288,8 +210,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv3"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -303,21 +225,30 @@
|
||||
android:id="@+id/textView18"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="附近活动"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView18" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -338,7 +269,7 @@
|
||||
android:id="@+id/tv_title_a"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="活动名称"
|
||||
android:textColor="@color/black"
|
||||
@@ -403,7 +334,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/imageView2"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView2"
|
||||
app:layout_constraintTop_toTopOf="@+id/imageView2" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
@@ -484,18 +414,18 @@
|
||||
android:id="@+id/cl_demand"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv4"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -508,7 +438,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -518,12 +448,12 @@
|
||||
android:id="@+id/textView19"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="服务需求"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -552,7 +482,7 @@
|
||||
android:id="@+id/tv_title_d"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="活动名称"
|
||||
android:textColor="@color/black"
|
||||
@@ -572,7 +502,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_title_d"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_title_d"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title_d"
|
||||
app:layout_goneMarginStart="4dp" />
|
||||
app:layout_goneMarginStart="@dimen/dp_4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time_d"
|
||||
@@ -599,9 +529,7 @@
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_time_d"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time_d" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
157
app/src/main/res/layout-land/item_goods_list.xml
Normal file
@@ -0,0 +1,157 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_img"
|
||||
android:layout_width="@dimen/dp_108"
|
||||
android:layout_height="@dimen/dp_108"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:corner_radius="@dimen/dp_4"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_img"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_img">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_weight="2"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_img"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_img">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:background="@drawable/class_bg"
|
||||
android:maxLines="1"
|
||||
android:text="品牌"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_type"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:maxLines="3"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_type"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_buying_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:text="秒杀价格"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintBottom_toTopOf="@+id/progressBar"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:text="秒杀价格"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_buying_price"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_buying_price" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_buying"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:background="@drawable/buying_bg"
|
||||
android:text="立即抢购"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:progress="90"
|
||||
android:progressDrawable="@drawable/barcolor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView6"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:text="已抢90%"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_6"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/progressBar"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_buying"
|
||||
app:layout_constraintTop_toTopOf="@+id/progressBar" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
87
app/src/main/res/layout-land/item_notification.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="提醒事件"
|
||||
android:textColor="@color/black"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="@dimen/dp_72"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:corner_radius="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/tv_bg_noti"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="提醒时间"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_voice"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/voice_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_voice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="0秒"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/voice"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -37,7 +37,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_back"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -102,7 +101,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_flashlight" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="0dp"
|
||||
@@ -127,7 +125,7 @@
|
||||
android:id="@+id/tv_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="WIFI"
|
||||
android:text="网络"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -148,7 +146,6 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_wifi"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_wifi" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -248,10 +245,8 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_battery"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_battery" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -297,7 +292,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_sound"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_sound"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_sound" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -339,13 +333,12 @@
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="100%"
|
||||
android:text="亮度"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_24"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_brightness"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_brightness"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_brightness" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -430,7 +423,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <SeekBar-->
|
||||
@@ -479,7 +471,5 @@
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_location"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,37 +13,119 @@
|
||||
android:id="@+id/constraintLayout5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_head"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_activation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxEms="8"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="未激活"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head" />
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_head"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxEms="8"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="未激活"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_activation"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi_disconnect"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_ssid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:singleLine="true"
|
||||
android:text="WiFi"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView6"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/battery_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_battery"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="100%"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView6"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_control"
|
||||
@@ -76,6 +158,7 @@
|
||||
android:text="快捷设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -190,7 +273,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_health"
|
||||
android:id="@+id/cl_guard"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
@@ -198,55 +281,41 @@
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
android:background="@drawable/custom_bg_white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="健康码"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="爱心闹钟"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iv_note_nodata"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="绿码同行更畅快"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/noti_background"
|
||||
android:text="暂无提醒"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_health"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_health_code"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.6" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_noti"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_name"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:textColor="@color/black"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/iv_health" />-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -273,7 +342,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="紧急呼叫"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -333,6 +402,7 @@
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/home_icon_clean"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -343,10 +413,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="一键加速"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -446,7 +516,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -454,7 +523,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_guard"
|
||||
android:id="@+id/cl_health"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
@@ -462,41 +531,114 @@
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_white">
|
||||
android:background="@drawable/custom_bg_health"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="健康码"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="绿码同行更畅快"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_note_nodata"
|
||||
android:id="@+id/iv_health"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_reminder_icon"
|
||||
android:visibility="gone"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_health_code"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_noti"
|
||||
android:layout_width="match_parent"
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_name"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:textColor="@color/black"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/iv_health" />-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_app"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="快捷应用"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:text="爱心提醒"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="绿码同行更畅快"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_app"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_app" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_app"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_quick_app"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_name"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:textColor="@color/black"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/iv_health" />-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -514,15 +656,14 @@
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="通讯录"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
@@ -545,108 +686,106 @@
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health"
|
||||
android:background="@drawable/custom_bg_ai"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="应用市场"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_appstore_icon"
|
||||
android:src="@drawable/systemapp_icon"
|
||||
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
|
||||
android:id="@+id/cl_ai"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_ai"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_ai"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:text="AI问诊"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="AI问诊"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_clinical_hand"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_clinical_hand"
|
||||
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>
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_control"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_4"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/custom_bg_health">-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_control"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_4"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/custom_bg_health">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textView6"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_16"-->
|
||||
<!-- android:text="快捷设置"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textView6"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_16"-->
|
||||
<!-- android:text="快捷设置"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_52"-->
|
||||
<!-- android:layout_height="@dimen/dp_52"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/home_clinical_hand"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_52"-->
|
||||
<!-- android:layout_height="@dimen/dp_52"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/home_clinical_hand"-->
|
||||
<!-- 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>-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_exit"-->
|
||||
@@ -688,7 +827,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.uiuios.aios.view.CustomContent>
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.SecondFragment">
|
||||
tools:context="fragment.second.SecondFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -14,10 +14,10 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/custom_bg">
|
||||
|
||||
@@ -25,20 +25,31 @@
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="秒杀抢购"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_spike_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -47,153 +58,53 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl1"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_goods"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView9">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_img"
|
||||
android:layout_width="152dp"
|
||||
android:layout_height="152dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goods_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:maxLines="1"
|
||||
android:text="商品名称"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_img" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goods_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:maxLines="5"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_img"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_goods_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_goods_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView14"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="购买信息"
|
||||
android:textColor="@color/red"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_img" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="秒杀价格"
|
||||
android:textColor="@color/red"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView14"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView16"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="¥"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView15"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_buying_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100.00"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView16"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView16" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/main_pb_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView15"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView15" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="@+id/progressBar"
|
||||
app:layout_constraintStart_toEndOf="@+id/progressBar"
|
||||
app:layout_constraintTop_toTopOf="@+id/progressBar"
|
||||
app:layout_constraintVertical_bias="0.5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_snapup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="立刻抢购"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView9" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/custom_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="养生资讯"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_info_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -202,6 +113,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_article"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView13" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl2"
|
||||
android:layout_width="match_parent"
|
||||
@@ -221,11 +141,11 @@
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:text="sadas"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_aimg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_aimg" />
|
||||
@@ -234,7 +154,7 @@
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_aimg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -245,8 +165,8 @@
|
||||
android:id="@+id/tv_readnow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:text="阅读全文"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -258,17 +178,18 @@
|
||||
android:id="@+id/cl_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/custom_bg">
|
||||
android:background="@drawable/custom_bg"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -276,8 +197,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv3"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -291,21 +212,30 @@
|
||||
android:id="@+id/textView18"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="附近活动"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView18" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -326,7 +256,7 @@
|
||||
android:id="@+id/tv_title_a"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="活动名称"
|
||||
android:textColor="@color/black"
|
||||
@@ -466,25 +396,24 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_like" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_demand"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv4"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
@@ -497,7 +426,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="查看更多"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -507,12 +436,12 @@
|
||||
android:id="@+id/textView19"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="服务需求"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -541,7 +470,7 @@
|
||||
android:id="@+id/tv_title_d"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:maxLines="1"
|
||||
android:text="活动名称"
|
||||
android:textColor="@color/black"
|
||||
@@ -561,7 +490,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_title_d"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_title_d"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title_d"
|
||||
app:layout_goneMarginStart="4dp" />
|
||||
app:layout_goneMarginStart="@dimen/dp_4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time_d"
|
||||
@@ -588,9 +517,7 @@
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_time_d"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time_d" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
140
app/src/main/res/layout-port/item_goods_list.xml
Normal file
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_img"
|
||||
android:layout_width="@dimen/dp_108"
|
||||
android:layout_height="@dimen/dp_108"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
app:corner_radius="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_img"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_img"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_img">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:background="@drawable/class_bg"
|
||||
android:maxLines="1"
|
||||
android:text="品牌"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_type"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:maxLines="3"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_type"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_buying_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:text="秒杀价格"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintBottom_toTopOf="@+id/progressBar"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:text="秒杀价格"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_buying_price"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_buying_price" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_buying"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/buying_bg"
|
||||
android:text="立即抢购"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:progress="90"
|
||||
android:progressDrawable="@drawable/barcolor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView6"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="已抢90%"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_6"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/progressBar"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_buying"
|
||||
app:layout_constraintTop_toTopOf="@+id/progressBar" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||