弹窗
private void onGiveGift(View view) {
if (mGiftDialog == null) {
mGiftDialog = new GiftDialog()
.setOnGiftPickerCallBack(this::setOnGiveGift)
.setOnDismissListener(dialog -> {
});
}
mGiftDialog.show(this);
}
调用弹窗的界面
if (mData == null) {
mTvRestart.performClick();
} else {
mGiftAdatper.setData(mData);
mTvRestart.setVisibility(View.GONE);
mProgressBar.setVisibility(View.GONE);
}
mTvRestart.setOnClickListener(this::onRequestClick);
private void onRequestClick(View view) {
view.setVisibility(View.GONE);
mProgressBar.setVisibility(View.VISIBLE);
OkHttp.create().getGiftList().enqueue((call, httpRes) -> {
mProgressBar.setVisibility(View.GONE);
if (httpRes.isSuccessful()) {
mData = httpRes.dataFromList(Gift.class);
mGiftAdatper.setData(mData);
} else {
mTvRestart.setVisibility(View.VISIBLE);
}
});
}
|