Home | History | Annotate | Download | only in linear
      1 /*
      2  * Copyright (C) 2007 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.layout.linear;
     18 
     19 import android.app.Activity;
     20 import android.os.Bundle;
     21 import android.os.RemoteException;
     22 import android.view.View;
     23 import android.widget.Button;
     24 import android.widget.LinearLayout;
     25 import com.android.frameworks.coretests.R;
     26 
     27 /**
     28  * One of two simple vertical linear layouts of buttons used to test out
     29  * the transistion between touch and focus mode.
     30  */
     31 public class LLOfButtons1 extends Activity {
     32 
     33     private boolean mButtonPressed = false;
     34     private Button mFirstButton;
     35 
     36     @Override
     37     protected void onCreate(Bundle icicle) {
     38         super.onCreate(icicle);
     39         setContentView(R.layout.linear_layout_buttons);
     40         mFirstButton = (Button) findViewById(R.id.button1);
     41 
     42         mFirstButton.setOnClickListener(new View.OnClickListener() {
     43             public void onClick(View v) {
     44                 mButtonPressed = true;
     45             }
     46         });
     47 
     48     }
     49 
     50     public LinearLayout getLayout() {
     51         return (LinearLayout) findViewById(R.id.layout);
     52     }
     53 
     54     public Button getFirstButton() {
     55         return mFirstButton;
     56     }
     57 
     58     public boolean buttonClickListenerFired() {
     59         return mButtonPressed;
     60     }
     61 
     62     public boolean isInTouchMode() {
     63         return mFirstButton.isInTouchMode();
     64     }
     65 
     66 }
     67