wjc
2025-02-07 e57e1c01a52a326343122d458ad3bd330fc9d347
countrypicker/src/main/java/com/sahooz/library/countrypicker/Adapter.java
@@ -5,6 +5,7 @@
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.ViewGroup;
@@ -17,6 +18,7 @@
    private final LayoutInflater inflater;
    private PickCountryCallback callback = null;
    private final Context context;
    public Adapter(Context ctx) {
        inflater = LayoutInflater.from(ctx);
        context = ctx;
@@ -25,6 +27,7 @@
    public void setSelectedCountries(ArrayList<Country> selectedCountries) {
        this.selectedCountries = selectedCountries;
        notifyDataSetChanged();
    }
    public void setCallback(PickCountryCallback callback) {
@@ -38,6 +41,7 @@
    }
    private int itemHeight = -1;
    public void setItemHeight(float dp) {
        itemHeight = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, dp, context.getResources().getDisplayMetrics());
    }