Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

IOOBE on start #136

Closed
rostislav-maslov opened this issue May 30, 2018 · 0 comments
Closed

IOOBE on start #136

rostislav-maslov opened this issue May 30, 2018 · 0 comments

Comments

@rostislav-maslov
Copy link

Version 2.0.4
Added in BottomSheetDialogFragment

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="12dp"
    android:background="@drawable/shape_white_top_corners_round">

...
    <com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker
        android:id="@+id/sp_picker_picker"
        android:layout_width="wrap_content"
        android:layout_height="238dp"
        app:picker_curved="true"
        app:picker_cyclic="true"
        app:picker_selectedTextColor="@color/cherry_red"
        app:picker_todayText="@string/activity_order_date_today" />
</LinearLayout>

Directly to the picker do not appeal
And at the start I get the following

java.lang.ArrayIndexOutOfBoundsException: length=729; index=-1
        at java.util.ArrayList.get(ArrayList.java:439)
        at com.github.florent37.singledateandtimepicker.widget.WheelPicker.setDefaultDate(WheelPicker.java:252)
        at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.setDefaultDate(SingleDateAndTimePicker.java:361)
        at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.onAttachedToWindow(SingleDateAndTimePicker.java:165)
        at android.view.View.dispatchAttachedToWindow(View.java:17445)

Device Nexus6P
Android 8.1.0

On the OnePlus3t (Android 8.0) and Honor 9 lite (Android 8.0) code above working great

After removing attributes in xml

        app:picker_todayText="@string/activity_order_date_today"

Works fine. I don't know, why that attr crushing app, but it's a fact

Akhunzaada added a commit to Akhunzaada/SingleDateAndTimePicker that referenced this issue Jul 12, 2018
The crash was caused when today's label was set using todayText() method or from xml. The WheelDayPicker was considering the label from resources for today position instead of the custom set label.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant