ui修改
This commit is contained in:
@@ -16,9 +16,11 @@ import java.util.List;
|
||||
|
||||
public class LiveBuyGuardSelectAdapter extends RecyclerView.Adapter {
|
||||
List<GuardPriceModel> price = new ArrayList<>();
|
||||
GuardPriceModel model;
|
||||
|
||||
public LiveBuyGuardSelectAdapter(List<GuardPriceModel> price) {
|
||||
public LiveBuyGuardSelectAdapter(List<GuardPriceModel> price, GuardPriceModel mModel) {
|
||||
this.price = price;
|
||||
model = mModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -31,7 +33,7 @@ public class LiveBuyGuardSelectAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveBuyGuardSelectViewHolder buyGuardSelectViewHolder = (LiveBuyGuardSelectViewHolder) holder;
|
||||
buyGuardSelectViewHolder.setData(price.get(position), liveBuyGuardSelectClickListener);
|
||||
buyGuardSelectViewHolder.setData(price.get(position), liveBuyGuardSelectClickListener,model);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,10 +24,12 @@ public class LiveBuyGuardSelectPopup extends AttachPopupView {
|
||||
List<GuardPriceModel> price = new ArrayList<>();
|
||||
LiveBuyGuardSelectAdapter liveBuyGuardSelectAdapter;
|
||||
RecyclerView live_buy_guard_list;
|
||||
GuardPriceModel model;
|
||||
|
||||
public LiveBuyGuardSelectPopup(@NonNull Context context, List<GuardPriceModel> mPrice) {
|
||||
public LiveBuyGuardSelectPopup(@NonNull Context context, List<GuardPriceModel> mPrice, GuardPriceModel mModel) {
|
||||
super(context);
|
||||
price = mPrice;
|
||||
model = mModel;
|
||||
}
|
||||
|
||||
protected int getImplLayoutId() {
|
||||
@@ -37,7 +39,7 @@ public class LiveBuyGuardSelectPopup extends AttachPopupView {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
live_buy_guard_list = findViewById(R.id.live_buy_guard_list);
|
||||
liveBuyGuardSelectAdapter = new LiveBuyGuardSelectAdapter(price);
|
||||
liveBuyGuardSelectAdapter = new LiveBuyGuardSelectAdapter(price,model);
|
||||
live_buy_guard_list.setAdapter(liveBuyGuardSelectAdapter);
|
||||
live_buy_guard_list.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
liveBuyGuardSelectAdapter.setLiveBuyGuardSelectClickListener(new LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener() {
|
||||
@@ -101,6 +103,11 @@ public class LiveBuyGuardSelectPopup extends AttachPopupView {
|
||||
// }
|
||||
// });
|
||||
|
||||
if (model == null) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public LiveBuyGuardSelectPopup setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -11,27 +12,33 @@ import com.yunbao.common.bean.GuardPriceModel;
|
||||
|
||||
public class LiveBuyGuardSelectViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView opening_time, discount;
|
||||
View layout;
|
||||
|
||||
public LiveBuyGuardSelectViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
opening_time = itemView.findViewById(R.id.opening_time);
|
||||
discount = itemView.findViewById(R.id.discount);
|
||||
layout = itemView.findViewById(R.id.layout);
|
||||
}
|
||||
|
||||
public void setData(GuardPriceModel guardPriceModel,LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener) {
|
||||
public void setData(GuardPriceModel guardPriceModel, LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener, GuardPriceModel mModel) {
|
||||
if (mModel != null && TextUtils.equals(String.valueOf(guardPriceModel.getPriceKey()), String.valueOf(mModel.getPriceKey()))) {
|
||||
layout.setSelected(true);
|
||||
}
|
||||
opening_time.setText(String.valueOf(guardPriceModel.getOpeningTime()));
|
||||
discount.setText(String.valueOf(guardPriceModel.getDiscount()));
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (liveBuyGuardSelectClickListener!=null){
|
||||
if (liveBuyGuardSelectClickListener != null) {
|
||||
liveBuyGuardSelectClickListener.onClickListener(guardPriceModel);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
public interface LiveBuyGuardSelectClickListener{
|
||||
|
||||
public interface LiveBuyGuardSelectClickListener {
|
||||
void onClickListener(GuardPriceModel guardPriceModel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/background_live_buy_guard_slelect_item1" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/background_live_buy_guard_slelect_item2" android:state_selected="true" />
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#00000000" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#2D3271" />
|
||||
</shape>
|
||||
@@ -2,15 +2,19 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="130dp"
|
||||
android:background="@drawable/bg_live_buy_guard_select"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/live_buy_guard_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
tools:itemCount="4"
|
||||
android:layout_marginBottom="5dp"
|
||||
tools:listitem="@layout/view_live_buy_guard_slelect_item" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/background_live_buy_guard_slelect_item"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
@@ -1455,9 +1455,9 @@ Limited ride And limited avatar frame</string>
|
||||
|
||||
<string name="guard_buy_type_1">【Star Guardian】</string>
|
||||
<string name="guardian_privilege">Guardianship privileges</string>
|
||||
<string name="be_their_exclusive_guardian">Becoming the exclusive guardian of the anchor\n</string>
|
||||
<string name="be_their_exclusive_guardian">Be the anchor‘s guardian</string>
|
||||
<string name="not_yet_open">Not opened</string>
|
||||
<string name="tas_guardian_group">The anchor\'s guardian group</string>
|
||||
<string name="tas_guardian_group">guardian group</string>
|
||||
<string name="open_the_kings_guard">Activate King Guardian</string>
|
||||
<string name="open_the_start_guard">Activate Star Guardian</string>
|
||||
<string name="open_the_god_guard">Activate God Guardian</string>
|
||||
|
||||
@@ -1454,9 +1454,9 @@
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
<string name="guardian_privilege">守護團特權</string>
|
||||
<string name="be_their_exclusive_guardian">成爲TA的專屬守護 為TA保駕護航</string>
|
||||
<string name="be_their_exclusive_guardian">成為TA的專屬守護</string>
|
||||
<string name="not_yet_open">暫未開通</string>
|
||||
<string name="tas_guardian_group">TA的守護團 ></string>
|
||||
<string name="tas_guardian_group">守護團 ></string>
|
||||
<string name="open_the_kings_guard">開通王之守護</string>
|
||||
<string name="open_the_start_guard">開通星之守護</string>
|
||||
<string name="open_the_god_guard">開通神之守護</string>
|
||||
|
||||
@@ -1453,9 +1453,9 @@
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
<string name="guardian_privilege">守護團特權</string>
|
||||
<string name="be_their_exclusive_guardian">成爲TA的專屬守護 為TA保駕護航</string>
|
||||
<string name="be_their_exclusive_guardian">成為TA的專屬守護</string>
|
||||
<string name="not_yet_open">暫未開通</string>
|
||||
<string name="tas_guardian_group">TA的守護團 ></string>
|
||||
<string name="tas_guardian_group">守護團 ></string>
|
||||
<string name="open_the_kings_guard">開通王之守護</string>
|
||||
<string name="open_the_start_guard">開通星之守護</string>
|
||||
<string name="open_the_god_guard">開通神之守護</string>
|
||||
|
||||
@@ -1450,9 +1450,9 @@
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
<string name="guardian_privilege">守護團特權</string>
|
||||
<string name="be_their_exclusive_guardian">成爲TA的專屬守護 為TA保駕護航</string>
|
||||
<string name="be_their_exclusive_guardian">成為TA的專屬守護</string>
|
||||
<string name="not_yet_open">暫未開通</string>
|
||||
<string name="tas_guardian_group">TA的守護團 ></string>
|
||||
<string name="tas_guardian_group">守護團 ></string>
|
||||
<string name="open_the_kings_guard">開通王之守護</string>
|
||||
<string name="open_the_start_guard">開通星之守護</string>
|
||||
<string name="open_the_god_guard">開通神之守護</string>
|
||||
|
||||
@@ -1458,9 +1458,9 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="guard_buy_type_1">【Star Guardian】</string>
|
||||
|
||||
<string name="guardian_privilege">Guardianship privileges</string>
|
||||
<string name="be_their_exclusive_guardian">Becoming the exclusive guardian of the anchor\n</string>
|
||||
<string name="be_their_exclusive_guardian">Be the anchor‘s guardian</string>
|
||||
<string name="not_yet_open">Not opened</string>
|
||||
<string name="tas_guardian_group">The anchor\'s guardian group</string>
|
||||
<string name="tas_guardian_group">guardian group</string>
|
||||
<string name="open_the_kings_guard">Activate King Guardian</string>
|
||||
<string name="open_the_start_guard">Activate Star Guardian</string>
|
||||
<string name="open_the_god_guard">Activate God Guardian</string>
|
||||
|
||||
Reference in New Issue
Block a user