Fix HistoryScene crash
https://github.com/h6ah4i/android-advancedrecyclerview/issues/315
This commit is contained in:
1 parent
1ac43e6293
commit
06adf8594c
2 files changed
+31
-2
No files matched your search
@@ -290,6 +290,7 @@ public class HistoryScene extends ToolbarScene
|
||||
|
||||
private class HistoryHolder extends AbstractSwipeableItemViewHolder {
|
||||
|
||||
public final View card;
|
||||
public final LoadImageView thumb;
|
||||
public final TextView title;
|
||||
public final TextView uploader;
|
||||
@@ -301,6 +302,7 @@ public class HistoryScene extends ToolbarScene
|
||||
public HistoryHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
card = itemView.findViewById(R.id.card);
|
||||
thumb = (LoadImageView) itemView.findViewById(R.id.thumb);
|
||||
title = (TextView) itemView.findViewById(R.id.title);
|
||||
uploader = (TextView) itemView.findViewById(R.id.uploader);
|
||||
@@ -312,7 +314,7 @@ public class HistoryScene extends ToolbarScene
|
||||
|
||||
@Override
|
||||
public View getSwipeableContainerView() {
|
||||
return itemView;
|
||||
return card;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +345,7 @@ public class HistoryScene extends ToolbarScene
|
||||
|
||||
@Override
|
||||
public HistoryHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
HistoryHolder holder = new HistoryHolder(mInflater.inflate(R.layout.item_gallery_list, parent, false));
|
||||
HistoryHolder holder = new HistoryHolder(mInflater.inflate(R.layout.item_history, parent, false));
|
||||
|
||||
ViewGroup.LayoutParams lp = holder.thumb.getLayoutParams();
|
||||
lp.width = mListThumbWidth;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2018 Hippo Seven
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include
|
||||
layout="@layout/item_gallery_list"
|
||||
android:id="@+id/card"/>
|
||||
|
||||
</FrameLayout>
|
||||
Reference in new issue
Block a user