Giter Site home page Giter Site logo

quantityview's People

Contributors

himanshu-soni 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

quantityview's Issues

关于 SDK 版本

使用过程中,sync gradle 提示要求最低 SDK 版本为 15 ,实际上我手动导入 module ,14 也是可以的。

Crash Problem!

You need to use a Theme.AppCompat theme (or descendant) with this activity

When I use the component in my project, I have got this Error message!

So I have found the code and located the error at the following code:

else if (v == mTextViewQuantity) {
if (!quantityDialog) return;

        if (mTextViewClickListener != null) {
            mTextViewClickListener.onClick(v);
            return;
        }
        // Crash at this line!
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        builder.setTitle(labelDialogTitle);

        final View inflate = LayoutInflater.from(getContext()).inflate(R.layout.qv_dialog_changequantity, null, false);
        final EditText et = (EditText) inflate.findViewById(R.id.qv_et_change_qty);
        et.setText(String.valueOf(quantity));

        builder.setView(inflate);
        builder.setPositiveButton(labelPositiveButton, null);
        final AlertDialog dialog = builder.show();
        dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                String newQuantity = et.getText().toString();
                if (isValidNumber(newQuantity)) {
                    int intNewQuantity = Integer.parseInt(newQuantity);
                    Log.d(VIEW_LOG_TAG, "newQuantity " + intNewQuantity + " max " + maxQuantity);
                    if (intNewQuantity > maxQuantity) {
                        Toast.makeText(getContext(), "Maximum quantity allowed is " + maxQuantity, Toast.LENGTH_LONG).show();
                    } else if (intNewQuantity < minQuantity) {
                        Toast.makeText(getContext(), "Minimum quantity allowed is " + minQuantity, Toast.LENGTH_LONG).show();
                    } else {
                        setQuantity(intNewQuantity);
                        hideKeyboard(et);
                        dialog.dismiss();
                    }

                } else {
                    Toast.makeText(getContext(), "Enter valid number", Toast.LENGTH_LONG).show();
                }
            }
        });
    } 

getContext() should be replaced by getActivity(). Currently I have to note the code to solve this problem!

Edit the number won't call the OnQuantityChangeListener onQuantityChanged

First, it's really thank you share this great component, it's beautiful. I use it in the shopping cart, the plus and minus button will call onQuantityChanged when user tap on it. But if the user edits the number through the EditText, it's won't call any listener, so kind of hard the tell the whole shopping cart the item has been changed.

Cannot reduce the size of the view

I tried to reduce the size of the view but ,the + button gets hidden

<me.himanshusoni.quantityview.QuantityView
android:layout_marginEnd="10dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="100dp"
android:layout_height="35dp"
app:qv_quantity="1"
app:qv_minQuantity="1"
app:qv_quantityDialog="false" />

Quantity View with Radius

Hello @himanshu-soni ,

Can I give radius to quantity view?

I want Quantity view with corner radius

If you have added any such functionality , then please let me know.

Any help from your side will be greatly appreciated.

I am sending screen short on your gmail which will help you to understand problem.

Thank you!

嵌套布局中滚动后出现点击问题

在CoordinatorLayout > NestedScrollView > recyclerview这样的布局中,初始化后recyclerview中每个QuantityView点击正常,但滚动后就没法再点击了。

Is it possible to make it Vertical ?

it would be great if there's an attribute for orientation of the view, and allow us to determine if the "add" is on top or vise versa !

Also the rotation of "add" & "remove" drawables shouldn't be affected whether the view is vertical or horizontal !

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.