version:2.7
fix: update:修改推送,增加视频和日常应用
@@ -16,8 +16,8 @@ android {
|
||||
applicationId "com.uiuios.aios"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 17
|
||||
versionName "2.6"
|
||||
versionCode 18
|
||||
versionName "2.7"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -198,7 +198,10 @@ dependencies {
|
||||
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8'
|
||||
//MMKV
|
||||
implementation 'com.tencent:mmkv-static:1.2.14'
|
||||
implementation 'com.tencent.tpns:tpns:1.3.7.0-release'
|
||||
//腾讯移动推送 TPNS
|
||||
implementation 'com.tencent.tpns:tpns:1.3.8.0-release'
|
||||
//阿里云推送
|
||||
implementation 'com.aliyun.ams:alicloud-android-push:3.8.0'
|
||||
//状态栏透明
|
||||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||||
//指示器
|
||||
|
||||
@@ -105,7 +105,12 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activity.contact.ContactActivity" />
|
||||
<activity
|
||||
android:name=".activity.DailyAppActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.contact.ContactActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.code.FamilySpaceActivity"
|
||||
android:launchMode="singleTask"
|
||||
@@ -174,16 +179,35 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- <!– 声明service组件 –>-->
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.baidu.location.f"-->
|
||||
<!-- android:enabled="true"-->
|
||||
<!-- android:process=":remote" /> -->
|
||||
<!-- <!– 应用的其它配置 –>-->
|
||||
<!-- <uses-library-->
|
||||
<!-- android:name="org.apache.http.legacy"-->
|
||||
<!-- android:required="false" />-->
|
||||
<receiver
|
||||
android:name="com.uiuios.aios.push.alipush.AliyunMessageReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name="com.uiuios.aios.push.alipush.AliMessageIntentService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS 默认通知 -->
|
||||
<activity
|
||||
android:name="com.tencent.android.tpush.TpnsActivity"
|
||||
android:exported="true"
|
||||
@@ -240,6 +264,17 @@
|
||||
android:process=":xg_vip_service">
|
||||
<intent-filter android:priority="0x7fffffff">
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS SDK的内部广播 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.SDK" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
|
||||
|
||||
<!-- 【可选】 系统广播:网络切换 -->
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
|
||||
<!-- 【可选】 系统广播:开屏 -->
|
||||
<action android:name="android.intent.action.USER_PRESENT" />
|
||||
|
||||
<!-- 【必须】 信鸽SDK的内部广播 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.SDK" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
|
||||
@@ -279,7 +314,7 @@
|
||||
<!-- 【可选】APP实现的Receiver,用于接收消息透传和操作结果的回调,请根据需要添加 -->
|
||||
|
||||
<!-- YOUR_PACKAGE_PATH.CustomPushReceiver需要改为自己的Receiver: -->
|
||||
<receiver android:name=".tpush.MessageReceiver">
|
||||
<receiver android:name=".push.tpush.MessageReceiver">
|
||||
<intent-filter>
|
||||
|
||||
<!-- 接收消息透传 -->
|
||||
@@ -313,6 +348,15 @@
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="QQnVGVe6EcQeHo7epbnxk2EGhGkkj7hM" />
|
||||
|
||||
<!-- 请填写你自己的- appKey -->
|
||||
<meta-data
|
||||
android:name="com.alibaba.app.appkey"
|
||||
android:value="333816214" />
|
||||
<!-- 请填写你自己的appSecret -->
|
||||
<meta-data
|
||||
android:name="com.alibaba.app.appsecret"
|
||||
android:value="e6c856572532482f9b2532c9c4894f36" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.uiuios.aios;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5488458740561098181L;
|
||||
|
||||
}
|
||||
@@ -726,7 +726,7 @@ public class ControlActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void getLocation() {
|
||||
String addr = MMKV.defaultMMKV().decodeString(CommonConfig.MAP_ADDRESS_KEY);
|
||||
String addr = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).decodeString(CommonConfig.MAP_ADDRESS_KEY);
|
||||
|
||||
if (TextUtils.isEmpty(addr)) {
|
||||
tv_location.setText("未知");
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.adapter.DailyAppAdapter;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
import com.uiuios.aios.bean.DailyAppBean;
|
||||
import com.uiuios.aios.manager.AppStatusManager;
|
||||
import com.uiuios.aios.view.GridSpaceItemDecoration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class DailyAppActivity extends BaseActivity {
|
||||
private static final String TAG = DailyAppActivity.class.getSimpleName();
|
||||
|
||||
private DailyAppAdapter mDailyAppAdapter;
|
||||
|
||||
@BindView(R.id.recyclerView)
|
||||
RecyclerView recyclerView;
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
@BindView(R.id.tv_appsize)
|
||||
TextView tv_appsize;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_dailyapp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
mDailyAppAdapter = new DailyAppAdapter();
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(this, 5));
|
||||
recyclerView.addItemDecoration(new GridSpaceItemDecoration(5, 50, 50));
|
||||
} else {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
recyclerView.addItemDecoration(new GridSpaceItemDecoration(3, 50, 50));
|
||||
}
|
||||
recyclerView.setAdapter(mDailyAppAdapter);
|
||||
iv_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
List<DailyAppBean> appBeanList = AppStatusManager.getInstance().getPackageList();
|
||||
mDailyAppAdapter.setDailyAppBeans(appBeanList);
|
||||
tv_appsize.setText(String.format(getString(R.string.app_size), appBeanList.size()));
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class EmergencyActivity extends AppCompatActivity {
|
||||
tv_countdown.setText("倒计时(" + (time - aLong - 1) + ")秒");
|
||||
Log.e(TAG, "accept: " + (time - aLong - 1));
|
||||
} else {
|
||||
MMKV mmkv = MMKV.defaultMMKV();
|
||||
MMKV mmkv = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
String longitude = mCacheHelper.getAsString(CommonConfig.MAP_LONGITUDE_KEY);
|
||||
String latitude = mCacheHelper.getAsString(CommonConfig.MAP_LATITUDE_KEY);
|
||||
String address = mCacheHelper.getAsString(CommonConfig.MAP_ADDRESS_KEY);
|
||||
|
||||
@@ -15,7 +15,8 @@ import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.adapter.AlarmAdapter;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
import com.uiuios.aios.bean.AlarmClockData;
|
||||
import com.uiuios.aios.tpush.MessageReceiver;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.push.tpush.MessageReceiver;
|
||||
import com.uiuios.aios.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -95,7 +96,7 @@ public class AlarmClockActivity extends BaseActivity implements AlarmClockContac
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(MessageReceiver.SET_ALARMCLOCK);
|
||||
filter.addAction(PushManager.SET_ALARMCLOCK);
|
||||
registerReceiver(mAlarmClockReceiver, filter);
|
||||
}
|
||||
|
||||
@@ -107,7 +108,7 @@ public class AlarmClockActivity extends BaseActivity implements AlarmClockContac
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e(TAG, "onReceive: " + action);
|
||||
if (MessageReceiver.SET_ALARMCLOCK.equals(action)) {
|
||||
if (PushManager.SET_ALARMCLOCK.equals(action)) {
|
||||
mPresenter.getAlarmClock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ 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.config.CommonConfig;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.network.URLAddress;
|
||||
import com.uiuios.aios.utils.GsonUtils;
|
||||
@@ -26,7 +27,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 MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
|
||||
@@ -75,8 +75,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
private int appListIndex = 1;
|
||||
private int defaultCurrent = 0;
|
||||
|
||||
private HomeWatcher mHomeWatcher;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_main;
|
||||
@@ -147,28 +145,13 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
if (mFragments.size() > 1) {
|
||||
mViewPager.setCurrentItem(defaultCurrent);
|
||||
}
|
||||
mHomeWatcher = new HomeWatcher(this);
|
||||
mHomeWatcher.setOnHomePressedListener(new HomeWatcher.OnHomePressedListener() {
|
||||
@Override
|
||||
public void onHomePressed() {
|
||||
//按了HOME键
|
||||
Log.e(TAG, "onHomePressed: ");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHomeLongPressed() {
|
||||
Log.e(TAG, "onHomeLongPressed: ");
|
||||
//长按HOME键
|
||||
}
|
||||
});
|
||||
mHomeWatcher.startWatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
registmNewAppReceiver();
|
||||
registerSOSNumberReceiver();
|
||||
registerUpdateDesktopReceiver();
|
||||
mAlarmServiceConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
@@ -392,8 +375,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
if (mNewAppReceiver != null) {
|
||||
unregisterReceiver(mNewAppReceiver);
|
||||
}
|
||||
if (mHomeWatcher != null) {
|
||||
mHomeWatcher.stopWatch();// 在销毁时停止监听,不然会报错的。
|
||||
if (updateDesktopReceiver != null) {
|
||||
unregisterReceiver(updateDesktopReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,6 +429,30 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
}
|
||||
}
|
||||
|
||||
public static final String ACTION_PACKAGE_HIDE = "com.uiui.aios.ACTION_PACKAGE_HIDE";
|
||||
|
||||
private UpdateDesktopReceiver updateDesktopReceiver;
|
||||
|
||||
private void registerUpdateDesktopReceiver() {
|
||||
if (updateDesktopReceiver == null) {
|
||||
updateDesktopReceiver = new UpdateDesktopReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction("UPDATE_DESKTOP_ICON");
|
||||
filter.addAction(ACTION_PACKAGE_HIDE);
|
||||
registerReceiver(updateDesktopReceiver, filter);
|
||||
}
|
||||
|
||||
class UpdateDesktopReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.e(TAG, "onReceive: " + intent.getAction());
|
||||
addData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemSettings() {
|
||||
// mMainPresenter.getDesktopLayout();
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
||||
import com.qweather.sdk.view.QWeather;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
@@ -27,7 +28,7 @@ public class WeatherPresenter implements WeatherContact.Presenter {
|
||||
private static final String WEATHER_DAILY_KEY = "WEATHER_DAILY_JSON_STRING";
|
||||
private WeatherContact.WeatherView mView;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.QuickAppActivity;
|
||||
import com.uiuios.aios.bean.AppSelectBean;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,7 +27,7 @@ public class AppSelectedAdapter extends RecyclerView.Adapter<AppSelectedAdapter.
|
||||
private List<AppSelectBean> mAppSelectBeans;
|
||||
private int unselectedStatus = -1;
|
||||
private int selecedPosition = unselectedStatus;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
public void setAppSelectBeans(List<AppSelectBean> appSelectBeanList) {
|
||||
this.mAppSelectBeans = appSelectBeanList;
|
||||
|
||||
146
app/src/main/java/com/uiuios/aios/adapter/DailyAppAdapter.java
Normal file
@@ -0,0 +1,146 @@
|
||||
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.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.DailyAppBean;
|
||||
import com.uiuios.aios.dialog.DailyAppDialog;
|
||||
import com.uiuios.aios.manager.AppStatusManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder> {
|
||||
private static final String TAG = DailyAppAdapter.class.getSimpleName();
|
||||
|
||||
private Context mContext;
|
||||
private List<DailyAppBean> mDailyAppBeans;
|
||||
|
||||
public void setDailyAppBeans(List<DailyAppBean> appSelectBeanList) {
|
||||
this.mDailyAppBeans = 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_daily_app, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
DailyAppBean dailyAppBean = mDailyAppBeans.get(position);
|
||||
holder.iv_icon.setImageDrawable(dailyAppBean.getIcon());
|
||||
holder.tv_name.setText(dailyAppBean.getAppName());
|
||||
holder.root.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
showDialog(dailyAppBean);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ApkUtils.openPackage(mContext, dailyAppBean.getPackageName(), dailyAppBean.getClassName());
|
||||
AppUsedTimeUtils.getInstance().setAppPackageName(dailyAppBean.getPackageName());
|
||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||
SendRunningApp(mContext);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SendRunningApp(Context context) {
|
||||
String packageName = AppUsedTimeUtils.getInstance().getAppPackageName();
|
||||
long time = AppUsedTimeUtils.getInstance().getStartTime();
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("app_package", packageName);
|
||||
jsonObject.addProperty("version_name", ApkUtils.getAPPVersionName(context, packageName));
|
||||
jsonObject.addProperty("start_time", time / 1000);
|
||||
String jsonString = jsonObject.toString();
|
||||
Log.e(TAG, "SendRunningApp: " + jsonString);
|
||||
NetInterfaceManager.getInstance()
|
||||
.getRunningAppObservable(jsonString)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("SendRunningApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
Log.e("SendRunningApp", "onSubscribe: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("SendRunningApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("SendRunningApp", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void showDialog(DailyAppBean dailyAppBean) {
|
||||
DailyAppDialog dailyAppDialog = new DailyAppDialog(mContext);
|
||||
dailyAppDialog.setTitle("放到桌面");
|
||||
dailyAppDialog.setMessage(dailyAppBean.getAppName());
|
||||
dailyAppDialog.setIconImage(dailyAppBean.getIcon());
|
||||
dailyAppDialog.setOnClickBottomListener(new DailyAppDialog.OnClickBottomListener() {
|
||||
@Override
|
||||
public void onPositiveClick() {
|
||||
AppStatusManager.getInstance().removeHidedApp(dailyAppBean.getPackageName());
|
||||
mDailyAppBeans.remove(dailyAppBean);
|
||||
notifyDataSetChanged();
|
||||
dailyAppDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNegtiveClick() {
|
||||
dailyAppDialog.dismiss();
|
||||
}
|
||||
});
|
||||
dailyAppDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDailyAppBeans == null ? 0 : mDailyAppBeans.size();
|
||||
}
|
||||
|
||||
static class Holder extends RecyclerView.ViewHolder {
|
||||
ConstraintLayout root;
|
||||
ImageView iv_icon;
|
||||
TextView tv_name;
|
||||
|
||||
Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
iv_icon = itemView.findViewById(R.id.iv_icon);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,14 +70,14 @@ public class WeatherDayApdapter extends RecyclerView.Adapter<WeatherDayApdapter.
|
||||
switch (iconDay) {
|
||||
case "100":
|
||||
case "150":
|
||||
holder.iv_bg.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun));
|
||||
holder.iv_bg.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun1));
|
||||
break;
|
||||
case "102":
|
||||
case "152":
|
||||
holder.iv_bg.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sunny));
|
||||
holder.iv_bg.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sunny1));
|
||||
break;
|
||||
default:
|
||||
holder.iv_bg.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.background_weather_rain));
|
||||
holder.iv_bg.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.background_weather_rain1));
|
||||
}
|
||||
holder.iv_weather.setImageDrawable(getWeatherDrawable(iconDay));
|
||||
}
|
||||
|
||||
@@ -6,8 +6,12 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.sdk.android.push.CloudPushService;
|
||||
import com.alibaba.sdk.android.push.CommonCallback;
|
||||
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.qweather.sdk.view.HeConfig;
|
||||
import com.tencent.android.tpush.XGIOperateCallback;
|
||||
@@ -16,9 +20,11 @@ import com.tencent.android.tpush.XGPushManager;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.alarm.AlarmUtils;
|
||||
import com.uiuios.aios.manager.AppStatusManager;
|
||||
import com.uiuios.aios.manager.ConnectManager;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.service.main.MainService;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
import com.uiuios.aios.utils.JGYUtils;
|
||||
@@ -30,36 +36,22 @@ import java.util.List;
|
||||
public class BaseApplication extends Application {
|
||||
private static final String TAG = BaseApplication.class.getSimpleName();
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static Context context;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static BaseApplication instance;
|
||||
|
||||
public static Context getAppContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
// 单例模式中获取唯一的ExitApplication实例
|
||||
public static BaseApplication getInstance() {
|
||||
if (null == instance) {
|
||||
instance = new BaseApplication();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
context = this;
|
||||
if (!BuildConfig.DEBUG) {
|
||||
catchException();
|
||||
}
|
||||
String rootDir = MMKV.initialize(this);
|
||||
Log.e(TAG, "mmkv root: " + rootDir);
|
||||
|
||||
tpushInit();
|
||||
aliyunPushInit();
|
||||
PushManager.init(this);
|
||||
|
||||
Aria.init(this);
|
||||
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
||||
tpushInit();
|
||||
AppUsedTimeUtils.init(this);
|
||||
AlarmUtils.init(this);
|
||||
HeConfig.init("HE2210211540591362", "fe42a7bb59b14eefb27eea4fb2c40e99");
|
||||
@@ -67,6 +59,7 @@ public class BaseApplication extends Application {
|
||||
HeConfig.switchToDevService();
|
||||
RemoteManager.init(this);
|
||||
ConnectManager.init(this);
|
||||
AppStatusManager.init(this);
|
||||
NetInterfaceManager.init(this);
|
||||
JGYUtils.init(this);
|
||||
startService(new Intent(this, MainService.class));
|
||||
@@ -101,6 +94,51 @@ public class BaseApplication extends Application {
|
||||
});
|
||||
}
|
||||
|
||||
private void aliyunPushInit() {
|
||||
PushServiceFactory.init(this);
|
||||
final CloudPushService pushService = PushServiceFactory.getCloudPushService();
|
||||
pushService.setLogLevel(CloudPushService.LOG_DEBUG);
|
||||
pushService.register(this, new CommonCallback() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
Log.e("AliyunPush", "init cloudchannel success");
|
||||
Log.e("AliyunPush", "init cloudchannel success " + pushService.getDeviceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorCode, String errorMessage) {
|
||||
Log.e("AliyunPush", "init cloudchannel failed -- errorcode:" + errorCode + " -- errorMessage:" + errorMessage);
|
||||
}
|
||||
});
|
||||
String sn = Utils.getSerial();
|
||||
if (TextUtils.isEmpty(sn)) {
|
||||
return;
|
||||
}
|
||||
pushService.bindAccount(sn, new CommonCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
Log.e("AliyunPush", "bind account " + sn + " success\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorCode, String errorMsg) {
|
||||
Log.e("AliyunPush", "bind account " + sn + " failed." +
|
||||
"errorCode: " + errorCode + ", errorMsg:" + errorMsg);
|
||||
}
|
||||
});
|
||||
pushService.addAlias(sn, new CommonCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
Log.e("AliyunPush", "add alias " + sn + " success\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorCode, String errorMsg) {
|
||||
Log.e("AliyunPush", "add alias " + sn + " failed." +
|
||||
"errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void catchException() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(
|
||||
|
||||
53
app/src/main/java/com/uiuios/aios/bean/DailyAppBean.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DailyAppBean implements Serializable {
|
||||
private static final long serialVersionUID = 5054284058523960678L;
|
||||
|
||||
String appName;
|
||||
String packageName;
|
||||
String className;
|
||||
Drawable icon;
|
||||
|
||||
public DailyAppBean(String appName, String packageName, String className, Drawable icon) {
|
||||
this.appName = appName;
|
||||
this.packageName = packageName;
|
||||
this.className = className;
|
||||
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 String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Drawable getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(Drawable icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.uiuios.aios.config;
|
||||
|
||||
public class CommonConfig {
|
||||
public static final String MMKV_ID = "InterProcessKV";
|
||||
|
||||
public static final String MAP_LOCATION_JSON_KEY = "MAPLOCATION_JSON_STRING";
|
||||
public static final String MAP_LONGITUDE_KEY = "map_longitude_key";
|
||||
public static final String MAP_LATITUDE_KEY = "map_latitude_key";
|
||||
|
||||
@@ -67,7 +67,7 @@ public class CustomDialog extends AlertDialog {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.custom_dialog);
|
||||
setContentView(R.layout.dialog_custom);
|
||||
//按空白处不能取消动画
|
||||
setCanceledOnTouchOutside(false);
|
||||
//初始化界面控件
|
||||
|
||||
222
app/src/main/java/com/uiuios/aios/dialog/DailyAppDialog.java
Normal file
@@ -0,0 +1,222 @@
|
||||
package com.uiuios.aios.dialog;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.uiuios.aios.R;
|
||||
|
||||
|
||||
/**
|
||||
* description:自定义dialog
|
||||
*/
|
||||
|
||||
public class DailyAppDialog extends AlertDialog {
|
||||
/**
|
||||
* 显示的标题
|
||||
*/
|
||||
private TextView titleTv;
|
||||
|
||||
/**
|
||||
* 显示的消息
|
||||
*/
|
||||
private TextView messageTv;
|
||||
|
||||
/**
|
||||
* 确认和取消按钮
|
||||
*/
|
||||
private TextView positiveBn;
|
||||
private TextView negtiveBn;
|
||||
|
||||
private ImageView ivIcon;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
public DailyAppDialog(Context context) {
|
||||
super(context, R.style.CustomDialog);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* 都是内容数据
|
||||
*/
|
||||
private String message;
|
||||
private String title;
|
||||
private String positive, negtive;
|
||||
private Drawable mDrawable;
|
||||
/**
|
||||
* 底部是否只有一个按钮
|
||||
*/
|
||||
private boolean isSingle = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_daily_app);
|
||||
//按空白处不能取消动画
|
||||
setCanceledOnTouchOutside(false);
|
||||
//初始化界面控件
|
||||
initView();
|
||||
//初始化界面数据
|
||||
refreshView();
|
||||
//初始化界面控件的事件
|
||||
initEvent();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化界面的确定和取消监听器
|
||||
*/
|
||||
private void initEvent() {
|
||||
//设置确定按钮被点击后,向外界提供监听
|
||||
positiveBn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onClickBottomListener != null) {
|
||||
onClickBottomListener.onPositiveClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
//设置取消按钮被点击后,向外界提供监听
|
||||
negtiveBn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onClickBottomListener != null) {
|
||||
onClickBottomListener.onNegtiveClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化界面控件的显示数据
|
||||
*/
|
||||
private void refreshView() {
|
||||
//如果用户自定了title和message
|
||||
if (!TextUtils.isEmpty(title)) {
|
||||
titleTv.setText(title);
|
||||
titleTv.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
titleTv.setVisibility(View.GONE);
|
||||
}
|
||||
if (!TextUtils.isEmpty(message)) {
|
||||
messageTv.setText(message);
|
||||
}
|
||||
//如果设置按钮的文字
|
||||
if (!TextUtils.isEmpty(positive)) {
|
||||
positiveBn.setText(positive);
|
||||
} else {
|
||||
positiveBn.setText("确定");
|
||||
}
|
||||
if (!TextUtils.isEmpty(negtive)) {
|
||||
negtiveBn.setText(negtive);
|
||||
} else {
|
||||
negtiveBn.setText("取消");
|
||||
}
|
||||
ivIcon.setImageDrawable(mDrawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
refreshView();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化界面控件
|
||||
*/
|
||||
private void initView() {
|
||||
negtiveBn = findViewById(R.id.negtive);
|
||||
positiveBn = findViewById(R.id.positive);
|
||||
titleTv = findViewById(R.id.title);
|
||||
messageTv = findViewById(R.id.message);
|
||||
ivIcon = findViewById(R.id.iv_icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置确定取消按钮的回调
|
||||
*/
|
||||
private OnClickBottomListener onClickBottomListener;
|
||||
|
||||
public void setOnClickBottomListener(OnClickBottomListener onClickBottomListener) {
|
||||
this.onClickBottomListener = onClickBottomListener;
|
||||
}
|
||||
|
||||
public interface OnClickBottomListener {
|
||||
/**
|
||||
* 点击确定按钮事件
|
||||
*/
|
||||
void onPositiveClick();
|
||||
|
||||
/**
|
||||
* 点击取消按钮事件
|
||||
*/
|
||||
void onNegtiveClick();
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public DailyAppDialog setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public DailyAppDialog setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPositive() {
|
||||
return positive;
|
||||
}
|
||||
|
||||
public DailyAppDialog setPositive(String positive) {
|
||||
this.positive = positive;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNegtive() {
|
||||
return negtive;
|
||||
}
|
||||
|
||||
public DailyAppDialog setNegtive(String negtive) {
|
||||
this.negtive = negtive;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DailyAppDialog setNegtiveText(String negtive) {
|
||||
negtiveBn.setText(negtive);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSingle() {
|
||||
return isSingle;
|
||||
}
|
||||
|
||||
public DailyAppDialog setSingle(boolean single) {
|
||||
isSingle = single;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DailyAppDialog setIconImage(Drawable drawable) {
|
||||
this.mDrawable = drawable;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class PasswordDialog extends AlertDialog {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.password_dialog);
|
||||
setContentView(R.layout.dialog_password);
|
||||
//按空白处不能取消动画
|
||||
setCanceledOnTouchOutside(false);
|
||||
//初始化界面控件
|
||||
|
||||
@@ -67,7 +67,7 @@ public class SingleDialog extends AlertDialog {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.single_dialog);
|
||||
setContentView(R.layout.dialog_single);
|
||||
//按空白处不能取消动画
|
||||
setCanceledOnTouchOutside(false);
|
||||
//初始化界面控件
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.util.Log;
|
||||
import com.jakewharton.disklrucache.DiskLruCache;
|
||||
import com.tencent.mmkv.BuildConfig;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
@@ -31,7 +32,7 @@ import java.io.Serializable;
|
||||
public class CacheHelper {
|
||||
private static final String TAG = CacheHelper.class.getSimpleName();
|
||||
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private static final String DIR_NAME = "diskCache";
|
||||
private static final int MAX_COUNT = 5 * 1024 * 1024;
|
||||
|
||||
@@ -22,11 +22,13 @@ import com.google.gson.JsonObject;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.DailyAppActivity;
|
||||
import com.uiuios.aios.activity.code.FamilySpaceActivity;
|
||||
import com.uiuios.aios.base.BaseFragment;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.DesktopIcon;
|
||||
import com.uiuios.aios.dialog.CustomDialog;
|
||||
import com.uiuios.aios.manager.AppStatusManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.service.NotificationService;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
@@ -138,19 +140,29 @@ public class AppListFragment extends BaseFragment {
|
||||
String pkg = desktopIcon.getPackageName();
|
||||
Log.e(TAG, "getView: " + pkg);
|
||||
int i = IconUtils.appClassNameList.indexOf(pkg);
|
||||
int size = NotificationService.getNotificationLength(pkg);
|
||||
if (size == 0) {
|
||||
bg.setVisibility(View.GONE);
|
||||
} else if (size < 99) {
|
||||
bg.setVisibility(View.VISIBLE);
|
||||
bg.setText(String.valueOf(size));
|
||||
} else {
|
||||
bg.setVisibility(View.VISIBLE);
|
||||
bg.setText("99+");
|
||||
}
|
||||
|
||||
if ("aios.daily.app".equals(pkg)) {
|
||||
int appSize = AppStatusManager.getInstance().getPackageList().size();
|
||||
if (appSize == 0) {
|
||||
bg.setVisibility(View.GONE);
|
||||
} else {
|
||||
bg.setVisibility(View.VISIBLE);
|
||||
bg.setText(String.valueOf(appSize));
|
||||
}
|
||||
}
|
||||
if (i != -1) {
|
||||
String val = IconUtils.appIconList.get(i);
|
||||
int resID = getActivity().getResources().getIdentifier(val, "drawable", "com.uiuios.aios");
|
||||
int size = NotificationService.getNotificationLength(pkg);
|
||||
if (size == 0) {
|
||||
bg.setVisibility(View.GONE);
|
||||
} else if (size < 99) {
|
||||
bg.setVisibility(View.VISIBLE);
|
||||
bg.setText(String.valueOf(size));
|
||||
} else {
|
||||
bg.setVisibility(View.VISIBLE);
|
||||
bg.setText("99+");
|
||||
}
|
||||
if (resID == 0) {
|
||||
Log.e(TAG, "getView: not found src : " + pkg);
|
||||
iv.setImageDrawable(desktopIcon.getIcon());
|
||||
@@ -183,9 +195,13 @@ public class AppListFragment extends BaseFragment {
|
||||
if (desktopIcon != null) {
|
||||
Log.e(TAG, "onItemClick: " + desktopIcon.getPackageName());
|
||||
switch (desktopIcon.getPackageName()) {
|
||||
case "aios.daily.app":
|
||||
startActivity(new Intent(mContext, DailyAppActivity.class));
|
||||
break;
|
||||
case "aios.exit":
|
||||
case "aios.family":
|
||||
startActivity(new Intent(mContext, FamilySpaceActivity.class));
|
||||
// startActivity(new Intent(mContext, FamilySpaceActivity.class));
|
||||
ApkUtils.openApp(mContext, "com.uiui.videoplayer");
|
||||
break;
|
||||
case "com.android.dialer":
|
||||
int qch_call_forbid = Settings.System.getInt(mContext.getContentResolver(), "aole_call_forbid", 0);
|
||||
|
||||
@@ -65,13 +65,15 @@ import com.uiuios.aios.bean.AlarmItem;
|
||||
import com.uiuios.aios.bean.Contact;
|
||||
import com.uiuios.aios.bean.HealthCode;
|
||||
import com.uiuios.aios.bean.SnInfo;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.dialog.PasswordDialog;
|
||||
import com.uiuios.aios.dialog.SingleDialog;
|
||||
import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.network.URLAddress;
|
||||
import com.uiuios.aios.tpush.MessageReceiver;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.push.tpush.MessageReceiver;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUtil;
|
||||
import com.uiuios.aios.utils.BitmapUtils;
|
||||
@@ -225,7 +227,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
mMMKV = MMKV.defaultMMKV();
|
||||
mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -312,7 +314,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(MessageReceiver.SET_ALARMCLOCK);
|
||||
filter.addAction(PushManager.SET_ALARMCLOCK);
|
||||
mContext.registerReceiver(mAlarmClockReceiver, filter);
|
||||
}
|
||||
|
||||
@@ -323,7 +325,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e(TAG, "onReceive: " + action);
|
||||
if (MessageReceiver.SET_ALARMCLOCK.equals(action)) {
|
||||
if (PushManager.SET_ALARMCLOCK.equals(action)) {
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
108
app/src/main/java/com/uiuios/aios/manager/AppStatusManager.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.uiuios.aios.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.activity.main.MainActivity;
|
||||
import com.uiuios.aios.bean.DailyAppBean;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.utils.IconUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class AppStatusManager {
|
||||
private static final String TAG = AppStatusManager.class.getSimpleName();
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static AppStatusManager sInstance;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private Set<String> hidedAppSet;
|
||||
|
||||
public static final String APP_STATUS_MANAGER_KEY = "AppStatusManagerSet";
|
||||
private static final Set<String> defaultHiedApp = new HashSet<String>() {{
|
||||
this.add("om.android.fmradio");//收音机
|
||||
this.add("com.android.mms");//信息
|
||||
this.add("com.android.gallery3d");
|
||||
this.add("com.android.documentsui");
|
||||
this.add("com.android.calculator2");
|
||||
this.add("com.android.calendar");
|
||||
}};
|
||||
|
||||
private AppStatusManager(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
}
|
||||
this.mContext = context;
|
||||
Set<String> stringSet = mMMKV.decodeStringSet(APP_STATUS_MANAGER_KEY, defaultHiedApp);
|
||||
this.hidedAppSet = stringSet;
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
Log.e(TAG, "init: ");
|
||||
sInstance = new AppStatusManager(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static AppStatusManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init AppStatusManager first");
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public Set<String> getHidedAppSet() {
|
||||
return this.hidedAppSet;
|
||||
}
|
||||
|
||||
public void addHidedApp(String pkg) {
|
||||
this.hidedAppSet.add(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
mContext.sendBroadcast(new Intent(MainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public void removeHidedApp(String pkg) {
|
||||
this.hidedAppSet.remove(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
mContext.sendBroadcast(new Intent(MainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public List<DailyAppBean> getPackageList() {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
List<DailyAppBean> dailyAppBeanList = new ArrayList<>();
|
||||
// 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent
|
||||
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
|
||||
resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
// 通过getPackageManager()的queryIntentActivities方法遍历,得到所有能打开的app的packageName
|
||||
List<ResolveInfo> resolveinfoList = pm.queryIntentActivities(resolveIntent, 0);
|
||||
|
||||
for (ResolveInfo packageInfo : resolveinfoList) {
|
||||
String pkg = packageInfo.activityInfo.packageName;
|
||||
if (hidedAppSet.contains(pkg)) {
|
||||
Log.e(TAG, "getPackageList: " + pkg);
|
||||
DailyAppBean appSelectBean = new DailyAppBean(packageInfo.activityInfo.loadLabel(pm).toString(),
|
||||
packageInfo.activityInfo.packageName,
|
||||
packageInfo.activityInfo.name,
|
||||
packageInfo.activityInfo.loadIcon(pm));
|
||||
int i = IconUtils.appClassNameList.indexOf(pkg);
|
||||
if (i != -1) {
|
||||
String val = IconUtils.appIconList.get(i);
|
||||
int resID = mContext.getResources().getIdentifier(val, "drawable", "com.uiui.aios");
|
||||
if (resID != 0) {
|
||||
appSelectBean.setIcon(mContext.getResources().getDrawable(resID));
|
||||
}
|
||||
}
|
||||
dailyAppBeanList.add(appSelectBean);
|
||||
}
|
||||
}
|
||||
return dailyAppBeanList;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.utils.TimeUtils;
|
||||
|
||||
public class ConnectManager {
|
||||
@@ -30,7 +31,7 @@ public class ConnectManager {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static ConnectManager sInstance;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private ConnectManager(Context context) {
|
||||
if (context == null) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class RemoteManager {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static RemoteManager sInstance;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private CacheHelper mCacheHelper;
|
||||
|
||||
private IGetInfoInterface getInfoInterface;
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.uiuios.aios.bean.SnInfo;
|
||||
import com.uiuios.aios.bean.SystemSettings;
|
||||
import com.uiuios.aios.bean.UserAvatarInfo;
|
||||
import com.uiuios.aios.bean.UserId;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.aios.manager.ConnectManager;
|
||||
import com.uiuios.aios.manager.ConnectMode;
|
||||
@@ -81,7 +82,7 @@ public class NetInterfaceManager {
|
||||
|
||||
private Retrofit mRetrofit;
|
||||
private OkHttpClient okHttpClient;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private final ConcurrentHashMap<String, Long> requestIdsMap = new ConcurrentHashMap<>();
|
||||
//超时时间
|
||||
|
||||
62
app/src/main/java/com/uiuios/aios/push/PushManager.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.uiuios.aios.push;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.aios.utils.ToastUtil;
|
||||
|
||||
public class PushManager {
|
||||
private static final String TAG = PushManager.class.getSimpleName();
|
||||
|
||||
public static final String SET_ALARMCLOCK = "zuoyeos.action.change.alarmclaock";
|
||||
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static PushManager sInstance;
|
||||
private Context mContext;
|
||||
private ContentResolver mResolver;
|
||||
private CacheHelper mCacheHelper;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private PushManager(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
}
|
||||
this.mContext = context;
|
||||
this.mResolver = context.getContentResolver();
|
||||
this.mCacheHelper = new CacheHelper(context);
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new PushManager(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static PushManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init PushManager first");
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private static final String JIGUANG_ALARM_CLOCK = "57";
|
||||
|
||||
public void setPushContent(String title, String extras) {
|
||||
switch (title) {
|
||||
case JIGUANG_ALARM_CLOCK:
|
||||
ToastUtil.betaShow("收到推送消息: 设置闹钟");
|
||||
Intent intent = new Intent(SET_ALARMCLOCK);
|
||||
mContext.sendBroadcast(intent);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.uiuios.aios.push.alipush;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.sdk.android.push.AliyunMessageIntentService;
|
||||
import com.alibaba.sdk.android.push.notification.CPushMessage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by liyazhou on 17/8/22.
|
||||
* 为避免推送广播被系统拦截的小概率事件,我们推荐用户通过IntentService处理消息互调,接入步骤:
|
||||
* 1. 创建IntentService并继承AliyunMessageIntentService
|
||||
* 2. 覆写相关方法,并在Manifest的注册该Service
|
||||
* 3. 调用接口CloudPushService.setPushIntentService
|
||||
* 详细用户可参考:https://help.aliyun.com/document_detail/30066.html#h2-2-messagereceiver-aliyunmessageintentservice
|
||||
*/
|
||||
|
||||
public class AliMessageIntentService extends AliyunMessageIntentService {
|
||||
private static final String TAG = AliyunMessageIntentService.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* 推送通知的回调方法
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
*/
|
||||
@Override
|
||||
protected void onNotification(Context context, String title, String summary, Map<String, String> extraMap) {
|
||||
Log.i(TAG, "收到一条推送通知 : " + title + ", summary:" + summary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送消息的回调方法
|
||||
*
|
||||
* @param context
|
||||
* @param cPushMessage
|
||||
*/
|
||||
@Override
|
||||
protected void onMessage(Context context, CPushMessage cPushMessage) {
|
||||
Log.i(TAG, "收到一条推送消息 : " + cPushMessage.getTitle() + ", content:" + cPushMessage.getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* 从通知栏打开通知的扩展处理
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
*/
|
||||
@Override
|
||||
protected void onNotificationOpened(Context context, String title, String summary, String extraMap) {
|
||||
Log.i(TAG, "onNotificationOpened : " + " : " + title + " : " + summary + " : " + extraMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 无动作通知点击回调。当在后台或阿里云控制台指定的通知动作为无逻辑跳转时,通知点击回调为onNotificationClickedWithNoAction而不是onNotificationOpened
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
*/
|
||||
@Override
|
||||
protected void onNotificationClickedWithNoAction(Context context, String title, String summary, String extraMap) {
|
||||
Log.i(TAG, "onNotificationClickedWithNoAction : " + " : " + title + " : " + summary + " : " + extraMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知删除回调
|
||||
*
|
||||
* @param context
|
||||
* @param messageId
|
||||
*/
|
||||
@Override
|
||||
protected void onNotificationRemoved(Context context, String messageId) {
|
||||
Log.i(TAG, "onNotificationRemoved : " + messageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用处于前台时通知到达回调。注意:该方法仅对自定义样式通知有效,相关详情请参考https://help.aliyun.com/document_detail/30066.html#h3-3-4-basiccustompushnotification-api
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
* @param openType
|
||||
* @param openActivity
|
||||
* @param openUrl
|
||||
*/
|
||||
@Override
|
||||
protected void onNotificationReceivedInApp(Context context, String title, String summary, Map<String, String> extraMap, int openType, String openActivity, String openUrl) {
|
||||
Log.i(TAG, "onNotificationReceivedInApp : " + " : " + title + " : " + summary + " " + extraMap + " : " + openType + " : " + openActivity + " : " + openUrl);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.uiuios.aios.push.alipush;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.sdk.android.push.MessageReceiver;
|
||||
import com.alibaba.sdk.android.push.notification.CPushMessage;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: 正纬
|
||||
* @since: 15/4/9
|
||||
* @version: 1.1
|
||||
* @feature: 用于接收推送的通知和消息
|
||||
*/
|
||||
public class AliyunMessageReceiver extends MessageReceiver {
|
||||
// 消息接收部分的LOG_TAG
|
||||
public static final String TAG = AliyunMessageReceiver.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* 推送通知的回调方法
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
*/
|
||||
@Override
|
||||
public void onNotification(Context context, String title, String summary, Map<String, String> extraMap) {
|
||||
// TODO 处理推送通知
|
||||
if (null != extraMap) {
|
||||
for (Map.Entry<String, String> entry : extraMap.entrySet()) {
|
||||
Log.i(TAG, "@Get diy param : Key=" + entry.getKey() + " , Value=" + entry.getValue());
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "@收到通知 && 自定义消息为空");
|
||||
}
|
||||
Log.i(TAG, "收到一条推送通知 : " + title + ", summary:" + summary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用处于前台时通知到达回调。注意:该方法仅对自定义样式通知有效,相关详情请参考https://help.aliyun.com/document_detail/30066.html?spm=5176.product30047.6.620.wjcC87#h3-3-4-basiccustompushnotification-api
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
* @param openType
|
||||
* @param openActivity
|
||||
* @param openUrl
|
||||
*/
|
||||
@Override
|
||||
protected void onNotificationReceivedInApp(Context context, String title, String summary, Map<String, String> extraMap, int openType, String openActivity, String openUrl) {
|
||||
Log.i(TAG, "onNotificationReceivedInApp : " + " : " + title + " : " + summary + " " + extraMap + " : " + openType + " : " + openActivity + " : " + openUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送消息的回调方法
|
||||
*
|
||||
* @param context
|
||||
* @param cPushMessage
|
||||
*/
|
||||
@Override
|
||||
public void onMessage(Context context, CPushMessage cPushMessage) {
|
||||
Log.e(TAG, "收到一条推送消息 : " + cPushMessage.getTitle() + ", content:" + cPushMessage.getContent());
|
||||
String title = cPushMessage.getTitle();
|
||||
String content = cPushMessage.getContent();
|
||||
JsonObject extrasJson = JsonParser.parseString(content).getAsJsonObject();
|
||||
String extras = "";
|
||||
if (extrasJson.get("extras") != null) {
|
||||
extras = extrasJson.get("extras").toString();
|
||||
}
|
||||
PushManager.getInstance().setPushContent(title, extras);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从通知栏打开通知的扩展处理
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
*/
|
||||
@Override
|
||||
public void onNotificationOpened(Context context, String title, String summary, String extraMap) {
|
||||
Log.i(TAG, "onNotificationOpened : " + " : " + title + " : " + summary + " : " + extraMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知删除回调
|
||||
*
|
||||
* @param context
|
||||
* @param messageId
|
||||
*/
|
||||
@Override
|
||||
public void onNotificationRemoved(Context context, String messageId) {
|
||||
Log.i(TAG, "onNotificationRemoved : " + messageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 无动作通知点击回调。当在后台或阿里云控制台指定的通知动作为无逻辑跳转时,通知点击回调为onNotificationClickedWithNoAction而不是onNotificationOpened
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param summary
|
||||
* @param extraMap
|
||||
*/
|
||||
@Override
|
||||
protected void onNotificationClickedWithNoAction(Context context, String title, String summary, String extraMap) {
|
||||
Log.i(TAG, "onNotificationClickedWithNoAction : " + " : " + title + " : " + summary + " : " + extraMap);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.uiuios.aios.tpush;
|
||||
package com.uiuios.aios.push.tpush;
|
||||
|
||||
/**
|
||||
* Created by chacewang on 2019/7/5.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.uiuios.aios.tpush;
|
||||
package com.uiuios.aios.push.tpush;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
@@ -16,8 +16,9 @@ import com.tencent.android.tpush.XGPushClickedResult;
|
||||
import com.tencent.android.tpush.XGPushRegisterResult;
|
||||
import com.tencent.android.tpush.XGPushShowedResult;
|
||||
import com.tencent.android.tpush.XGPushTextMessage;
|
||||
import com.uiuios.aios.tpush.common.NotificationService;
|
||||
import com.uiuios.aios.tpush.po.XGNotification;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.push.tpush.common.NotificationService;
|
||||
import com.uiuios.aios.push.tpush.po.XGNotification;
|
||||
import com.uiuios.aios.utils.ToastUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -30,8 +31,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
public static final String TEST_ACTION = "com.qq.xgdemo.activity.TEST_ACTION";
|
||||
public static final String LogTag = "xg.test";
|
||||
|
||||
public static final String SET_ALARMCLOCK = "zuoyeos.action.change.alarmclaock";
|
||||
|
||||
private Context mContext;
|
||||
private ContentResolver mResolver;
|
||||
private PackageManager mPackageManager;
|
||||
@@ -288,9 +287,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
// Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
//闹钟
|
||||
private static final String JIGUANG_ALARM_CLOCK = "57";
|
||||
|
||||
private void processCustomMessage(Context context, XGPushTextMessage message) {
|
||||
if (context == null || message == null) {
|
||||
return;
|
||||
@@ -304,14 +300,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
if (extrasJson.get("extras") != null) {
|
||||
extras = extrasJson.get("extras").toString();
|
||||
}
|
||||
|
||||
switch (title) {
|
||||
case JIGUANG_ALARM_CLOCK:
|
||||
ToastUtil.betaShow("收到推送消息: 设置闹钟");
|
||||
Intent intent = new Intent(SET_ALARMCLOCK);
|
||||
mContext.sendBroadcast(intent);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
PushManager.getInstance().setPushContent(title, extras);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.uiuios.aios.tpush.common;
|
||||
package com.uiuios.aios.push.tpush.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.uiuios.aios.tpush.common;
|
||||
package com.uiuios.aios.push.tpush.common;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@@ -6,7 +6,7 @@ import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
|
||||
import com.uiuios.aios.tpush.po.XGNotification;
|
||||
import com.uiuios.aios.push.tpush.po.XGNotification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.uiuios.aios.tpush.po;
|
||||
package com.uiuios.aios.push.tpush.po;
|
||||
|
||||
public class XGNotification {
|
||||
private Integer id;
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiuios.aios.bean.AlarmClockData;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,7 +25,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
private static final int OK = 200;
|
||||
private MainSContact.MainSView mView;
|
||||
private Context mContext;
|
||||
MMKV mMMKV = MMKV.defaultMMKV();
|
||||
MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ public class ApkUtils {
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.uiuios");
|
||||
this.add("com.uiui.os");
|
||||
this.add("com.uiui.aios");
|
||||
this.add("com.uiui.videoplayer");
|
||||
// this.add("com.uiui.health");
|
||||
this.add("com.tencent.android.qqdownloader");
|
||||
// this.add("com.uiuios.appstore");
|
||||
@@ -226,11 +228,17 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
DesktopIcon dailyIcon = new DesktopIcon();
|
||||
dailyIcon.setIcon(context.getDrawable(R.drawable.icon_daily_app));
|
||||
dailyIcon.setLable("日常应用");
|
||||
dailyIcon.setPackageName("aios.daily.app");
|
||||
desktopIcons.add(0, dailyIcon);
|
||||
|
||||
DesktopIcon familyIcon = new DesktopIcon();
|
||||
familyIcon.setIcon(context.getDrawable(R.drawable.icon_family_space));
|
||||
familyIcon.setLable("家庭空间");
|
||||
familyIcon.setPackageName("aios.family");
|
||||
desktopIcons.add(0, familyIcon);
|
||||
desktopIcons.add(1, familyIcon);
|
||||
|
||||
return desktopIcons;
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/background_weather_rain1.png
Normal file
|
After Width: | Height: | Size: 226 KiB |
BIN
app/src/main/res/drawable-hdpi/background_weather_sun1.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable-hdpi/background_weather_sunny1.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
app/src/main/res/drawable-hdpi/exit.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_daily_app.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.3 KiB |
@@ -1,20 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="#bad9f9" />
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
android:bottomRightRadius="16dp"
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
|
||||
<padding
|
||||
android:top="4dp"
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
/>
|
||||
android:top="4dp" />
|
||||
</shape>
|
||||
@@ -1,20 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="#fcebc3" />
|
||||
<solid android:color="#fcebc3" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
android:bottomRightRadius="16dp"
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
|
||||
<padding
|
||||
android:top="4dp"
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
/>
|
||||
android:top="4dp" />
|
||||
</shape>
|
||||
@@ -1,20 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid
|
||||
android:color="#90a1b7" />
|
||||
<solid android:color="#90a1b7" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
android:bottomRightRadius="16dp"
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
|
||||
<padding
|
||||
android:top="4dp"
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
/>
|
||||
android:top="4dp" />
|
||||
</shape>
|
||||
63
app/src/main/res/layout-land/activity_dailyapp.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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="match_parent"
|
||||
tools:context=".activity.DailyAppActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/exit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="日常应用"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appsize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_size"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -7,32 +7,33 @@
|
||||
tools:context=".activity.weather.WeatherActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout3"
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/back_white"
|
||||
android:src="@drawable/exit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView17"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="最近7天趋势预报"
|
||||
android:text="天气预报"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_back"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -43,7 +44,7 @@
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout3" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout2"
|
||||
@@ -54,27 +55,16 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_location"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_cover" />
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/imageView"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||
app:layout_constraintTop_toTopOf="@+id/imageView" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -141,7 +141,6 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_settings_icon"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView11"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<?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="@dimen/dp_100"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:background="@drawable/background_weather_rain"
|
||||
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_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
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"
|
||||
app:layout_constraintVertical_bias="0.5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="姓名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="phone"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -6,8 +6,9 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_width="@dimen/dp_124"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:background="@drawable/bg_dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -19,21 +20,34 @@
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/background_weather_sun" />
|
||||
android:src="@drawable/background_weather_sun1"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_weather"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_date"
|
||||
android:id="@+id/tv_temp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="17:48"
|
||||
android:text="15-22"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_weather"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.168" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_weather"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_weather"
|
||||
@@ -42,33 +56,33 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/he100"
|
||||
android:visibility="visible"
|
||||
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_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_weather" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_temp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="15-22"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="26sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_weather" />
|
||||
<TextView
|
||||
android:id="@+id/tv_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="17:48"
|
||||
android:textColor="@color/weather_text_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.333" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
63
app/src/main/res/layout-port/activity_dailyapp.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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="match_parent"
|
||||
tools:context=".activity.DailyAppActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/exit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="日常应用"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
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_appsize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_size"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -7,31 +7,33 @@
|
||||
tools:context=".activity.weather.WeatherActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout3"
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="@dimen/dp_32"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/back_white"
|
||||
android:src="@drawable/exit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView17"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="最近7天趋势预报"
|
||||
android:text="天气预报"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_back"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -42,7 +44,7 @@
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout3" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout2"
|
||||
@@ -53,27 +55,16 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/icon_location"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_cover" />
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/imageView"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||
app:layout_constraintTop_toTopOf="@+id/imageView" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -744,7 +744,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="AI问诊"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:background="@drawable/badge_bg"
|
||||
android:gravity="center"
|
||||
android:minWidth="30dp"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appname"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="17sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
127
app/src/main/res/layout/dialog_daily_app.xml
Normal file
@@ -0,0 +1,127 @@
|
||||
<?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="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_300"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/bg_dialog"
|
||||
android:minWidth="@dimen/dp_240"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible"
|
||||
tools:text="消息提示" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="@dimen/dp_3"
|
||||
android:maxLines="1"
|
||||
android:textColor="#999999"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_icon"
|
||||
tools:text="app" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_56"
|
||||
android:layout_marginEnd="@dimen/dp_56"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/positive"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/join_background"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="确定" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/negtive"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/joined_background"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="取消" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
@@ -26,37 +26,36 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_launcher" />
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_36"
|
||||
android:layout_marginBottom="@dimen/dp_36"
|
||||
android:background="@drawable/badge_bg"
|
||||
android:gravity="center"
|
||||
android:minWidth="30dp"
|
||||
android:minWidth="@dimen/dp_20"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_appname"
|
||||
android:layout_width="90dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:gravity="center_horizontal"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="17sp"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?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">
|
||||
|
||||
@@ -29,32 +30,38 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="姓名"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_head" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="phone"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_head" />
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="姓名" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
tools:text="phone" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
40
app/src/main/res/layout/item_daily_app.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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="@dimen/dp_80"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
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_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -41,4 +41,6 @@
|
||||
|
||||
<color name="charging_color">#00d56b</color>
|
||||
<color name="no_charging_color">#a0a0a0</color>
|
||||
<color name="weather_text_color">#323a4c</color>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources>
|
||||
<string name="app_name">AIOS系统</string>
|
||||
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank secondFragment</string>
|
||||
<string name="app_size">%d款应用</string>
|
||||
|
||||
</resources>
|
||||
|
||||