Version für alte Androidversionen der Visiereinstellung für Recurvebogen.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

XSpinner.java 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * $URL$
  3. * $Revision$
  4. * $LastChangedBy$
  5. * $LastChangedDate$
  6. *
  7. * Copyright (c) 2011 spherIC, Switzerland
  8. * All rights reserved.
  9. *
  10. * This software is the confidential and proprietary information
  11. * of spherIC. ("Confidential Information"). You shall not
  12. * disclose such Confidential Information and shall use it only
  13. * in accordance with the terms of the license agreement you
  14. * entered into with spherIC.
  15. */
  16. package ch.spherIC.recurvebowsight.components;
  17. import android.content.Context;
  18. import android.util.AttributeSet;
  19. import android.widget.Spinner;
  20. /**
  21. * XSpinner class with special functionality
  22. */
  23. public class XSpinner extends Spinner {
  24. /**
  25. * Creates a new XSpinner object.
  26. *
  27. * @param context {@link Context}
  28. */
  29. public XSpinner(final Context context) {
  30. super(context);
  31. }
  32. /**
  33. * Creates a new XSpinner object.
  34. *
  35. * @param context {@link Context}
  36. * @param attrs {@link AttributeSet}
  37. */
  38. public XSpinner(final Context context, final AttributeSet attrs) {
  39. super(context, attrs);
  40. }
  41. /**
  42. * Creates a newXSpinner object.
  43. *
  44. * @param context {@link Context}
  45. * @param attrs {@link AttributeSet}
  46. * @param defStyle int
  47. */
  48. public XSpinner(final Context context, final AttributeSet attrs, final int defStyle) {
  49. super(context, attrs, defStyle);
  50. }
  51. /**
  52. * Sets the value of $param.name$
  53. *
  54. * @param value DOCUMENT ME!
  55. */
  56. public void setSelectionByVal(final String value) {
  57. int count = getAdapter().getCount();
  58. for (int i = 0; i < count; i++) {
  59. if (getAdapter().getItem(i).toString().equals(value)) {
  60. setSelection(i);
  61. break;
  62. }
  63. }
  64. }
  65. @Override
  66. public void onDetachedFromWindow() {
  67. super.onDetachedFromWindow();
  68. }
  69. }