summaryrefslogtreecommitdiff
path: root/Host/app/apphost/src/main/java/com/android/car/libraries/apphost/view/widget/map/AbstractMapViewContainer.java
diff options
context:
space:
mode:
Diffstat (limited to 'Host/app/apphost/src/main/java/com/android/car/libraries/apphost/view/widget/map/AbstractMapViewContainer.java')
-rw-r--r--Host/app/apphost/src/main/java/com/android/car/libraries/apphost/view/widget/map/AbstractMapViewContainer.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/Host/app/apphost/src/main/java/com/android/car/libraries/apphost/view/widget/map/AbstractMapViewContainer.java b/Host/app/apphost/src/main/java/com/android/car/libraries/apphost/view/widget/map/AbstractMapViewContainer.java
new file mode 100644
index 0000000..9220a2e
--- /dev/null
+++ b/Host/app/apphost/src/main/java/com/android/car/libraries/apphost/view/widget/map/AbstractMapViewContainer.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2021 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.car.libraries.apphost.view.widget.map;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.FrameLayout;
+import androidx.lifecycle.DefaultLifecycleObserver;
+import androidx.lifecycle.LifecycleOwner;
+import com.android.car.libraries.apphost.common.MapViewContainer;
+import com.android.car.libraries.apphost.common.TemplateContext;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/** A layout that wraps a single map view */
+public abstract class AbstractMapViewContainer extends FrameLayout
+ implements LifecycleOwner, DefaultLifecycleObserver, MapViewContainer {
+
+ /** Returns an {@link AbstractMapViewContainer} instance. */
+ public AbstractMapViewContainer(
+ Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ }
+
+ /** Returns an {@link AbstractMapViewContainer} instance. */
+ public AbstractMapViewContainer(Context context) {
+ this(context, null, 0, 0);
+ }
+
+ /**
+ * Sets the {@link TemplateContext} to provide hosts and presenters.
+ *
+ * @param templateContext TemplateContext
+ */
+ public abstract void setTemplateContext(TemplateContext templateContext);
+}