修改设备信息
This commit is contained in:
@@ -8,6 +8,7 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.ckkj.water.AppConfig;
|
||||
import com.ckkj.water.R;
|
||||
import com.ckkj.water.base.BaseFragment;
|
||||
import com.ckkj.water.custom.view.CustomRefreshHeader;
|
||||
@@ -43,6 +44,15 @@ public class IndexFragment extends BaseFragment<IndexFragmentLayoutBinding, Inde
|
||||
protected void initArgs(Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResumeInitData() {
|
||||
super.onResumeInitData();
|
||||
if(AppConfig.USER_LOGIN){
|
||||
showLoadingDialog();
|
||||
mPresenter.getDevicesList(mCurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData(@Nullable Bundle savedInstanceState) {
|
||||
// 设置自定义刷新头
|
||||
@@ -57,9 +67,6 @@ public class IndexFragment extends BaseFragment<IndexFragmentLayoutBinding, Inde
|
||||
mCurrentPage++;
|
||||
mPresenter.getDevicesList(mCurrentPage);
|
||||
});
|
||||
showLoadingDialog();
|
||||
mPresenter.getDevicesList(mCurrentPage);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,7 +143,9 @@ public class IndexFragment extends BaseFragment<IndexFragmentLayoutBinding, Inde
|
||||
deviceAdapter = new DeviceAdapter(mContext,R.layout.index_device_list_item,devList);
|
||||
viewBinding.rvDevices.setAdapter(deviceAdapter);
|
||||
deviceAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
goTo(mContext, DeviceControlActivity.class,null);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("device_info",devList.get(position));
|
||||
goTo(mContext, DeviceControlActivity.class,bundle);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user