1c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta/* 2c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * Copyright (C) 2015 The Android Open Source Project 3c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * 4c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * Licensed under the Apache License, Version 2.0 (the "License"); 5c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * you may not use this file except in compliance with the License. 6c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * You may obtain a copy of the License at 7c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * 8c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * http://www.apache.org/licenses/LICENSE-2.0 9c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * 10c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * Unless required by applicable law or agreed to in writing, software 11c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * distributed under the License is distributed on an "AS IS" BASIS, 12c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * See the License for the specific language governing permissions and 14c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * limitations under the License. 15c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta */ 16c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 17c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptapackage android.support.v7.internal.widget; 18c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 19c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport org.xmlpull.v1.XmlPullParserException; 20c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 21c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.AssetFileDescriptor; 22c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.AssetManager; 23c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.ColorStateList; 24c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.Configuration; 25c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.Resources; 26c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.TypedArray; 27c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.content.res.XmlResourceParser; 28c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.graphics.Movie; 29c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.graphics.drawable.Drawable; 30c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.graphics.drawable.Drawable.ConstantState; 31c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.os.Bundle; 32c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.util.AttributeSet; 33c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.util.DisplayMetrics; 34c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.util.LongSparseArray; 35c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport android.util.TypedValue; 36c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 37c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport java.io.IOException; 38c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaimport java.io.InputStream; 39c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 40c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta/** 41c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * This extends Resources but delegates the calls to another Resources object. This enables 42c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta * any customization done by some subclass of Resources to be also picked up. 43c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta */ 44c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Guptaclass ResourcesWrapper extends Resources { 45c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 46c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta private final Resources mResources; 47c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 48c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public ResourcesWrapper(Resources resources) { 49c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta super(resources.getAssets(), resources.getDisplayMetrics(), resources.getConfiguration()); 50c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources = resources; 51c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 52c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 53c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 54c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public CharSequence getText(int id) throws NotFoundException { 55c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getText(id); 56c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 57c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 58c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 59c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public CharSequence getQuantityText(int id, int quantity) throws NotFoundException { 60c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getQuantityText(id, quantity); 61c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 62c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 63c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 64c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getString(int id) throws NotFoundException { 65c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getString(id); 66c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 67c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 68c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 69c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getString(int id, Object... formatArgs) throws NotFoundException { 70c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getString(id, formatArgs); 71c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 72c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 73c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 74c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getQuantityString(int id, int quantity, Object... formatArgs) 75c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta throws NotFoundException { 76c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getQuantityString(id, quantity, formatArgs); 77c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 78c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 79c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 80c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getQuantityString(int id, int quantity) throws NotFoundException { 81c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getQuantityString(id, quantity); 82c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 83c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 84c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 85c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public CharSequence getText(int id, CharSequence def) { 86c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getText(id, def); 87c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 88c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 89c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 90c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public CharSequence[] getTextArray(int id) throws NotFoundException { 91c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getTextArray(id); 92c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 93c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 94c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 95c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String[] getStringArray(int id) throws NotFoundException { 96c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getStringArray(id); 97c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 98c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 99c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 100c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public int[] getIntArray(int id) throws NotFoundException { 101c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getIntArray(id); 102c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 103c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 104c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 105c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public TypedArray obtainTypedArray(int id) throws NotFoundException { 106c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.obtainTypedArray(id); 107c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 108c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 109c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 110c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public float getDimension(int id) throws NotFoundException { 111c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDimension(id); 112c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 113c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 114c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 115c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public int getDimensionPixelOffset(int id) throws NotFoundException { 116c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDimensionPixelOffset(id); 117c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 118c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 119c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 120c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public int getDimensionPixelSize(int id) throws NotFoundException { 121c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDimensionPixelSize(id); 122c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 123c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 124c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 125c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public float getFraction(int id, int base, int pbase) { 126c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getFraction(id, base, pbase); 127c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 128c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 129c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 130c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public Drawable getDrawable(int id) throws NotFoundException { 131c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDrawable(id); 132c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 133c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 134c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 135c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public Drawable getDrawable(int id, Theme theme) throws NotFoundException { 136c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDrawable(id, theme); 137c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 138c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 139c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 140c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public Drawable getDrawableForDensity(int id, int density) throws NotFoundException { 141c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDrawableForDensity(id, density); 142c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 143c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 144c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 145c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public Drawable getDrawableForDensity(int id, int density, Theme theme) { 146c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDrawableForDensity(id, density, theme); 147c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 148c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 149c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 150c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public Movie getMovie(int id) throws NotFoundException { 151c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getMovie(id); 152c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 153c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 154c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 155c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public int getColor(int id) throws NotFoundException { 156c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getColor(id); 157c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 158c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 159c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 160c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public ColorStateList getColorStateList(int id) throws NotFoundException { 161c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getColorStateList(id); 162c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 163c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 164c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 165c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public boolean getBoolean(int id) throws NotFoundException { 166c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getBoolean(id); 167c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 168c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 169c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 170c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public int getInteger(int id) throws NotFoundException { 171c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getInteger(id); 172c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 173c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 174c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 175c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public XmlResourceParser getLayout(int id) throws NotFoundException { 176c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getLayout(id); 177c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 178c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 179c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 180c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public XmlResourceParser getAnimation(int id) throws NotFoundException { 181c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getAnimation(id); 182c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 183c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 184c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 185c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public XmlResourceParser getXml(int id) throws NotFoundException { 186c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getXml(id); 187c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 188c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 189c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 190c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public InputStream openRawResource(int id) throws NotFoundException { 191c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.openRawResource(id); 192c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 193c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 194c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 195c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public InputStream openRawResource(int id, TypedValue value) throws NotFoundException { 196c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.openRawResource(id, value); 197c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 198c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 199c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 200c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public AssetFileDescriptor openRawResourceFd(int id) throws NotFoundException { 201c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.openRawResourceFd(id); 202c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 203c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 204c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 205c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public void getValue(int id, TypedValue outValue, boolean resolveRefs) 206c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta throws NotFoundException { 207c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources.getValue(id, outValue, resolveRefs); 208c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 209c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 210c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 211c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public void getValueForDensity(int id, int density, TypedValue outValue, boolean resolveRefs) 212c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta throws NotFoundException { 213c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources.getValueForDensity(id, density, outValue, resolveRefs); 214c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 215c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 216c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 217c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public void getValue(String name, TypedValue outValue, boolean resolveRefs) 218c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta throws NotFoundException { 219c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources.getValue(name, outValue, resolveRefs); 220c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 221c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 222c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 223c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public TypedArray obtainAttributes(AttributeSet set, int[] attrs) { 224c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.obtainAttributes(set, attrs); 225c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 226c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 227c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 228c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public void updateConfiguration(Configuration config, DisplayMetrics metrics) { 229c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta super.updateConfiguration(config, metrics); 230c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta if (mResources != null) { // called from super's constructor. So, need to check. 231c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources.updateConfiguration(config, metrics); 232c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 233c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 234c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 235c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 236c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public DisplayMetrics getDisplayMetrics() { 237c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getDisplayMetrics(); 238c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 239c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 240c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 241c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public Configuration getConfiguration() { 242c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getConfiguration(); 243c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 244c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 245c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 246c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public int getIdentifier(String name, String defType, String defPackage) { 247c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getIdentifier(name, defType, defPackage); 248c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 249c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 250c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 251c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getResourceName(int resid) throws NotFoundException { 252c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getResourceName(resid); 253c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 254c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 255c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 256c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getResourcePackageName(int resid) throws NotFoundException { 257c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getResourcePackageName(resid); 258c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 259c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 260c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 261c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getResourceTypeName(int resid) throws NotFoundException { 262c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getResourceTypeName(resid); 263c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 264c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 265c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 266c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public String getResourceEntryName(int resid) throws NotFoundException { 267c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta return mResources.getResourceEntryName(resid); 268c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 269c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 270c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 271c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public void parseBundleExtras(XmlResourceParser parser, Bundle outBundle) 272c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta throws XmlPullParserException, IOException { 273c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources.parseBundleExtras(parser, outBundle); 274c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 275c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 276c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta @Override 277c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta public void parseBundleExtra(String tagName, AttributeSet attrs, Bundle outBundle) 278c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta throws XmlPullParserException { 279c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta mResources.parseBundleExtra(tagName, attrs, outBundle); 280c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta } 281c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta} 282c5eb03a474fdacad3f50223914fb9a8fbcf93a9bDeepanshu Gupta 283