forked from LineageOS/android_frameworks_base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] SystemUI: More smartspace changes
Change-Id: Ie94d458d6150303829140b1d571d9f5140f30013
- Loading branch information
Showing
14 changed files
with
470 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version='1.0' encoding='utf-8' ?> | ||
<com.google.android.systemui.smartspace.WeatherSmartspaceView | ||
android:id="@+id/weather_smartspace_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<com.google.android.systemui.smartspace.DoubleShadowTextView | ||
android:id="@+id/weather_text_view" | ||
android:textColor="?android:attr/textColorPrimary" | ||
android:focusable="true" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="@dimen/enhanced_smartspace_base_action_icon_margin" | ||
style="@style/DateWeatherText" /> | ||
|
||
</com.google.android.systemui.smartspace.WeatherSmartspaceView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright (C) 2010 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. | ||
--> | ||
|
||
<resources> | ||
<declare-styleable name="WeatherSmartspaceView"> | ||
</declare-styleable> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...rtspace/src/com/google/android/systemui/smartspace/DefaultBcSmartspaceConfigProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.google.android.systemui.smartspace; | ||
|
||
import com.android.systemui.plugins.BcSmartspaceConfigPlugin; | ||
|
||
public final class DefaultBcSmartspaceConfigProvider implements BcSmartspaceConfigPlugin { | ||
@Override // com.android.systemui.plugins.BcSmartspaceConfigPlugin | ||
public final boolean isDefaultDateWeatherDisabled() { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...csmartspace/src/com/google/android/systemui/smartspace/WeatherSmartspaceDataProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.google.android.systemui.smartspace; | ||
|
||
import android.app.smartspace.SmartspaceTarget; | ||
import android.app.smartspace.SmartspaceTargetEvent; | ||
import android.os.Debug; | ||
import android.util.Log; | ||
import android.view.LayoutInflater; | ||
import android.view.ViewGroup; | ||
import com.android.systemui.plugins.BcSmartspaceDataPlugin; | ||
import java.util.ArrayList; | ||
import java.util.HashSet; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.function.Consumer; | ||
|
||
/* compiled from: go/retraceme 8fa908dd7f7cdf82919b81f8a849d2e4d6278999a179aaed94e232ba94c0a60d */ | ||
/* loaded from: /Users/aksrivas/Downloads/SystemUIGoogle_decompile_xml/.cache/classes2.dex */ | ||
public final class WeatherSmartspaceDataProvider implements BcSmartspaceDataPlugin { | ||
public static final boolean DEBUG = Log.isLoggable("WeatherSSDataProvider", 3); | ||
public final Set mSmartspaceTargetListeners = new HashSet(); | ||
public final List mSmartspaceTargets = new ArrayList(); | ||
public BcSmartspaceDataPlugin.SmartspaceEventNotifier mEventNotifier = null; | ||
|
||
@Override // com.android.systemui.plugins.BcSmartspaceDataPlugin | ||
public final BcSmartspaceDataPlugin.SmartspaceView getView(ViewGroup viewGroup) { | ||
return (BcSmartspaceDataPlugin.SmartspaceView) LayoutInflater.from(viewGroup.getContext()).inflate(2131559195, viewGroup, false); | ||
} | ||
|
||
@Override // com.android.systemui.plugins.BcSmartspaceDataPlugin | ||
public final void notifySmartspaceEvent(SmartspaceTargetEvent smartspaceTargetEvent) { | ||
BcSmartspaceDataPlugin.SmartspaceEventNotifier smartspaceEventNotifier = this.mEventNotifier; | ||
if (smartspaceEventNotifier != null) { | ||
smartspaceEventNotifier.notifySmartspaceEvent(smartspaceTargetEvent); | ||
} | ||
} | ||
|
||
@Override // com.android.systemui.plugins.BcSmartspaceDataPlugin | ||
public final void onTargetsAvailable(List list) { | ||
if (DEBUG) { | ||
Log.d("WeatherSSDataProvider", this + " onTargetsAvailable called. Callers = " + Debug.getCallers(3)); | ||
StringBuilder sb = new StringBuilder(" targets.size() = "); | ||
sb.append(list.size()); | ||
Log.d("WeatherSSDataProvider", sb.toString()); | ||
Log.d("WeatherSSDataProvider", " targets = " + list.toString()); | ||
} | ||
List list2 = this.mSmartspaceTargets; | ||
((ArrayList) list2).clear(); | ||
Iterator it = list.iterator(); | ||
while (it.hasNext()) { | ||
SmartspaceTarget smartspaceTarget = (SmartspaceTarget) it.next(); | ||
if (smartspaceTarget.getFeatureType() == 1) { | ||
((ArrayList) list2).add(smartspaceTarget); | ||
} | ||
} | ||
this.mSmartspaceTargetListeners.forEach(new Consumer() { // from class: com.google.android.systemui.smartspace.WeatherSmartspaceDataProvider$$ExternalSyntheticLambda0 | ||
@Override // java.util.function.Consumer | ||
public final void accept(Object obj) { | ||
((BcSmartspaceDataPlugin.SmartspaceTargetListener) obj).onSmartspaceTargetsUpdated(WeatherSmartspaceDataProvider.this.mSmartspaceTargets); | ||
} | ||
}); | ||
} | ||
|
||
@Override // com.android.systemui.plugins.BcSmartspaceDataPlugin | ||
public final void registerListener(BcSmartspaceDataPlugin.SmartspaceTargetListener smartspaceTargetListener) { | ||
((HashSet) this.mSmartspaceTargetListeners).add(smartspaceTargetListener); | ||
smartspaceTargetListener.onSmartspaceTargetsUpdated(this.mSmartspaceTargets); | ||
} | ||
|
||
@Override // com.android.systemui.plugins.BcSmartspaceDataPlugin | ||
public final void registerSmartspaceEventNotifier(BcSmartspaceDataPlugin.SmartspaceEventNotifier smartspaceEventNotifier) { | ||
this.mEventNotifier = smartspaceEventNotifier; | ||
} | ||
|
||
@Override // com.android.systemui.plugins.BcSmartspaceDataPlugin | ||
public final void unregisterListener(BcSmartspaceDataPlugin.SmartspaceTargetListener smartspaceTargetListener) { | ||
((HashSet) this.mSmartspaceTargetListeners).remove(smartspaceTargetListener); | ||
} | ||
} |
Oops, something went wrong.