1package com.xtremelabs.robolectric.shadows; 2 3import android.content.Context; 4import android.util.AttributeSet; 5import android.view.View.MeasureSpec; 6import android.view.ViewGroup; 7import android.widget.FrameLayout; 8 9import com.xtremelabs.robolectric.internal.Implementation; 10import com.xtremelabs.robolectric.internal.Implements; 11 12/** 13 * Shadow for {@link FrameLayout} that simulates its implementation. 14 */ 15@SuppressWarnings("UnusedDeclaration") 16@Implements(FrameLayout.class) 17public class ShadowFrameLayout extends ShadowViewGroup { 18 19 public void __constructor__(Context context, AttributeSet attributeSet, int defStyle) { 20 setLayoutParams(new ViewGroup.MarginLayoutParams(0, 0)); 21 super.__constructor__(context, attributeSet, defStyle); 22 } 23 24 @Implementation 25 public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 26 int width = MeasureSpec.getSize(widthMeasureSpec); 27 int height = MeasureSpec.getSize(heightMeasureSpec); 28 29 layout(right, top, right + width, top + height); 30 } 31} 32