Replaces duplicated list item layouts with a single shared SimpleListItem.
This commit is contained in:
13
Android/.idea/misc.xml
generated
13
Android/.idea/misc.xml
generated
@@ -1,5 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="DesignSurface">
|
||||||
|
<option name="filePathToZoomLevelMap">
|
||||||
|
<map>
|
||||||
|
<entry key="app/src/main/res/layout/dropdown_list_item.xml" value="0.12777777777777777" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_dashboard_list_item.xml" value="0.2210144927536232" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_edit_strings_list.xml" value="0.2210144927536232" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_edit_strings_list_item.xml" value="0.2210144927536232" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_edit_traits_list.xml" value="0.2210144927536232" />
|
||||||
|
<entry key="app/src/main/res/layout/fragment_edit_traits_list_item.xml" value="0.2210144927536232" />
|
||||||
|
<entry key="app/src/main/res/layout/simple_list_item.xml" value="0.2210144927536232" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
<component name="NullableNotNullManager">
|
<component name="NullableNotNullManager">
|
||||||
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
|
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
|
||||||
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
|
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.majinnaibu.monstercards.databinding.FragmentEditLanguagesListHeaderBinding;
|
import com.majinnaibu.monstercards.databinding.FragmentEditLanguagesListHeaderBinding;
|
||||||
import com.majinnaibu.monstercards.databinding.FragmentEditLanguagesListItemBinding;
|
|
||||||
import com.majinnaibu.monstercards.models.Language;
|
import com.majinnaibu.monstercards.models.Language;
|
||||||
import com.majinnaibu.monstercards.ui.components.Stepper;
|
import com.majinnaibu.monstercards.ui.components.Stepper;
|
||||||
import com.majinnaibu.monstercards.utils.ItemCallback;
|
import com.majinnaibu.monstercards.utils.ItemCallback;
|
||||||
@@ -45,7 +44,7 @@ public class EditLanguagesRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
if (viewType == HEADER_VIEW_TYPE) {
|
if (viewType == HEADER_VIEW_TYPE) {
|
||||||
return new HeaderViewHolder(FragmentEditLanguagesListHeaderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
return new HeaderViewHolder(FragmentEditLanguagesListHeaderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||||
}
|
}
|
||||||
return new ItemViewHolder(FragmentEditLanguagesListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
return new ItemViewHolder(com.majinnaibu.monstercards.databinding.SimpleListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,7 +96,7 @@ public class EditLanguagesRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
public final TextView mContentView;
|
public final TextView mContentView;
|
||||||
public Language mItem;
|
public Language mItem;
|
||||||
|
|
||||||
public ItemViewHolder(@NonNull FragmentEditLanguagesListItemBinding binding) {
|
public ItemViewHolder(@NonNull com.majinnaibu.monstercards.databinding.SimpleListItemBinding binding) {
|
||||||
super(binding.getRoot());
|
super(binding.getRoot());
|
||||||
mContentView = binding.content;
|
mContentView = binding.content;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.majinnaibu.monstercards.databinding.FragmentEditSkillsListItemBinding;
|
|
||||||
import com.majinnaibu.monstercards.models.Skill;
|
import com.majinnaibu.monstercards.models.Skill;
|
||||||
import com.majinnaibu.monstercards.utils.ItemCallback;
|
import com.majinnaibu.monstercards.utils.ItemCallback;
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ public class EditSkillsRecyclerViewAdapter extends RecyclerView.Adapter<EditSkil
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return new ViewHolder(FragmentEditSkillsListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
return new ViewHolder(com.majinnaibu.monstercards.databinding.SimpleListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,7 +50,7 @@ public class EditSkillsRecyclerViewAdapter extends RecyclerView.Adapter<EditSkil
|
|||||||
public final TextView mContentView;
|
public final TextView mContentView;
|
||||||
public Skill mItem;
|
public Skill mItem;
|
||||||
|
|
||||||
public ViewHolder(@NonNull FragmentEditSkillsListItemBinding binding) {
|
public ViewHolder(@NonNull com.majinnaibu.monstercards.databinding.SimpleListItemBinding binding) {
|
||||||
super(binding.getRoot());
|
super(binding.getRoot());
|
||||||
mContentView = binding.content;
|
mContentView = binding.content;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.majinnaibu.monstercards.databinding.FragmentEditStringsListItemBinding;
|
import com.majinnaibu.monstercards.databinding.SimpleListItemBinding;
|
||||||
import com.majinnaibu.monstercards.utils.ItemCallback;
|
import com.majinnaibu.monstercards.utils.ItemCallback;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -24,7 +24,7 @@ public class EditStringsRecyclerViewAdapter extends RecyclerView.Adapter<EditStr
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return new ViewHolder(FragmentEditStringsListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
return new ViewHolder(SimpleListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -47,7 +47,7 @@ public class EditStringsRecyclerViewAdapter extends RecyclerView.Adapter<EditStr
|
|||||||
public final TextView mContentView;
|
public final TextView mContentView;
|
||||||
public String mItem;
|
public String mItem;
|
||||||
|
|
||||||
public ViewHolder(@NonNull FragmentEditStringsListItemBinding binding) {
|
public ViewHolder(@NonNull SimpleListItemBinding binding) {
|
||||||
super(binding.getRoot());
|
super(binding.getRoot());
|
||||||
mContentView = binding.content;
|
mContentView = binding.content;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import androidx.recyclerview.widget.DiffUtil;
|
|||||||
import androidx.recyclerview.widget.ListAdapter;
|
import androidx.recyclerview.widget.ListAdapter;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.majinnaibu.monstercards.databinding.FragmentEditTraitsListItemBinding;
|
import com.majinnaibu.monstercards.databinding.SimpleListItemBinding;
|
||||||
import com.majinnaibu.monstercards.models.Trait;
|
import com.majinnaibu.monstercards.models.Trait;
|
||||||
import com.majinnaibu.monstercards.utils.ItemCallback;
|
import com.majinnaibu.monstercards.utils.ItemCallback;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ public class EditTraitsRecyclerViewAdapter extends ListAdapter<Trait, EditTraits
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return new ViewHolder(FragmentEditTraitsListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
return new ViewHolder(SimpleListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -54,7 +54,7 @@ public class EditTraitsRecyclerViewAdapter extends ListAdapter<Trait, EditTraits
|
|||||||
public final TextView mContentView;
|
public final TextView mContentView;
|
||||||
public Trait mItem;
|
public Trait mItem;
|
||||||
|
|
||||||
public ViewHolder(@NonNull FragmentEditTraitsListItemBinding binding) {
|
public ViewHolder(@NonNull SimpleListItemBinding binding) {
|
||||||
super(binding.getRoot());
|
super(binding.getRoot());
|
||||||
mContentView = binding.content;
|
mContentView = binding.content;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<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" />
|
|
||||||
|
|
||||||
<!-- <include-->
|
|
||||||
<!-- layout="@layout/card_monster"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_columnWeight="1"-->
|
|
||||||
<!-- android:layout_marginVertical="8dp"/>-->
|
|
||||||
|
|
||||||
<!-- <include-->
|
|
||||||
<!-- layout="@layout/card_monster_short"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_columnWeight="1"-->
|
|
||||||
<!-- android:layout_marginVertical="8dp"/>-->
|
|
||||||
|
|
||||||
<!-- <include-->
|
|
||||||
<!-- layout="@layout/tile_monster"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_columnWeight="1"-->
|
|
||||||
<!-- android:layout_marginVertical="8dp"/>-->
|
|
||||||
|
|
||||||
<!-- <include-->
|
|
||||||
<!-- layout="@layout/tile_monster_short"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_columnWeight="1"-->
|
|
||||||
<!-- android:layout_marginVertical="8dp" />-->
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:listitem="@layout/fragment_edit_languages_list_item" />
|
tools:listitem="@layout/simple_list_item" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/add_language"
|
android:id="@+id/add_language"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:listitem="@layout/fragment_edit_skills_list_item" />
|
tools:listitem="@layout/simple_list_item" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/add_skill"
|
android:id="@+id/add_skill"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<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>
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:listitem="@layout/fragment_edit_traits_list_item" />
|
tools:listitem="@layout/simple_list_item" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/add_item"
|
android:id="@+id/add_item"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:listitem="@layout/fragment_edit_traits_list_item" />
|
tools:listitem="@layout/simple_list_item" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/add_trait"
|
android:id="@+id/add_trait"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<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