ActionBarContainer.java revision 45f1e08c348ccb129bcc25e438c05421f7123f41
145f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell/* 245f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * Copyright (C) 2010 The Android Open Source Project 345f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * 445f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * Licensed under the Apache License, Version 2.0 (the "License"); 545f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * you may not use this file except in compliance with the License. 645f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * You may obtain a copy of the License at 745f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * 845f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * http://www.apache.org/licenses/LICENSE-2.0 945f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * 1045f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * Unless required by applicable law or agreed to in writing, software 1145f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * distributed under the License is distributed on an "AS IS" BASIS, 1245f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1345f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * See the License for the specific language governing permissions and 1445f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * limitations under the License. 1545f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell */ 1645f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell 1745f1e08c348ccb129bcc25e438c05421f7123f41Adam Powellpackage com.android.internal.widget; 1845f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell 1945f1e08c348ccb129bcc25e438c05421f7123f41Adam Powellimport android.content.Context; 2045f1e08c348ccb129bcc25e438c05421f7123f41Adam Powellimport android.content.res.TypedArray; 2145f1e08c348ccb129bcc25e438c05421f7123f41Adam Powellimport android.util.AttributeSet; 2245f1e08c348ccb129bcc25e438c05421f7123f41Adam Powellimport android.widget.FrameLayout; 2345f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell 2445f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell/** 2545f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * This class acts as a container for the action bar view and action mode context views. 2645f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * It applies special styles as needed to help handle animated transitions between them. 2745f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell * @hide 2845f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell */ 2945f1e08c348ccb129bcc25e438c05421f7123f41Adam Powellpublic class ActionBarContainer extends FrameLayout { 3045f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell public ActionBarContainer(Context context) { 3145f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell this(context, null); 3245f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell } 3345f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell 3445f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell public ActionBarContainer(Context context, AttributeSet attrs) { 3545f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell super(context, attrs); 3645f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell 3745f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell TypedArray a = context.obtainStyledAttributes(attrs, 3845f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell com.android.internal.R.styleable.ActionBar); 3945f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell setBackgroundDrawable(a.getDrawable(com.android.internal.R.styleable.ActionBar_background)); 4045f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell a.recycle(); 4145f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell } 4245f1e08c348ccb129bcc25e438c05421f7123f41Adam Powell} 43