[android] Refactoring regression fix

Signed-off-by: hemanggs <hemangmanhas@gmail.com>
This commit is contained in:
hemanggs
2025-08-02 22:23:40 +05:30
committed by Konstantin Pastbin
parent 72ff90defd
commit fbaa59ce3b

View File

@@ -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");
}
}