Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd6465e9 authored by Lyn Han's avatar Lyn Han
Browse files

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
parent 5bac3f05
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"
+20 −0
Original line number Diff line number Diff line
<!--
  ~ 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"/>
+1 −0
Original line number Diff line number Diff line
@@ -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>
+69 −0
Original line number Diff line number Diff line
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();
    }
}