1 package com.xtremelabs.robolectric.shadows;
2 
3 import android.view.View;
4 import android.widget.ZoomButtonsController;
5 import com.xtremelabs.robolectric.internal.Implementation;
6 import com.xtremelabs.robolectric.internal.Implements;
7 
8 /**
9  * Shadow of {@code ZoomButtonsController} that allows simulated clicking of the zoom button controls to trigger
10  * events on the registered listener.
11  */
12 @SuppressWarnings({"UnusedDeclaration"})
13 @Implements(ZoomButtonsController.class)
14 public class ShadowZoomButtonsController {
15     private ZoomButtonsController.OnZoomListener listener;
16 
__constructor__(View ownerView)17     public void __constructor__(View ownerView) {
18     }
19 
20     @Implementation
setOnZoomListener(ZoomButtonsController.OnZoomListener listener)21     public void setOnZoomListener(ZoomButtonsController.OnZoomListener listener) {
22         this.listener = listener;
23     }
24 
simulateZoomInButtonClick()25     public void simulateZoomInButtonClick() {
26         listener.onZoom(true);
27     }
28 
simulateZoomOutButtonClick()29     public void simulateZoomOutButtonClick() {
30         listener.onZoom(false);
31     }
32 }
33