diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-10 23:27:31 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-10 23:27:31 +0000 |
commit | 3e98abd1a11c903340496b6563a21fd9ca921411 (patch) | |
tree | 7b31dcd02a359b27f32a7476c3ed94bd262f6d82 /java/com/android/dialer/speeddial/loader/UiItemLoaderComponent.java | |
parent | 2bdb59f0392e54be3dc2c57c32ce126e1e4af7cf (diff) | |
parent | 2bee0528c1f42b698a606f24da4fa652ceb8d322 (diff) |
Merge "Wire up SpeedDial fragment with SpeedDialUiItemLoader."
Diffstat (limited to 'java/com/android/dialer/speeddial/loader/UiItemLoaderComponent.java')
-rw-r--r-- | java/com/android/dialer/speeddial/loader/UiItemLoaderComponent.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/java/com/android/dialer/speeddial/loader/UiItemLoaderComponent.java b/java/com/android/dialer/speeddial/loader/UiItemLoaderComponent.java new file mode 100644 index 000000000..7d01b4380 --- /dev/null +++ b/java/com/android/dialer/speeddial/loader/UiItemLoaderComponent.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.speeddial.loader; + +import android.content.Context; +import com.android.dialer.inject.HasRootComponent; +import dagger.Subcomponent; + +/** Dagger component for the speeddial/loader package. */ +@Subcomponent +public abstract class UiItemLoaderComponent { + + public abstract SpeedDialUiItemLoader speedDialUiItemLoader(); + + public static UiItemLoaderComponent get(Context context) { + return ((UiItemLoaderComponent.HasComponent) + ((HasRootComponent) context.getApplicationContext()).component()) + .uiItemLoaderComponent(); + } + + /** Used to refer to the root application component. */ + public interface HasComponent { + UiItemLoaderComponent uiItemLoaderComponent(); + } +} |