选择礼物转到指定为止
This commit is contained in:
parent
b6d715d81c
commit
cdf9e75ebd
@ -1036,12 +1036,17 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
}
|
}
|
||||||
giftTitleAdapter.addAllData(name);
|
giftTitleAdapter.addAllData(name);
|
||||||
if (!TextUtils.isEmpty(mWishGiftId) && liveGiftList.size() > 0) {
|
if (!TextUtils.isEmpty(mWishGiftId) && liveGiftList.size() > 0) {
|
||||||
|
Log.i("LiveGiftPopup2", "有礼物设置");
|
||||||
|
int postion =-1;
|
||||||
for (int i = 0; i < liveGiftList.size(); i++) {
|
for (int i = 0; i < liveGiftList.size(); i++) {
|
||||||
JSONObject data = liveGiftList.getJSONObject(i);
|
JSONObject data = liveGiftList.getJSONObject(i);
|
||||||
String giftJson = data.getString("giftlist");
|
String giftJson = data.getString("giftlist");
|
||||||
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
||||||
for (LiveGiftBean model : liveGiftBeans) {
|
for (int j = 0; j < liveGiftBeans.size(); j++) {
|
||||||
|
LiveGiftBean model = liveGiftBeans.get(j);
|
||||||
if (TextUtils.equals(model.getId() + "", mWishGiftId)) {
|
if (TextUtils.equals(model.getId() + "", mWishGiftId)) {
|
||||||
|
model.setChecked(true);
|
||||||
|
postion= j;
|
||||||
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
||||||
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
||||||
giftTitleAdapter.setTitleIndex(i);
|
giftTitleAdapter.setTitleIndex(i);
|
||||||
@ -1049,6 +1054,18 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (postion>-1){
|
||||||
|
final int p = postion;
|
||||||
|
giftRecyclerView.scrollToPosition(postion);
|
||||||
|
// Log.i("LiveGiftPopup2", "进行位置滚动"+p);
|
||||||
|
// giftRecyclerView.postDelayed(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// Log.i("LiveGiftPopup2", "进行位置滚动"+p);
|
||||||
|
// giftRecyclerView.scrollToPosition(p);
|
||||||
|
// }
|
||||||
|
// },200);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
JSONObject obj2 = liveGiftList.getJSONObject(0);
|
JSONObject obj2 = liveGiftList.getJSONObject(0);
|
||||||
String giftJson = obj2.getString("giftlist");
|
String giftJson = obj2.getString("giftlist");
|
||||||
|
Loading…
Reference in New Issue
Block a user