File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1419,3 +1419,32 @@ String[] requestPermissionsList = new String[]{
14191419
14201420PermissionHelper . Companion . requestPermission(this , requestCode, requestPermissionsList);
14211421```
1422+
1423+ ### ASpinner
1424+ > ****
1425+
1426+ ``` xml
1427+ // XML
1428+ <com .amit.ui.ASpinner
1429+ android : id =" @+id/mySpinner"
1430+ android : layout_width =" match_parent"
1431+ android : layout_height =" wrap_content"
1432+ android : layout_margin =" 10dp"
1433+ android : hint =" @string/select_gender"
1434+ android : textColor =" @color/black_shade"
1435+ app : backgroundTint =" @color/colorPrimary"
1436+ app : spinner_dialog_icon_tint =" @color/colorPrimary"
1437+ app : spinner_dialog_title =" @string/select_gender"
1438+ app : spinner_dialog_title_color =" @color/colorPrimary" />
1439+
1440+ // Code
1441+ ASpinner mySpinner = findViewById(R.id.mySpinner);
1442+ mySpinner.setTitle(getResources().getString(R.string.select_gender));
1443+ mySpinner.setItems(getResources().getStringArray(R.array.gender_array));
1444+
1445+ mySpinner.setOnItemClickListener((selectedItem, position) ->
1446+ {
1447+ Log.e(TAG, "onItemClick: selected item is: " + selectedItem);
1448+ Log.e(TAG, "onItemClick: selected item's position is: " + position);
1449+ });
1450+ ```
You can’t perform that action at this time.
0 commit comments