Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
com.thomashaertel:multispinner
Advanced tools
Android Spinner Widget with multi selectable list
MultiSpinner is a class with can be used by Android developers that need a spinner widget with multi selection capabilities. When the user touches on the spinner widget a dialog pops up with a checkbox list.
Integrating the widget is quite simple. In your layout.xml
add the following snippet:
...
<com.thomashaertel.widget.MultiSpinner
android:id="@+id/spinnerMulti"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
...
After inserting the widget in your layout add the following code to your activity:
public class MyActivity extends Activity {
private MultiSpinner spinner;
private ArrayAdapter<String> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// create spinner list elements
adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item);
adapter.add("Item1");
adapter.add("Item2");
adapter.add("Item3");
adapter.add("Item4");
adapter.add("Item5");
// get spinner and set adapter
spinner = (MultiSpinner) findViewById(R.id.spinnerMulti);
spinner.setAdapter(adapter, false, onSelectedListener);
// set initial selection
boolean[] selectedItems = new boolean[adapter.getCount()];
selectedItems[1] = true; // select second item
spinner.setSelected(selectedItems);
}
private MultiSpinner.MultiSpinnerListener onSelectedListener = new MultiSpinner.MultiSpinnerListener() {
public void onItemsSelected(boolean[] selected) {
// Do something here with the selected items
}
};
}
Add maven central to your build.gradle
:
buildscript {
repositories {
jcenter()
}
}
repositories {
jcenter()
}
Add maven central to your build.gradle
:
buildscript {
repositories {
mavenCentral()
}
}
repositories {
mavenCentral()
}
Then declare MultiSpinner within your dependencies:
dependencies {
...
compile('com.thomashaertel:multispinner:0.1.0@aar') {
}
...
}
To use MultiSpinner within your maven build simply add
<dependency>
<artifactId>multispinner</artifactId>
<version>${multispinner.version}</version>
<groupId>com.thomashaertel</groupId>
</dependency>
to your pom.xml
If you also want the sources or javadoc add the respective classifier
<classifier>sources</classifier>
or
<classifier>javadoc</classifier>
to the dependency.
FAQs
Spinner widget with multi selectable list
We found that com.thomashaertel:multispinner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.