Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e174f143 authored by Diego Perez's avatar Diego Perez Committed by Android (Google) Code Review
Browse files

Merge "Add tools attributes to set extreme values for NumberPicker"

parents 95842c88 1d8b0bb6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.annotation.NonNull;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.NumberPicker;

import java.io.File;
import java.util.HashMap;
@@ -320,6 +321,17 @@ public final class BridgeInflater extends LayoutInflater {
                    getDrawerLayoutMap().put(view, attrVal);
                }
            }
            else if (view instanceof NumberPicker) {
                NumberPicker numberPicker = (NumberPicker) view;
                String minValue = attrs.getAttributeValue(BridgeConstants.NS_TOOLS_URI, "minValue");
                if (minValue != null) {
                    numberPicker.setMinValue(Integer.parseInt(minValue));
                }
                String maxValue = attrs.getAttributeValue(BridgeConstants.NS_TOOLS_URI, "maxValue");
                if (maxValue != null) {
                    numberPicker.setMaxValue(Integer.parseInt(maxValue));
                }
            }

        }
    }