Files
Lawnchair/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarSearchSessionController.kt
T
Brian Isganitis d478b1464e Support zero-state suggestions in Taskbar All Apps.
Test: manual
Bug: 216683257
Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR
Change-Id: I016d4e4e6a096ca4f5bd65fcda1bf24a444459f4
2023-06-12 17:19:16 +00:00

56 lines
1.9 KiB
Kotlin

/*
* Copyright (C) 2023 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.launcher3.taskbar.allapps
import android.content.Context
import com.android.launcher3.R
import com.android.launcher3.config.FeatureFlags
import com.android.launcher3.model.data.ItemInfo
import com.android.launcher3.util.ResourceBasedOverride
import com.android.launcher3.util.ResourceBasedOverride.Overrides
/** Stub for managing the Taskbar search session. */
open class TaskbarSearchSessionController : ResourceBasedOverride {
/** Start the search session lifecycle. */
open fun startLifecycle() {}
/** Destroy the search session. */
open fun onDestroy() {}
/** Updates the predicted items shown in the zero-state. */
open fun setZeroStatePredictedItems(items: List<ItemInfo>) {}
/** Updates the search suggestions shown in the zero-state. */
open fun setZeroStateSearchSuggestions(items: List<ItemInfo>) {}
companion object {
@JvmStatic
fun newInstance(context: Context): TaskbarSearchSessionController {
if (!FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) {
return TaskbarSearchSessionController()
}
return Overrides.getObject(
TaskbarSearchSessionController::class.java,
context,
R.string.taskbar_search_session_controller_class,
)
}
}
}