调整天梯排位赛UI位置
新增排位赛轮播点击事件
This commit is contained in:
parent
a4ab6df974
commit
a664ff7464
@ -19,6 +19,8 @@ public class PkRankBean extends BaseModel {
|
||||
public String blueVal;
|
||||
@SerializedName("pktt_img")
|
||||
public String pkTopImgUrl;
|
||||
@SerializedName("link")
|
||||
public String clickUrl;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@ -74,6 +76,14 @@ public class PkRankBean extends BaseModel {
|
||||
this.pkTopImgUrl = pkTopImgUrl;
|
||||
}
|
||||
|
||||
public String getClickUrl() {
|
||||
return clickUrl;
|
||||
}
|
||||
|
||||
public void setClickUrl(String clickUrl) {
|
||||
this.clickUrl = clickUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PkRankBean{" +
|
||||
@ -83,6 +93,7 @@ public class PkRankBean extends BaseModel {
|
||||
", redVal='" + redVal + '\'' +
|
||||
", blueVal='" + blueVal + '\'' +
|
||||
", pkTopImgUrl='" + pkTopImgUrl + '\'' +
|
||||
", clickUrl='" + clickUrl + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
@ -268,6 +270,15 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||
try {
|
||||
super.show(manager, tag);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
@ -1533,27 +1533,44 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
initPkRank();
|
||||
}
|
||||
|
||||
private void initPkRankView() {
|
||||
private void initPkRankView(PkRankBean bean) {
|
||||
if (pkRankVf.getTag() != null) {
|
||||
return;
|
||||
}
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(20), DpUtil.dp2px(22));
|
||||
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.leftMargin = DpUtil.dp2px(2);
|
||||
textParams.setMarginStart(DpUtil.dp2px(1));
|
||||
params.leftMargin = DpUtil.dp2px(3);
|
||||
textParams.setMarginStart(DpUtil.dp2px(3));
|
||||
|
||||
View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
|
||||
ImageView titleIcon = new ImageView(mContext);
|
||||
mPkRankIcon = hourView.findViewById(R.id.wish_pic);
|
||||
mPkRankText = hourView.findViewById(R.id.wish_index);
|
||||
mPkRankText.setLayoutParams(textParams);
|
||||
mPkRankText.setGravity(Gravity.CENTER);
|
||||
mPkRankText.setGravity(Gravity.START);
|
||||
titleIcon.setImageResource(R.mipmap.icon_pk_rank);
|
||||
titleIcon.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
mPkRankIcon.setLayoutParams(params);
|
||||
pkRankVf.addView(titleIcon);
|
||||
pkRankVf.addView(hourView);
|
||||
pkRankVf.startFlipping();
|
||||
pkRankVf.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
String path = bean.getClickUrl();
|
||||
if (!path.startsWith("/")) {
|
||||
path = "/" + path;
|
||||
}
|
||||
String url = CommonAppConfig.HOST + path;
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||
bundle.putString("url", url);
|
||||
bundle.putInt("height", DpUtil.dp2px(500));
|
||||
bundle.putInt("show_type", 0);
|
||||
bundle.putString("roomId", mLiveUid);
|
||||
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
|
||||
liveHDDialogFragment.setArguments(bundle);
|
||||
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||
});
|
||||
pkRankVf.setTag("start");
|
||||
}
|
||||
|
||||
@ -1570,7 +1587,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
PkRankBean bean = listResponseModel.getData().getInfo();
|
||||
if (bean != null) {
|
||||
Log.i("PK", bean.toString() + " | " + isLadders);
|
||||
initPkRankView();
|
||||
initPkRankView(bean);
|
||||
|
||||
mPkRankText.setText(bean.getName());
|
||||
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);
|
||||
|
@ -520,7 +520,8 @@
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignTop="@id/hour_rank_layout"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/bg_live_item_pk_rank"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
Loading…
Reference in New Issue
Block a user