OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.ui.resources.statics; |
| 6 |
| 7 import android.content.res.Resources; |
| 8 |
| 9 import org.chromium.ui.resources.Resource; |
| 10 import org.chromium.ui.resources.async.AsyncPreloadResourceLoader; |
| 11 |
| 12 /** |
| 13 * Handles loading Android resources from disk asynchronously and synchronously. |
| 14 */ |
| 15 public class StaticResourceLoader extends AsyncPreloadResourceLoader { |
| 16 /** |
| 17 * Creates a {@link StaticResourceLoader}. |
| 18 * @param resourceType The resource type this loader is responsible for load
ing. |
| 19 * @param callback The {@link ResourceLoaderCallback} to notify when a {
@link Resource} is |
| 20 * done loading. |
| 21 * @param resources The {@link Resources} instance to load Android resour
ces from. |
| 22 */ |
| 23 public StaticResourceLoader(int resourceType, ResourceLoaderCallback callbac
k, |
| 24 final Resources resources) { |
| 25 super(resourceType, callback, new ResourceCreator() { |
| 26 @Override |
| 27 public Resource create(int resId) { |
| 28 return StaticResource.create(resources, resId, 0, 0); |
| 29 } |
| 30 }); |
| 31 } |
| 32 } |
OLD | NEW |