Commit 8fbaeeaa by 罗翻

将mvp替换成mvvm

parent 8f21c002
......@@ -26,4 +26,5 @@ public interface BaseView {
void startActivityForReult(Class<?> clz, int requestCode);
void startActivityAndFinish(Class<?> clz, Bundle bundle);
}
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.Entity;
import org.greenrobot.greendao.annotation.Generated;
......@@ -13,7 +18,7 @@ import java.util.List;
*/
@Entity
public class OrderInfo {
public class OrderInfo extends BaseObservable {
@Id
private long id;
@Property(nameInDb = "engineerId")
......@@ -70,53 +75,73 @@ public class OrderInfo {
this.engineerId = engineerId;
}
@Bindable
public String getServerRecord() {
return this.serverRecord;
}
public void setServerRecord(String serverRecord) {
this.serverRecord = serverRecord;
notifyPropertyChanged(BR.serverRecord);
}
@Bindable
public String getDoorPrice() {
return this.doorPrice;
}
public void setDoorPrice(String doorPrice) {
this.doorPrice = doorPrice;
notifyPropertyChanged(BR.doorPrice);
}
@Bindable
public String getServerPrice() {
return this.serverPrice;
}
public void setServerPrice(String serverPrice) {
this.serverPrice = serverPrice;
notifyPropertyChanged(BR.serverPrice);
}
@Bindable
public String getMaterialCost() {
return this.materialCost;
}
public void setMaterialCost(String materialCost) {
this.materialCost = materialCost;
notifyPropertyChanged(BR.materialCost);
}
@Bindable
public String getOtherPrice() {
return this.otherPrice;
}
public void setOtherPrice(String otherPrice) {
this.otherPrice = otherPrice;
notifyPropertyChanged(BR.otherPrice);
}
@Bindable
public String getOtherInfo() {
return this.otherInfo;
}
public void setOtherInfo(String otherInfo) {
this.otherInfo = otherInfo;
notifyPropertyChanged(BR.otherInfo);
}
@Bindable
public List<String> getImgPath() {
return this.imgPath;
}
public void setImgPath(List<String> imgPath) {
this.imgPath = imgPath;
notifyPropertyChanged(BR.imgPath);
}
}
......@@ -64,7 +64,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
holder.itemUpdataTime.setVisibility(View.VISIBLE);
holder.orderLineOne.setVisibility(View.VISIBLE);
holder.orderLineTwo.setVisibility(View.VISIBLE);
holder.tvErrorState.setVisibility(View.VISIBLE);
holder.tvItemProcess.setVisibility(View.VISIBLE);
final int id = item.getId();
if (item.getAnyContacts() == 0) {
......@@ -203,8 +202,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
} else if (errorState == 4) {
holder.tvErrorState.setText(mContext.getString(R.string.delivery_time_out));
holder.tvErrorState.setVisibility(View.VISIBLE);
} else {
holder.tvErrorState.setVisibility(View.GONE);
}
holder.tvItemProcess.setOnClickListener(
......
......@@ -136,7 +136,7 @@
android:layout_marginTop="@dimen/dp_16.7"
android:textColor="@color/cl_tab_read"
android:textSize="@dimen/size_login_hint_text"
android:visibility="visible" />
android:visibility="gone" />
</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