Git Product home page Git Product logo

android-multi-select-dialog's People

Contributors

abumoallim avatar gubi95 avatar hamzashahid91 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

Watchers

 avatar  avatar  avatar  avatar  avatar

android-multi-select-dialog's Issues

Very low Limit of items

I think there is an issue when the MultiSelectModel object have an 'id' greater than 127, It does not allow user to select that item on checklist.

Showing selection on scroll up or down bug

Hi,
problem i am facing is when i select 1 item from the list and scroll the list, 10 items which are listed in last are showing as selected then if i scroll up 7 items from the start showing as selected. if i press done button only my selected item shows.

also if i check on 1 item and then click on search all the items are showing selected.

so i am facing showing selection of item on scroll up/down bug.

Custom validation messages

Hi!
Could you create overrides for validation messages when min / max selection limit is not valid?
Example usage:
setMinSelectionLimitValidationMessage("Min is {0}");
setMaxSelectionLimitValidationMessage("Max is {0}");
{0} (if exists in string) could be replaced with Min / Max SelectionLimit value.

Now texts are hardcoded so I can't use any other language.

None of items selected

It would be nice if you create setting for minimum number of selected items, for example I want to select 1+ items or 0. When I try to deselect all items I got Toast message with text like this: "Please select atleast one option" and I have to do workarounds.

set limit for item selection

First of all thanks for the great work you have done in this repo ... while using your library there is need to set limit on min and max number of item that can be selected currently minimum is set to 1 by default but I need to set it while creating the dialog. How can i achieve this?

Selection on scroll - Bug

I didn't look into this in code terms, but if you already have a selection, then deselect it and scroll up / down, the item will be selected again.

I'll get back to this when i finish editing my own stuff,

-Ali.

Cannot resolve method 'getSupportFragmentManager()'

Running this in a fragment
trying to get basic example working,


import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.abdeveloper.library.MultiSelectDialog;
import com.abdeveloper.library.MultiSelectModel;

import java.util.ArrayList;

public class NewChatThreadFragment extends Fragment {

    private String TAG = "Cancel";

    Button show_dialog_btn;

    MultiSelectDialog multiSelectDialog;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_new_chat_thread, container, false);

        show_dialog_btn = view.findViewById(R.id.show_dialog);
        show_dialog_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                multiSelectDialog.show(getSupportFragmentManager(), "multiSelectDialog");
            }
        });

        //preselected Ids of Country List
        final ArrayList<Integer> alreadySelectedCountries = new ArrayList<>();
        alreadySelectedCountries.add(1);
        alreadySelectedCountries.add(3);
        alreadySelectedCountries.add(4);
        alreadySelectedCountries.add(7);

        //List of Countries with Name and Id
        ArrayList<MultiSelectModel> listOfCountries= new ArrayList<>();
        listOfCountries.add(new MultiSelectModel(1,"INDIA"));
        listOfCountries.add(new MultiSelectModel(2,"USA"));
        listOfCountries.add(new MultiSelectModel(3,"UK"));
        listOfCountries.add(new MultiSelectModel(4,"UAE"));
        listOfCountries.add(new MultiSelectModel(5,"JAPAN"));
        listOfCountries.add(new MultiSelectModel(6,"SINGAPORE"));
        listOfCountries.add(new MultiSelectModel(7,"CHINA"));
        listOfCountries.add(new MultiSelectModel(8,"RUSSIA"));
        listOfCountries.add(new MultiSelectModel(9,"BANGLADESH"));
        listOfCountries.add(new MultiSelectModel(10,"BELGIUM"));
        listOfCountries.add(new MultiSelectModel(11,"DENMARK"));
        listOfCountries.add(new MultiSelectModel(12,"GERMANY"));
        listOfCountries.add(new MultiSelectModel(13,"HONG KONG"));
        listOfCountries.add(new MultiSelectModel(14,"INDONESIA"));
        listOfCountries.add(new MultiSelectModel(15,"NETHERLAND"));
        listOfCountries.add(new MultiSelectModel(16,"NEW ZEALAND"));
        listOfCountries.add(new MultiSelectModel(17,"PORTUGAL"));
        listOfCountries.add(new MultiSelectModel(18,"KUWAIT"));
        listOfCountries.add(new MultiSelectModel(19,"QATAR"));
        listOfCountries.add(new MultiSelectModel(20,"SAUDI ARABIA"));
        listOfCountries.add(new MultiSelectModel(21,"SRI LANKA"));
        listOfCountries.add(new MultiSelectModel(130,"CANADA"));


        //MultiSelectModel
        multiSelectDialog = new MultiSelectDialog()
                .title("Title") //setting title for dialog
                .titleSize(25)
                .positiveText("Done")
                .negativeText("Cancel")
                .setMinSelectionLimit(0)
                .setMaxSelectionLimit(listOfCountries.size())
                .preSelectIDsList(alreadySelectedCountries) //List of ids that you need to be selected
                .multiSelectList(listOfCountries) // the multi select model list with ids and name
                .onSubmit(new MultiSelectDialog.SubmitCallbackListener() {
                    @Override
                    public void onSelected(ArrayList<Integer> selectedIds, ArrayList<String> selectedNames, String dataString) {
                        //will return list of selected IDS
                        for (int i = 0; i < selectedIds.size(); i++) {
                            Toast.makeText(getContext(), "Selected Ids : " + selectedIds.get(i) + "\n" +
                                    "Selected Names : " + selectedNames.get(i) + "\n" +
                                    "DataString : " + dataString, Toast.LENGTH_SHORT).show();
                        }


                    }

                    @Override
                    public void onCancel() {
                        Log.d(TAG,"Dialog cancelled");

                    }
                });
        return view;
    }
}

what am i missing?

Text of item selected

Hey,

Thanks alot for the library. I used it and it works fine, however, i have 1 issue, How do i get the text of the item that i selected ? I can get the ID just fine.

Thanks in Advance.

Font

Can you add fonts too?

Custom Theme

Please could you create a constructor where we could pass in our own theme. Thanks!

I have an below issue i am getting error for data string which i don't want to take can you please help me out

for (int i = 0; i < selectedIds.size(); i++) {
if (dataSet.isEmpty()) {
dataSet.add(new EditExhibitionItemsDataModel(selectedIds.get(i), selectedNames.get(i), selectedPrices.get(i), "", selectedCodes.get(i)));
mAdapter.notifyDataSetChanged();
}else {
if (!isPresent(selectedIds.get(i))) {
dataSet.add(new EditExhibitionItemsDataModel(selectedIds.get(i), selectedNames.get(i), selectedPrices.get(i), "", selectedCodes.get(i)));
mAdapter.notifyDataSetChanged();
}
}
}

Select All

please provide select all option as first element of drop down

Select All

Please can you provide select all option.

Cancel button not reverting selections

Hey again,

After looking into it i've found that the cancel button is also returning ArrayList ids from onDismiss(), which is wrong, because it's acting the same as Apply button.

Example: Select an item, press cancel, that item will be selected. Would be better if you'd make a condition for it to revert all selections.

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.