Code Monkey home page Code Monkey logo

search-dialog's Introduction

Android Arsenal

SearchDialog

Android Search Dialog Library

Setup

1. Provide the gradle dependency

Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the gradle dependency to your app module build.gradle file:

	dependencies {
	        implementation 'com.github.ajithvgiri:search-dialog:v1.5'
	}

2. Initialization of the SearchDialog

Java

model contains id and title

      List<SearchListItem> searchListItems = new ArrayList<>();
      SearchableDialog  searchableDialog = new SearchableDialog(this, searchListItems, "Title");

Kotlin

model contains id and title

    val searchableDialog = SearchableDialog(this, searchListItems, getString(R.string.country))
    searchableDialog.setOnItemSelected(this) // implement 'OnSearchItemSelected'in your Activity

3. Show the SearchDialog

        searchableDialog.show();

4. Get Selected Item from the SearchDialog

Java

         @Override
         public void onClick(int position, SearchListItem searchListItem) {
                searchableDialog.dismiss();
               // searchListItem.getId(); returns id
              // searchListItem.getTitle(); returns title
         }

Kotlin

        override fun onClick(position: Int, searchListItem: SearchListItem) {
           searchableDialog.dismiss()
           //searchListItem.id.toString()
           //searchListItem.title
        }

5. Screen Shots

Search Dialog

search-dialog's People

Contributors

ajithvgiri avatar fanmixco avatar felixeduardo15 avatar qkopy-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

search-dialog's Issues

OnSearchItemSelected Error

if you want to set OnSearchItemSelected them said an error that OnSearchItemSelected is not a public interface so, never can set listener.

you can repair this? only need a public accessor for callback

Multiple Spinners in one screen

How to handle Multiple spinners in single activity.

because OnClick is does not tell from which view dialog is shown.... is there anything that i'm missing

OnSearchItemSelected() is not public

Hey, Thanks alot for this library.

I used it and it's working fine, i edited it to take a list of apps installed, anyway; i am adding the OnSearchItemSelected() but it's giving this Error:

Error:(314, 72) error: cannot find symbol class OnSearchItemSelected

My Usage:

searchableDialog.setOnItemSelected(new OnSearchItemSelected() {
@Override
public void onClick(int i, SearchListItem searchListItem) {
}
});

Anyway to fix this ? I can't import the method as well since it isn't defined as public in your library.

error: OnSearchItemSelected is not public

Thanks for such dependency! but I'm facing below error

error: OnSearchItemSelected is not public in com.ajithvgiri.searchdialog; cannot be accessed from outside package

library override app name

Android app name change to SearchDialog after implement library

tools:replace="android:label" not work for me.

Upgrade to androidx

I want to use this library but my project is already migrated to androidx, so please provide me a version with androidx as soon as possible.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.