1716ba89e7f459f49ea85070d4710c1d79d715298George Mount/* 2716ba89e7f459f49ea85070d4710c1d79d715298George Mount * Copyright (C) 2015 The Android Open Source Project 3716ba89e7f459f49ea85070d4710c1d79d715298George Mount * 4716ba89e7f459f49ea85070d4710c1d79d715298George Mount * Licensed under the Apache License, Version 2.0 (the "License"); 5716ba89e7f459f49ea85070d4710c1d79d715298George Mount * you may not use this file except in compliance with the License. 6716ba89e7f459f49ea85070d4710c1d79d715298George Mount * You may obtain a copy of the License at 7716ba89e7f459f49ea85070d4710c1d79d715298George Mount * 8716ba89e7f459f49ea85070d4710c1d79d715298George Mount * http://www.apache.org/licenses/LICENSE-2.0 9716ba89e7f459f49ea85070d4710c1d79d715298George Mount * 10716ba89e7f459f49ea85070d4710c1d79d715298George Mount * Unless required by applicable law or agreed to in writing, software 11716ba89e7f459f49ea85070d4710c1d79d715298George Mount * distributed under the License is distributed on an "AS IS" BASIS, 12716ba89e7f459f49ea85070d4710c1d79d715298George Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13716ba89e7f459f49ea85070d4710c1d79d715298George Mount * See the License for the specific language governing permissions and 14716ba89e7f459f49ea85070d4710c1d79d715298George Mount * limitations under the License. 15716ba89e7f459f49ea85070d4710c1d79d715298George Mount */ 16716ba89e7f459f49ea85070d4710c1d79d715298George Mountpackage android.databinding.testapp.vo; 17716ba89e7f459f49ea85070d4710c1d79d715298George Mount 18716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.content.Context; 19716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.databinding.ObservableBoolean; 20716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.graphics.Outline; 21716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.media.MediaPlayer; 22716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.text.Editable; 23716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.ActionMode; 24716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.ContextMenu; 25716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.DragEvent; 26716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.KeyEvent; 27716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.MenuItem; 28716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.MotionEvent; 29716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.View; 30716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.ViewStub; 31716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.WindowInsets; 32716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.animation.Animation; 33716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.AbsListView; 34716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.AdapterView; 35716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.CalendarView; 36716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.Chronometer; 37716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.CompoundButton; 38716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.ExpandableListView; 39716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.NumberPicker; 40716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.RadioGroup; 41716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.RatingBar; 42716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.SeekBar; 43716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.TextView; 44716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.widget.TimePicker; 45716ba89e7f459f49ea85070d4710c1d79d715298George Mount 46716ba89e7f459f49ea85070d4710c1d79d715298George Mountpublic class ListenerBindingObject { 47716ba89e7f459f49ea85070d4710c1d79d715298George Mount public static int lastClick = 0; 48716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean inflateCalled; 49716ba89e7f459f49ea85070d4710c1d79d715298George Mount private final Context mContext; 50716ba89e7f459f49ea85070d4710c1d79d715298George Mount 51716ba89e7f459f49ea85070d4710c1d79d715298George Mount public final ObservableBoolean clickable = new ObservableBoolean(); 52716ba89e7f459f49ea85070d4710c1d79d715298George Mount public final ObservableBoolean useOne = new ObservableBoolean(); 53716ba89e7f459f49ea85070d4710c1d79d715298George Mount 54716ba89e7f459f49ea85070d4710c1d79d715298George Mount public ListenerBindingObject(Context context) { 55716ba89e7f459f49ea85070d4710c1d79d715298George Mount clickable.set(true); 56716ba89e7f459f49ea85070d4710c1d79d715298George Mount this.mContext = context; 57716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 58716ba89e7f459f49ea85070d4710c1d79d715298George Mount 59716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onMovedToScrapHeap(View view) { } 60716ba89e7f459f49ea85070d4710c1d79d715298George Mount 61716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, 62716ba89e7f459f49ea85070d4710c1d79d715298George Mount int totalItemCount) {} 63716ba89e7f459f49ea85070d4710c1d79d715298George Mount 64716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onScrollStateChanged(AbsListView view, int scrollState) { } 65716ba89e7f459f49ea85070d4710c1d79d715298George Mount 66716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onMenuItemClick(MenuItem item) { 67716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 68716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 69716ba89e7f459f49ea85070d4710c1d79d715298George Mount 70716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onItemClick(AdapterView<?> parent, View view, int position, long id) { } 71716ba89e7f459f49ea85070d4710c1d79d715298George Mount 72716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { 73716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 74716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 75716ba89e7f459f49ea85070d4710c1d79d715298George Mount 76716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { } 77716ba89e7f459f49ea85070d4710c1d79d715298George Mount 78716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onNothingSelected(AdapterView<?> parent) { } 79716ba89e7f459f49ea85070d4710c1d79d715298George Mount 80716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onDismiss() { } 81716ba89e7f459f49ea85070d4710c1d79d715298George Mount 82716ba89e7f459f49ea85070d4710c1d79d715298George Mount public CharSequence fixText(CharSequence invalidText) { 83716ba89e7f459f49ea85070d4710c1d79d715298George Mount return invalidText; 84716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 85716ba89e7f459f49ea85070d4710c1d79d715298George Mount 86716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean isValid(CharSequence text) { 87716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 88716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 89716ba89e7f459f49ea85070d4710c1d79d715298George Mount 90716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) { } 91716ba89e7f459f49ea85070d4710c1d79d715298George Mount 92716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onChronometerTick(Chronometer chronometer) { } 93716ba89e7f459f49ea85070d4710c1d79d715298George Mount 94716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } 95716ba89e7f459f49ea85070d4710c1d79d715298George Mount 96716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, 97716ba89e7f459f49ea85070d4710c1d79d715298George Mount int childPosition, long id) { 98716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 99716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 100716ba89e7f459f49ea85070d4710c1d79d715298George Mount 101716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { 102716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 103716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 104716ba89e7f459f49ea85070d4710c1d79d715298George Mount 105716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onGroupCollapse(int groupPosition) { } 106716ba89e7f459f49ea85070d4710c1d79d715298George Mount 107716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onGroupExpand(int groupPosition) { } 108716ba89e7f459f49ea85070d4710c1d79d715298George Mount 109716ba89e7f459f49ea85070d4710c1d79d715298George Mount public String format(int value) { 110716ba89e7f459f49ea85070d4710c1d79d715298George Mount return null; 111716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 112716ba89e7f459f49ea85070d4710c1d79d715298George Mount 113716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onValueChange(NumberPicker picker, int oldVal, int newVal) { } 114716ba89e7f459f49ea85070d4710c1d79d715298George Mount 115716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onScrollStateChange(NumberPicker view, int scrollState) { } 116716ba89e7f459f49ea85070d4710c1d79d715298George Mount 117716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onCheckedChanged(RadioGroup group, int checkedId) { } 118716ba89e7f459f49ea85070d4710c1d79d715298George Mount 119716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { } 120716ba89e7f459f49ea85070d4710c1d79d715298George Mount 121716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onClose() { 122716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 123716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 124716ba89e7f459f49ea85070d4710c1d79d715298George Mount 125716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onQueryTextChange(String newText) { 126716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 127716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 128716ba89e7f459f49ea85070d4710c1d79d715298George Mount 129716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onQueryTextSubmit(String query) { 130716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 131716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 132716ba89e7f459f49ea85070d4710c1d79d715298George Mount 133716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onSuggestionClick(int position) { 134716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 135716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 136716ba89e7f459f49ea85070d4710c1d79d715298George Mount 137716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onSuggestionSelect(int position) { 138716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 139716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 140716ba89e7f459f49ea85070d4710c1d79d715298George Mount 141716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { } 142716ba89e7f459f49ea85070d4710c1d79d715298George Mount 143716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onStartTrackingTouch(SeekBar seekBar) { } 144716ba89e7f459f49ea85070d4710c1d79d715298George Mount 145716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onStopTrackingTouch(SeekBar seekBar) { } 146716ba89e7f459f49ea85070d4710c1d79d715298George Mount 147716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onTabChanged(String tabId) { } 148716ba89e7f459f49ea85070d4710c1d79d715298George Mount 149716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { 150716ba89e7f459f49ea85070d4710c1d79d715298George Mount return false; 151716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 152716ba89e7f459f49ea85070d4710c1d79d715298George Mount 153716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void afterTextChanged(Editable s) { } 154716ba89e7f459f49ea85070d4710c1d79d715298George Mount 155716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void beforeTextChanged(CharSequence s, int start, int count, int after) { } 156716ba89e7f459f49ea85070d4710c1d79d715298George Mount 157716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onTextChanged(CharSequence s, int start, int before, int count) { } 158716ba89e7f459f49ea85070d4710c1d79d715298George Mount 159716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { } 160716ba89e7f459f49ea85070d4710c1d79d715298George Mount 161716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onClick(View view) { } 162716ba89e7f459f49ea85070d4710c1d79d715298George Mount 163716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onCompletion(MediaPlayer mp) { } 164716ba89e7f459f49ea85070d4710c1d79d715298George Mount 165716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onError(MediaPlayer mp, int what, int extra) { 166716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 167716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 168716ba89e7f459f49ea85070d4710c1d79d715298George Mount 169716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onInfo(MediaPlayer mp, int what, int extra) { 170716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 171716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 172716ba89e7f459f49ea85070d4710c1d79d715298George Mount 173716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onPrepared(MediaPlayer mp) { } 174716ba89e7f459f49ea85070d4710c1d79d715298George Mount 175716ba89e7f459f49ea85070d4710c1d79d715298George Mount public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { 176716ba89e7f459f49ea85070d4710c1d79d715298George Mount return null; 177716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 178716ba89e7f459f49ea85070d4710c1d79d715298George Mount 179716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onCreateContextMenu(ContextMenu menu, View v, 180716ba89e7f459f49ea85070d4710c1d79d715298George Mount ContextMenu.ContextMenuInfo menuInfo) { } 181716ba89e7f459f49ea85070d4710c1d79d715298George Mount 182716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onDrag(View v, DragEvent event) { 183716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 184716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 185716ba89e7f459f49ea85070d4710c1d79d715298George Mount 186716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onFocusChange(View v, boolean hasFocus) { } 187716ba89e7f459f49ea85070d4710c1d79d715298George Mount 188716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onGenericMotion(View v, MotionEvent event) { 189716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 190716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 191716ba89e7f459f49ea85070d4710c1d79d715298George Mount 192716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onHover(View v, MotionEvent event) { 193716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 194716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 195716ba89e7f459f49ea85070d4710c1d79d715298George Mount 196716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onKey(View v, int keyCode, KeyEvent event) { 197716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 198716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 199716ba89e7f459f49ea85070d4710c1d79d715298George Mount 200716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onLongClick(View v) { 201716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 202716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 203716ba89e7f459f49ea85070d4710c1d79d715298George Mount 204716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onSystemUiVisibilityChange(int visibility) { } 205716ba89e7f459f49ea85070d4710c1d79d715298George Mount 206716ba89e7f459f49ea85070d4710c1d79d715298George Mount public boolean onTouch(View v, MotionEvent event) { 207716ba89e7f459f49ea85070d4710c1d79d715298George Mount return true; 208716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 209716ba89e7f459f49ea85070d4710c1d79d715298George Mount 210716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void getOutline(View view, Outline outline) { } 211716ba89e7f459f49ea85070d4710c1d79d715298George Mount 212716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onViewAttachedToWindow(View v) { } 213716ba89e7f459f49ea85070d4710c1d79d715298George Mount 214716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onViewDetachedFromWindow(View v) { } 215716ba89e7f459f49ea85070d4710c1d79d715298George Mount 216716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onChildViewAdded(View parent, View child) { } 217716ba89e7f459f49ea85070d4710c1d79d715298George Mount 218716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onChildViewRemoved(View parent, View child) { } 219716ba89e7f459f49ea85070d4710c1d79d715298George Mount 220716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onAnimationEnd(Animation animation) { } 221716ba89e7f459f49ea85070d4710c1d79d715298George Mount 222716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onAnimationRepeat(Animation animation) { } 223716ba89e7f459f49ea85070d4710c1d79d715298George Mount 224716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onAnimationStart(Animation animation) { } 225716ba89e7f459f49ea85070d4710c1d79d715298George Mount 226716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onInflate(ViewStub stub, View inflated) { 227716ba89e7f459f49ea85070d4710c1d79d715298George Mount inflateCalled = true; 228716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 229716ba89e7f459f49ea85070d4710c1d79d715298George Mount 230716ba89e7f459f49ea85070d4710c1d79d715298George Mount public View makeView() { 231716ba89e7f459f49ea85070d4710c1d79d715298George Mount return new View(mContext); 232716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 233716ba89e7f459f49ea85070d4710c1d79d715298George Mount 234716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onClick1(View view) { 235716ba89e7f459f49ea85070d4710c1d79d715298George Mount lastClick = 1; 236716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 237716ba89e7f459f49ea85070d4710c1d79d715298George Mount 238716ba89e7f459f49ea85070d4710c1d79d715298George Mount public static void onClick2(View view) { 239716ba89e7f459f49ea85070d4710c1d79d715298George Mount lastClick = 2; 240716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 241716ba89e7f459f49ea85070d4710c1d79d715298George Mount 242716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onClick3(View view) { 243716ba89e7f459f49ea85070d4710c1d79d715298George Mount lastClick = 3; 244716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 245716ba89e7f459f49ea85070d4710c1d79d715298George Mount 246716ba89e7f459f49ea85070d4710c1d79d715298George Mount public static void onClick4(View view) { 247716ba89e7f459f49ea85070d4710c1d79d715298George Mount lastClick = 4; 248716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 249716ba89e7f459f49ea85070d4710c1d79d715298George Mount 250716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onFoo() { 251716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 252716ba89e7f459f49ea85070d4710c1d79d715298George Mount 253716ba89e7f459f49ea85070d4710c1d79d715298George Mount} 254