Commit 8fbaeeaa by 罗翻

将mvp替换成mvvm

parent 8f21c002
...@@ -26,4 +26,5 @@ public interface BaseView { ...@@ -26,4 +26,5 @@ public interface BaseView {
void startActivityForReult(Class<?> clz, int requestCode); void startActivityForReult(Class<?> clz, int requestCode);
void startActivityAndFinish(Class<?> clz, Bundle bundle); void startActivityAndFinish(Class<?> clz, Bundle bundle);
} }
package com.dayu.bigfish.bean.sqlbean; package com.dayu.bigfish.bean.sqlbean;
import android.databinding.BaseObservable;
import android.databinding.Bindable;
import com.dayu.bigfish.BR;
import org.greenrobot.greendao.annotation.Convert; import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Generated;
...@@ -13,7 +18,7 @@ import java.util.List; ...@@ -13,7 +18,7 @@ import java.util.List;
*/ */
@Entity @Entity
public class OrderInfo { public class OrderInfo extends BaseObservable {
@Id @Id
private long id; private long id;
@Property(nameInDb = "engineerId") @Property(nameInDb = "engineerId")
...@@ -70,53 +75,73 @@ public class OrderInfo { ...@@ -70,53 +75,73 @@ public class OrderInfo {
this.engineerId = engineerId; this.engineerId = engineerId;
} }
@Bindable
public String getServerRecord() { public String getServerRecord() {
return this.serverRecord; return this.serverRecord;
} }
public void setServerRecord(String serverRecord) { public void setServerRecord(String serverRecord) {
this.serverRecord = serverRecord; this.serverRecord = serverRecord;
notifyPropertyChanged(BR.serverRecord);
} }
@Bindable
public String getDoorPrice() { public String getDoorPrice() {
return this.doorPrice; return this.doorPrice;
} }
public void setDoorPrice(String doorPrice) { public void setDoorPrice(String doorPrice) {
this.doorPrice = doorPrice; this.doorPrice = doorPrice;
notifyPropertyChanged(BR.doorPrice);
} }
@Bindable
public String getServerPrice() { public String getServerPrice() {
return this.serverPrice; return this.serverPrice;
} }
public void setServerPrice(String serverPrice) { public void setServerPrice(String serverPrice) {
this.serverPrice = serverPrice; this.serverPrice = serverPrice;
notifyPropertyChanged(BR.serverPrice);
} }
@Bindable
public String getMaterialCost() { public String getMaterialCost() {
return this.materialCost; return this.materialCost;
} }
public void setMaterialCost(String materialCost) { public void setMaterialCost(String materialCost) {
this.materialCost = materialCost; this.materialCost = materialCost;
notifyPropertyChanged(BR.materialCost);
} }
@Bindable
public String getOtherPrice() { public String getOtherPrice() {
return this.otherPrice; return this.otherPrice;
} }
public void setOtherPrice(String otherPrice) { public void setOtherPrice(String otherPrice) {
this.otherPrice = otherPrice; this.otherPrice = otherPrice;
notifyPropertyChanged(BR.otherPrice);
} }
@Bindable
public String getOtherInfo() { public String getOtherInfo() {
return this.otherInfo; return this.otherInfo;
} }
public void setOtherInfo(String otherInfo) { public void setOtherInfo(String otherInfo) {
this.otherInfo = otherInfo; this.otherInfo = otherInfo;
notifyPropertyChanged(BR.otherInfo);
} }
@Bindable
public List<String> getImgPath() { public List<String> getImgPath() {
return this.imgPath; return this.imgPath;
} }
public void setImgPath(List<String> imgPath) { public void setImgPath(List<String> imgPath) {
this.imgPath = imgPath; this.imgPath = imgPath;
notifyPropertyChanged(BR.imgPath);
} }
} }
...@@ -64,7 +64,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi ...@@ -64,7 +64,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
holder.itemUpdataTime.setVisibility(View.VISIBLE); holder.itemUpdataTime.setVisibility(View.VISIBLE);
holder.orderLineOne.setVisibility(View.VISIBLE); holder.orderLineOne.setVisibility(View.VISIBLE);
holder.orderLineTwo.setVisibility(View.VISIBLE); holder.orderLineTwo.setVisibility(View.VISIBLE);
holder.tvErrorState.setVisibility(View.VISIBLE);
holder.tvItemProcess.setVisibility(View.VISIBLE); holder.tvItemProcess.setVisibility(View.VISIBLE);
final int id = item.getId(); final int id = item.getId();
if (item.getAnyContacts() == 0) { if (item.getAnyContacts() == 0) {
...@@ -203,8 +202,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi ...@@ -203,8 +202,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
} else if (errorState == 4) { } else if (errorState == 4) {
holder.tvErrorState.setText(mContext.getString(R.string.delivery_time_out)); holder.tvErrorState.setText(mContext.getString(R.string.delivery_time_out));
holder.tvErrorState.setVisibility(View.VISIBLE); holder.tvErrorState.setVisibility(View.VISIBLE);
} else {
holder.tvErrorState.setVisibility(View.GONE);
} }
holder.tvItemProcess.setOnClickListener( holder.tvItemProcess.setOnClickListener(
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
android:layout_marginTop="@dimen/dp_16.7" android:layout_marginTop="@dimen/dp_16.7"
android:textColor="@color/cl_tab_read" android:textColor="@color/cl_tab_read"
android:textSize="@dimen/size_login_hint_text" android:textSize="@dimen/size_login_hint_text"
android:visibility="visible" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment