1/* 2 * Copyright (C) 2011 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 17package com.android.layoutlib.bridge.bars; 18 19import com.android.resources.Density; 20import com.android.resources.ResourceType; 21 22import org.xmlpull.v1.XmlPullParserException; 23 24import android.content.Context; 25import android.graphics.drawable.Drawable; 26import android.graphics.drawable.LevelListDrawable; 27import android.widget.TextView; 28 29public class TabletSystemBar extends CustomBar { 30 31 public TabletSystemBar(Context context, Density density) throws XmlPullParserException { 32 super(context, density, "/bars/tablet_system_bar.xml", "tablet_system_bar.xml"); 33 34 setBackgroundColor(0xFF000000); 35 36 // Cannot access the inside items through id because no R.id values have been 37 // created for them. 38 // We do know the order though. 39 loadIcon(0, "ic_sysbar_back_default.png", density); 40 loadIcon(1, "ic_sysbar_home_default.png", density); 41 loadIcon(2, "ic_sysbar_recent_default.png", density); 42 // 3 is the spacer 43 loadIcon(4, "stat_sys_wifi_signal_4_fully.png", density); 44 Drawable drawable = loadIcon(5, ResourceType.DRAWABLE, "stat_sys_battery_charge"); 45 if (drawable instanceof LevelListDrawable) { 46 ((LevelListDrawable) drawable).setLevel(100); 47 } 48 } 49 50 @Override 51 protected TextView getStyleableTextView() { 52 return null; 53 } 54} 55