fix:修复相亲房bug及多语言适配
This commit is contained in:
@@ -99,7 +99,7 @@ public class MicroView extends LinearLayout implements View.OnLayoutChangeListen
|
||||
|
||||
public void bindAdapter(@NonNull BaseMicroViewAdapter adapter) {
|
||||
if (adapter instanceof DatingMicroViewAdapter) {
|
||||
if (datingItemDecoration == null) datingItemDecoration = new DatingItemDecoration();
|
||||
if (datingItemDecoration == null) datingItemDecoration = new DatingItemDecoration(UiUtils.INSTANCE.isRtl(getContext()));
|
||||
recyclerView.addItemDecoration(datingItemDecoration);
|
||||
} else if (datingItemDecoration != null) {
|
||||
recyclerView.removeItemDecoration(datingItemDecoration);
|
||||
|
@@ -15,6 +15,12 @@ public class DatingItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private final int spacingWidth = ScreenUtil.dip2px(48f);
|
||||
private final int vSpacing = ScreenUtil.dip2px(5f);
|
||||
|
||||
private boolean isRTL = false;
|
||||
|
||||
public DatingItemDecoration(boolean isRTL){
|
||||
this.isRTL = isRTL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NotNull Rect outRect, @NotNull View view, @NotNull RecyclerView parent, @NotNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
@@ -34,6 +40,10 @@ public class DatingItemDecoration extends RecyclerView.ItemDecoration {
|
||||
if (position == 5 || position == 6 || position == 7 || position == 8) {
|
||||
outRect.top = vSpacing;
|
||||
}
|
||||
|
||||
if (isRTL) {
|
||||
int temp = outRect.right;
|
||||
outRect.right = outRect.left;
|
||||
outRect.left = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -151,9 +151,9 @@
|
||||
android:id="@+id/iv_queuing_micro"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/bottom_view"
|
||||
android:layout_above="@id/gameplay_widget"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click}"
|
||||
|
@@ -316,20 +316,26 @@
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_item_micro_dating_boss_04" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_desc"
|
||||
<FrameLayout
|
||||
android:id="@+id/fr_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="1px"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLength="15"
|
||||
android:maxLines="1"
|
||||
android:text="@string/room_manager_edit_desc"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_11"
|
||||
tools:text="@string/layout_item_micro_dating_boss_05" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="1px"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLength="15"
|
||||
android:maxLines="1"
|
||||
android:text="@string/room_manager_edit_desc"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_11"
|
||||
tools:text="@string/layout_item_micro_dating_boss_05" />
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_can_edit"
|
||||
|
Reference in New Issue
Block a user