1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.widget.scroll; 18 19 import android.util.ScrollViewScenario; 20 import android.widget.Button; 21 import android.widget.LinearLayout; 22 import android.widget.TextView; 23 24 /** 25 * Two buttons sandwiching a tall text view (good for testing panning across 26 * before getting to next button). 27 */ 28 public class ButtonsWithTallTextViewInBetween extends ScrollViewScenario { 29 getTopButton()30 public Button getTopButton() { 31 return getContentChildAt(0); 32 } 33 getMiddleFiller()34 public TextView getMiddleFiller() { 35 return getContentChildAt(1); 36 } 37 getBottomButton()38 public Button getBottomButton() { 39 LinearLayout ll = getContentChildAt(2); 40 return (Button) ll.getChildAt(0); 41 } 42 init(Params params)43 protected void init(Params params) { 44 45 params.addButton("top button", 0.2f) 46 .addTextView("middle filler", 1.51f) 47 .addVerticalLLOfButtons("bottom", 1, 0.2f); 48 } 49 } 50