version:1.0.2
update: bugfixes:取消天气背景显示
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
||||
applicationId "com.xxpatx.os"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 2
|
||||
versionName "1.0.1"
|
||||
versionCode 3
|
||||
versionName "1.0.2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -118,19 +118,19 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
||||
public void onChanged(@Nullable WeatherNowBean.NowBaseBean nowBaseBean) {
|
||||
mViewDataBinding.tvTemp.setText(nowBaseBean.getTemp() + "℃");
|
||||
if (DayUtils.isNight()) {
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_night));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_night));
|
||||
} else {
|
||||
switch (nowBaseBean.getIcon()) {
|
||||
default:
|
||||
case "100":
|
||||
case "150":
|
||||
//晴
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather));
|
||||
break;
|
||||
case "102":
|
||||
case "152":
|
||||
//少云
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_rain));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_rain));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -189,10 +189,10 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
||||
@Override
|
||||
public void onChanged(List<Contact> contacts) {
|
||||
if (contacts == null || contacts.size() == 0) {
|
||||
mViewDataBinding.tvNoContact.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.clNodata.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.rvContact.setVisibility(View.GONE);
|
||||
} else {
|
||||
mViewDataBinding.tvNoContact.setVisibility(View.GONE);
|
||||
mViewDataBinding.clNodata.setVisibility(View.GONE);
|
||||
mViewDataBinding.rvContact.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mContactAdapter.setContactList(contacts);
|
||||
|
||||
@@ -818,13 +818,13 @@ public class CustomFragment extends BaseMvvmFragment<CustomViewModel, FragmentCu
|
||||
case "102":
|
||||
case "152":
|
||||
if (DayUtils.isNight()) {
|
||||
mViewDataBinding.clWeather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun));
|
||||
// mViewDataBinding.clWeather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun));
|
||||
} else {
|
||||
mViewDataBinding.clWeather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun_night));
|
||||
// mViewDataBinding.clWeather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun_night));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mViewDataBinding.clWeather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_rain));
|
||||
// mViewDataBinding.clWeather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_rain));
|
||||
}
|
||||
} else {
|
||||
//在此查看返回数据失败的原因
|
||||
|
||||
@@ -230,19 +230,19 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
public void onChanged(@Nullable WeatherNowBean.NowBaseBean nowBaseBean) {
|
||||
mViewDataBinding.tvTemp.setText(nowBaseBean.getTemp() + "℃");
|
||||
if (DayUtils.isNight()) {
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_night));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_night));
|
||||
} else {
|
||||
switch (nowBaseBean.getIcon()) {
|
||||
default:
|
||||
case "100":
|
||||
case "150":
|
||||
//晴
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather));
|
||||
break;
|
||||
case "102":
|
||||
case "152":
|
||||
//少云
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_rain));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_rain));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,19 +110,19 @@ public class SettingsFragment extends BaseMvvmFragment<SettingsViewModel, Fragme
|
||||
public void onChanged(@Nullable WeatherNowBean.NowBaseBean nowBaseBean) {
|
||||
mViewDataBinding.tvTemp.setText(nowBaseBean.getTemp() + "℃");
|
||||
if (DayUtils.isNight()) {
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_night));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_night));
|
||||
} else {
|
||||
switch (nowBaseBean.getIcon()) {
|
||||
default:
|
||||
case "100":
|
||||
case "150":
|
||||
//晴
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather));
|
||||
break;
|
||||
case "102":
|
||||
case "152":
|
||||
//少云
|
||||
mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_rain));
|
||||
// mViewDataBinding.clWeather.setBackground(mContext.getDrawable(R.drawable.custom_bg_weather_rain));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
android:id="@+id/cl_weather"
|
||||
android:layout_width="157dp"
|
||||
android:layout_height="96dp"
|
||||
android:background="@drawable/custom_bg_weather"
|
||||
android:onClick="@{click::toWeather}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
android:id="@+id/cl_weather"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="165dp"
|
||||
android:background="@drawable/card_weather_background"
|
||||
android:onClick="@{click::toWeather}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
android:id="@+id/cl_weather"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="165dp"
|
||||
android:background="@drawable/card_weather_background"
|
||||
android:onClick="@{click::toWeather}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -147,39 +146,53 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_weather" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_nodata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_weather" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_no_contact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:gravity="center"
|
||||
android:text="暂无联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_add"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:background="@drawable/fragment_add_contact_background"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click::toAdd}"
|
||||
android:text="添加联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_no_contact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:gravity="center"
|
||||
android:text="暂无联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_add"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:background="@drawable/fragment_add_contact_background"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click::toAdd}"
|
||||
android:text="添加联系人"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -32,7 +32,6 @@
|
||||
android:id="@+id/cl_weather"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="165dp"
|
||||
android:background="@drawable/card_weather_background"
|
||||
android:onClick="@{click::toWeather}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
Reference in New Issue
Block a user