11e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li/* 21e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * Copyright (C) 2011 The Android Open Source Project 31e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * 41e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * Licensed under the Apache License, Version 2.0 (the "License"); 51e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * you may not use this file except in compliance with the License. 61e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * You may obtain a copy of the License at 71e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * 81e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * http://www.apache.org/licenses/LICENSE-2.0 91e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * 101e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * Unless required by applicable law or agreed to in writing, software 111e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * distributed under the License is distributed on an "AS IS" BASIS, 121e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * See the License for the specific language governing permissions and 141e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li * limitations under the License. 151e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li */ 161e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li 171e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Lipackage com.android.camera.ui; 181e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li 191e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Liimport android.content.Context; 201e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Liimport android.util.AttributeSet; 211e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Liimport android.widget.GridView; 221e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li 231e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Lipublic class ExpandedGridView extends GridView { 241e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li public ExpandedGridView(Context context, AttributeSet attrs) { 251e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li super(context, attrs); 261e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li } 271e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li 281e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li @Override 291e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 301e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li // If UNSPECIFIED is passed to GridView, it will show only one row. 311e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li // Here GridView is put in a ScrollView, so pass it a very big size with 321e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li // AT_MOST to show all the rows. 331e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li heightMeasureSpec = MeasureSpec.makeMeasureSpec(65536, MeasureSpec.AT_MOST); 341e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li super.onMeasure(widthMeasureSpec, heightMeasureSpec); 351e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li } 361e99673af90451eaffeb100735f38e6ce0f18456Wu-cheng Li} 37