OSDN Git Service

Automatic translation import
[android-x86/packages-apps-Eleven.git] / src / com / andrew / apollo / widgets / theme / ThemeableFrameLayout.java
1 /*
2  * Copyright (C) 2012 Andrew Neal Licensed under the Apache License, Version 2.0
3  * (the "License"); you may not use this file except in compliance with the
4  * License. You may obtain a copy of the License at
5  * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
6  * or agreed to in writing, software distributed under the License is
7  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the specific language
9  * governing permissions and limitations under the License.
10  */
11
12 package com.andrew.apollo.widgets.theme;
13
14 import android.content.Context;
15 import android.util.AttributeSet;
16 import android.widget.FrameLayout;
17
18 import com.andrew.apollo.utils.ThemeUtils;
19
20 /**
21  * This is a custom {@link FrameLayout} that is used as the main conent when
22  * transacting fragments that is made themeable by allowing developers to change
23  * the background.
24  * 
25  * @author Andrew Neal (andrewdneal@gmail.com)
26  */
27 public class ThemeableFrameLayout extends FrameLayout {
28
29     /**
30      * Used to set the background
31      */
32     public static final String BACKGROUND = "pager_background";
33
34     /**
35      * @param context The {@link Context} to use
36      * @param attrs The attributes of the XML tag that is inflating the view.
37      */
38     @SuppressWarnings("deprecation")
39     public ThemeableFrameLayout(final Context context, final AttributeSet attrs) {
40         super(context, attrs);
41         // Initialze the theme resources
42         final ThemeUtils resources = new ThemeUtils(context);
43         // Theme the layout
44         setBackgroundDrawable(resources.getDrawable(BACKGROUND));
45     }
46
47 }