We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using kotlin as well as java
<fr.ganfra.materialspinner.MaterialSpinner android:id="@+id/spnPrimaryGrowthStage" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dimen_8" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:ms_baseColor="@color/separator_black" app:ms_floatingLabelColor="@color/colorPrimary" app:ms_floatingLabelText="@string/select_growth_stage" app:ms_highlightColor="@color/colorPrimary"
app:ms_hint="@string/primaryGrowthStage" app:ms_hintColor="@color/cool_grey_light" app:ms_multiline="true"/>
class PrimaryGrowthStageAdapter(private val context: Context, private val items: List) : BaseAdapter() {
private var mView: View? = null override fun getItem(position: Int): Any = items[position] override fun getItemId(position: Int): Long = position.toLong() override fun getCount(): Int = items.size override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { val viewHolder: ViewHolder if (mView == null) { mView = LayoutInflater.from(context).inflate(R.layout.spinner_item, parent, false) viewHolder = ViewHolder() viewHolder.tvTitle = mView!!.findViewById(R.id.tvTitle) as TextView mView!!.tag = viewHolder } else { viewHolder = mView!!.tag as ViewHolder } viewHolder.tvTitle!!.text = items[position].growthStageTitle viewHolder.tvTitle!!.setTextColor(Color.BLACK) return mView!! } class ViewHolder { var tvTitle: TextView? = null }
}
private void populatePrimaryGrowthStageSpinner(@nonnull List primaryGrowthStageItems) { primaryGrowthStageAdapter = new PrimaryGrowthStageAdapter(getApplicationContext(), primaryGrowthStageItems); spnPrimaryGrowthStage.setAdapter(primaryGrowthStageAdapter); spnPrimaryGrowthStage.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @OverRide public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position > 0) { mSelectedPrimaryGrowthStage = (TempPrimaryGrowthStageItem) parent.getSelectedItem(); if (mSelectedPrimaryGrowthStage != null) { getSecondaryGrowthStage(mSelectedPrimaryGrowthStage.getGrowthStageId()); } } }
@Override public void onNothingSelected(AdapterView<?> parent) { } }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using kotlin as well as java
<fr.ganfra.materialspinner.MaterialSpinner
android:id="@+id/spnPrimaryGrowthStage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen_8"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:ms_baseColor="@color/separator_black"
app:ms_floatingLabelColor="@color/colorPrimary"
app:ms_floatingLabelText="@string/select_growth_stage"
app:ms_highlightColor="@color/colorPrimary"
class PrimaryGrowthStageAdapter(private val context: Context, private val items: List) :
BaseAdapter() {
}
private void populatePrimaryGrowthStageSpinner(@nonnull List primaryGrowthStageItems) {
primaryGrowthStageAdapter = new PrimaryGrowthStageAdapter(getApplicationContext(), primaryGrowthStageItems);
spnPrimaryGrowthStage.setAdapter(primaryGrowthStageAdapter);
spnPrimaryGrowthStage.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@OverRide
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position > 0) {
mSelectedPrimaryGrowthStage = (TempPrimaryGrowthStageItem) parent.getSelectedItem();
if (mSelectedPrimaryGrowthStage != null) {
getSecondaryGrowthStage(mSelectedPrimaryGrowthStage.getGrowthStageId());
}
}
}
The text was updated successfully, but these errors were encountered: