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.
12 package com.andrew.apollo.widgets.theme;
14 import android.content.Context;
15 import android.util.AttributeSet;
16 import android.widget.FrameLayout;
18 import com.andrew.apollo.utils.ThemeUtils;
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
25 * @author Andrew Neal (andrewdneal@gmail.com)
27 public class ThemeableFrameLayout extends FrameLayout {
30 * Used to set the background
32 public static final String BACKGROUND = "pager_background";
35 * @param context The {@link Context} to use
36 * @param attrs The attributes of the XML tag that is inflating the view.
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);
44 setBackgroundDrawable(resources.getDrawable(BACKGROUND));