blob: 91665eef3b64466dd60010866cdd15767bb2d18c [file] [log] [blame]
/*
* Copyright (C) 2008 The Android Open Source Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.widget.cts;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.animation.Transformation;
import android.widget.Gallery;
/**
* A minimal mock gallery for {@link Gallery} test.
*/
public class MyGallery extends Gallery {
private ContextMenuInfo mContextMenuInfo;
public MyGallery(Context context) {
super(context);
}
public MyGallery(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyGallery(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected boolean getChildStaticTransformation(View child, Transformation t) {
return super.getChildStaticTransformation(child, t);
}
protected void setParent(ViewParent v) {
mParent = v;
}
@Override
protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
return super.checkLayoutParams(p);
}
@Override
protected int computeHorizontalScrollExtent() {
return super.computeHorizontalScrollExtent();
}
@Override
protected int computeHorizontalScrollOffset() {
return super.computeHorizontalScrollOffset();
}
@Override
protected int computeHorizontalScrollRange() {
return super.computeHorizontalScrollRange();
}
@Override
protected void dispatchSetPressed(boolean pressed) {
super.dispatchSetPressed(pressed);
}
@Override
protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
return super.generateDefaultLayoutParams();
}
@Override
protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
return super.generateLayoutParams(p);
}
@Override
protected int getChildDrawingOrder(int childCount, int i) {
return super.getChildDrawingOrder(childCount, i);
}
@Override
protected ContextMenuInfo getContextMenuInfo() {
if (mContextMenuInfo == null) {
mContextMenuInfo = new MyContextMenuInfo();
}
return mContextMenuInfo;
}
@Override
protected void onFocusChanged(boolean gainFocus, int direction,
Rect previouslyFocusedRect) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
}
private static class MyContextMenuInfo implements ContextMenuInfo {
}
}