Exemplo n.º 1
0
  public void setupView(Context context) {
    mContext = context;
    mCurrentUnit = null;
    mInflater = LayoutInflater.from(context);
    mRootView = (LinearLayout) mInflater.inflate(R.layout.data_options_view, this);

    mExpander = (ExpanderView) mRootView.findViewById(R.id.expander);
    mExpander.setExpandtext(getResources().getString(R.string.data_options));

    mUnits = (Spinner) mRootView.findViewById(R.id.unit_picker);
    mUnits.setOnItemSelectedListener(this);
    mUnits.setAdapter(
        new ArrayAdapter<>(mContext, android.R.layout.simple_list_item_1, TransformHelper.UNITS));

    mClearButton = (Button) mRootView.findViewById(R.id.clear_button);
    mClearButton.setOnClickListener(this);

    mPicker = (NumberPicker) mRootView.findViewById(R.id.picker);
    setupPicker();

    mAutoScale = (CheckBox) mRootView.findViewById(R.id.auto_scale);
    mAutoScale.setOnCheckedChangeListener(this);
  }
Exemplo n.º 2
0
 public void expand(boolean val) {
   mExpander.expandView(val);
 }
Exemplo n.º 3
0
 public boolean isExpanded() {
   return mExpander.getExpanded();
 }