Overflow activity scaffold, xml, manifest, style

Bug: 138116789
Test: manual - overflow compiles and works as expected in separate xl cl
Test: atest SystemUITests
Change-Id: I7142527442c01dca87c88fd6034af184df6f93d6
This commit is contained in:
Lyn Han
2019-12-09 15:14:17 -08:00
parent 5bac3f0568
commit cd6465e921
4 changed files with 98 additions and 0 deletions

View File

@@ -325,6 +325,14 @@
android:permission="android.permission.BIND_WALLPAPER"
android:exported="true" />
<activity
android:name=".bubbles.BubbleOverflowActivity"
android:theme="@style/BubbleOverflow"
android:excludeFromRecents="true"
android:documentLaunchMode="always"
android:resizeableActivity="true">
</activity>
<activity android:name=".tuner.TunerActivity"
android:enabled="false"
android:icon="@drawable/tuner"

View File

@@ -0,0 +1,20 @@
<!--
~ Copyright (C) 2019 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
-->
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bubble_overflow_recycler"
android:scrollbars="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>

View File

@@ -15,6 +15,7 @@
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="BubbleOverflow" parent="@android:style/Theme.NoTitleBar"></style>
<style name="ClearAllButtonDefaultMargins">
<item name="android:layout_marginStart">0dp</item>

View File

@@ -0,0 +1,69 @@
package com.android.systemui.bubbles;
import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.systemui.R;
/**
* Activity for showing aged out bubbles.
* Must be public to be accessible to androidx...AppComponentFactory
*/
public class BubbleOverflowActivity extends Activity {
private RecyclerView mRecyclerView;
private int mMaxBubbles;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bubble_overflow_activity);
setBackgroundColor();
mMaxBubbles = getResources().getInteger(R.integer.bubbles_max_rendered);
mRecyclerView = findViewById(R.id.bubble_overflow_recycler);
mRecyclerView.setLayoutManager(
new GridLayoutManager(getApplicationContext(), /* numberOfColumns */ mMaxBubbles));
}
void setBackgroundColor() {
final TypedArray ta = getApplicationContext().obtainStyledAttributes(
new int[] {android.R.attr.colorBackgroundFloating});
int bgColor = ta.getColor(0, Color.WHITE);
ta.recycle();
findViewById(android.R.id.content).setBackgroundColor(bgColor);
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onRestart() {
super.onRestart();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
super.onPause();
}
@Override
public void onStop() {
super.onStop();
}
public void onDestroy() {
super.onStop();
}
}