Skip to content

Commit

Permalink
Merge branch 'master' into hooks-jsdoc-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
henninghall authored May 24, 2024
2 parents 3314a44 + 93e3c66 commit e5af811
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.henninghall.date_picker.ui.SpinnerState;
import com.henninghall.date_picker.ui.SpinnerStateListener;

import net.time4j.android.ApplicationStarter;

Expand Down Expand Up @@ -126,9 +128,21 @@ private PickerView createPicker(ReadableMap props){
}
}
picker.update();

picker.addSpinnerStateListener(new SpinnerStateListener() {
@Override
public void onChange(SpinnerState state) {
setEnabledConfirmButton(state == SpinnerState.idle);
}
});

return picker;
}

private void setEnabledConfirmButton(boolean enabled) {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(enabled);
}

private View withTopMargin(PickerView view) {
LinearLayout linearLayout = new LinearLayout(DatePickerPackage.context);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(
Expand Down

0 comments on commit e5af811

Please sign in to comment.