version:1.0.0
update:更换网页,修改主页 bugfixes:修复推送和地图
This commit is contained in:
@@ -71,7 +71,7 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
|
||||
|
||||
private FragmentActivity mContext;
|
||||
private HomeAppAdapter mHomeAppAdapter;
|
||||
// private HomeAppAdapter mHomeAppAdapter;
|
||||
// private NotificationAdapter notificationAdapter;
|
||||
|
||||
private CameraManager cameraManager;
|
||||
@@ -173,7 +173,7 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
} else {
|
||||
// mViewDataBinding.ivNodata.setVisibility(View.GONE);
|
||||
// mViewDataBinding.rvApp.setVisibility(View.VISIBLE);
|
||||
mHomeAppAdapter.setDesktopIcons(desktopIcons);
|
||||
// mHomeAppAdapter.setDesktopIcons(desktopIcons);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -191,7 +191,7 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
Date date = sdf.parse(alarmClockData.getTime());
|
||||
SimpleDateFormat hours = new SimpleDateFormat("HH:mm");
|
||||
String time = hours.format(date);
|
||||
mViewDataBinding.tvClock.setText(time);
|
||||
// mViewDataBinding.tvClock.setText(time);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -199,14 +199,14 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
case AlarmUtils.LOOP:
|
||||
case AlarmUtils.WORKING_DAY:
|
||||
case AlarmUtils.OFF_DAY:
|
||||
mViewDataBinding.tvClock.setText(alarmClockData.getTime());
|
||||
// mViewDataBinding.tvClock.setText(alarmClockData.getTime());
|
||||
break;
|
||||
default:
|
||||
}
|
||||
// mViewDataBinding.rvNoti.setVisibility(View.VISIBLE);
|
||||
// mViewDataBinding.ivNoteNodata.setVisibility(View.GONE);
|
||||
} else {
|
||||
mViewDataBinding.tvClock.setText("未设置");
|
||||
// mViewDataBinding.tvClock.setText("未设置");
|
||||
// mViewDataBinding.rvNoti.setVisibility(View.GONE);
|
||||
// mViewDataBinding.ivNoteNodata.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@@ -304,19 +304,19 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
setTime();
|
||||
refreshMemory();
|
||||
|
||||
mViewDataBinding.rvApp.setLayoutManager(new GridLayoutManager(mContext, 3));
|
||||
HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
|
||||
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
wm.getDefaultDisplay().getRealMetrics(dm);
|
||||
float density = dm.density; // 屏幕密度(0.75 / 1.0 / 1.5)
|
||||
stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.TOP_DECORATION, (int) (density * 4));//top间距
|
||||
stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.BOTTOM_DECORATION, (int) (density * 40));//底部间距
|
||||
stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.LEFT_DECORATION, (int) (density * 4));//左间距
|
||||
stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.RIGHT_DECORATION, (int) (density * 4));//右间距
|
||||
mViewDataBinding.rvApp.addItemDecoration(new RecyclerViewSpacesItemDecoration(stringIntegerHashMap));
|
||||
mHomeAppAdapter = new HomeAppAdapter();
|
||||
mViewDataBinding.rvApp.setAdapter(mHomeAppAdapter);
|
||||
// mViewDataBinding.rvApp.setLayoutManager(new GridLayoutManager(mContext, 3));
|
||||
// HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
|
||||
// WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||
// DisplayMetrics dm = new DisplayMetrics();
|
||||
// wm.getDefaultDisplay().getRealMetrics(dm);
|
||||
// float density = dm.density; // 屏幕密度(0.75 / 1.0 / 1.5)
|
||||
// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.TOP_DECORATION, (int) (density * 4));//top间距
|
||||
// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.BOTTOM_DECORATION, (int) (density * 40));//底部间距
|
||||
// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.LEFT_DECORATION, (int) (density * 4));//左间距
|
||||
// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.RIGHT_DECORATION, (int) (density * 4));//右间距
|
||||
// mViewDataBinding.rvApp.addItemDecoration(new RecyclerViewSpacesItemDecoration(stringIntegerHashMap));
|
||||
// mHomeAppAdapter = new HomeAppAdapter();
|
||||
// mViewDataBinding.rvApp.setAdapter(mHomeAppAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -443,16 +443,16 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
}
|
||||
|
||||
private void refreshMemory() {
|
||||
long avail = AppUtil.getAvailMemory(mContext);
|
||||
long total = AppUtil.getTotalMemory(mContext);
|
||||
int x = (int) (((total - avail) / (double) total) * 100);
|
||||
if (x > 80) {
|
||||
mViewDataBinding.cpv.setProgressColor(mShaderColorsRed);
|
||||
} else {
|
||||
mViewDataBinding.cpv.setProgressColor(mShaderColors);
|
||||
}
|
||||
mViewDataBinding.cpv.showAnimation(0, x, 1000);
|
||||
float x2 = (((total - avail) / (float) total));
|
||||
// long avail = AppUtil.getAvailMemory(mContext);
|
||||
// long total = AppUtil.getTotalMemory(mContext);
|
||||
// int x = (int) (((total - avail) / (double) total) * 100);
|
||||
// if (x > 80) {
|
||||
// mViewDataBinding.cpv.setProgressColor(mShaderColorsRed);
|
||||
// } else {
|
||||
// mViewDataBinding.cpv.setProgressColor(mShaderColors);
|
||||
// }
|
||||
// mViewDataBinding.cpv.showAnimation(0, x, 1000);
|
||||
// float x2 = (((total - avail) / (float) total));
|
||||
}
|
||||
|
||||
private void setTime() {
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.qweather.sdk.bean.weather.WeatherNowBean;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.contact.AddContactActivity;
|
||||
import com.xxpatx.os.activity.contact.AddWechatContactActivity;
|
||||
import com.xxpatx.os.activity.weather.WeatherActivity;
|
||||
import com.xxpatx.os.base.mvvm.fragment.BaseMvvmFragment;
|
||||
import com.xxpatx.os.bean.MapBean;
|
||||
@@ -261,7 +261,7 @@ public class SettingsFragment extends BaseMvvmFragment<SettingsViewModel, Fragme
|
||||
}
|
||||
|
||||
public void addContact(View view) {
|
||||
startActivity(new Intent(mContext, AddContactActivity.class));
|
||||
startActivity(new Intent(mContext, AddWechatContactActivity.class));
|
||||
}
|
||||
|
||||
public void openWifi(View view) {
|
||||
|
||||
Reference in New Issue
Block a user