Fixes lists to use similar sized items.
This commit is contained in:
@@ -50,7 +50,7 @@ public class LibraryFragment extends MCFragment {
|
||||
Context context = requireContext();
|
||||
MonsterRepository repository = this.getMonsterRepository();
|
||||
|
||||
MonsterListRecyclerViewAdapter adapter = new MonsterListRecyclerViewAdapter(
|
||||
LibraryRecyclerViewAdapter adapter = new LibraryRecyclerViewAdapter(
|
||||
context,
|
||||
repository.getMonsters(),
|
||||
(monster) -> navigateToMonsterDetail(monster.id),
|
||||
|
||||
@@ -20,7 +20,7 @@ import io.reactivex.rxjava3.core.Flowable;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
public class MonsterListRecyclerViewAdapter extends RecyclerView.Adapter<MonsterListRecyclerViewAdapter.ViewHolder> {
|
||||
public class LibraryRecyclerViewAdapter extends RecyclerView.Adapter<LibraryRecyclerViewAdapter.ViewHolder> {
|
||||
private final Context mContext;
|
||||
private final ItemCallback mOnDelete;
|
||||
private final ItemCallback mOnClick;
|
||||
@@ -37,10 +37,10 @@ public class MonsterListRecyclerViewAdapter extends RecyclerView.Adapter<Monster
|
||||
private List<Monster> mValues;
|
||||
private Disposable mDisposable;
|
||||
|
||||
public MonsterListRecyclerViewAdapter(Context context,
|
||||
Flowable<List<Monster>> itemsObservable,
|
||||
ItemCallback onClick,
|
||||
ItemCallback onDelete) {
|
||||
public LibraryRecyclerViewAdapter(Context context,
|
||||
Flowable<List<Monster>> itemsObservable,
|
||||
ItemCallback onClick,
|
||||
ItemCallback onDelete) {
|
||||
mItemsObservable = itemsObservable;
|
||||
mValues = new ArrayList<>();
|
||||
mContext = context;
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/content"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
android:orientation="horizontal">
|
||||
<!-- // TODO: combine all of these similar list layouts into a single one -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user