mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[android] Refactoring regression fix
Signed-off-by: hemanggs <hemangmanhas@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
72ff90defd
commit
fbaa59ce3b
@@ -55,20 +55,23 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
|
||||
{
|
||||
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
switch (viewType)
|
||||
{
|
||||
case TYPE_CATEGORY ->
|
||||
{
|
||||
return new FeatureViewHolder(
|
||||
LayoutInflater.from(parent.getContext()).inflate(R.layout.item_feature_category, parent, false));
|
||||
return new FeatureViewHolder(inflater.inflate(R.layout.item_feature_category, parent, false));
|
||||
}
|
||||
case TYPE_FOOTER ->
|
||||
{
|
||||
return new FooterViewHolder(
|
||||
LayoutInflater.from(parent.getContext()).inflate(R.layout.item_feature_category_footer, parent, false),
|
||||
(FooterListener) mFragment);
|
||||
return new FooterViewHolder(inflater.inflate(R.layout.item_feature_category_footer, parent, false),
|
||||
(FooterListener) mFragment);
|
||||
}
|
||||
default ->
|
||||
{
|
||||
throw new IllegalArgumentException("Unsupported viewType: " + viewType);
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Unsupported");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user