我想访问查看小部件,例如演示者TextView
或EditText
来自演示者,我该怎么做,
在我的活动主要中,我想更改scheduleDateTimeNotify
演示者的文本
public class ActivityChannelContent extends MvpActivity<ActivityChannelContentView, ActivityChannelContentPresenter>
implements ActivityChannelContentView{
@BindView(R.id.scheduleDateTimeNotify)
TextView scheduleDateTimeNotify;
@NonNull
@Override
public ActivityChannelContentPresenter createPresenter() {
return new ActivityChannelContentPresenterImpl(getApplicationContext());
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_channel_content);
ButterKnife.bind(this);
}
}
主持人:
public interface ActivityChannelContentPresenter extends MvpPresenter<ActivityChannelContentView> {
}
ActivityChannelContentPresenterImpl:
public class ActivityChannelContentPresenterImpl extends MvpBasePresenter<ActivityChannelContentView> implements ActivityChannelContentPresenter {
private final ActivityChannelContentModel model;
public ActivityChannelContentPresenterImpl(Context context) {
model = new ActivityChannelContentModel(context);
}
}
ActivityChannelContentViewModel:
public class ActivityChannelContentViewModel {
private final Context context;
public ActivityChannelContentViewModel(Context mContext) {
context = mContext;
}
}
ActivityChannelContentView 接口:
public interface ActivityChannelContentView extends MvpView {
}