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

Commit c383a48c authored by Jiaming Cheng's avatar Jiaming Cheng
Browse files

[QSDetailedView] Revamp the internet details view UI (part2)

- Implemented the share wifi button.

- Added the on and off background of the details entry. The radius of
this background might need to be adjusted later.

- Set the Ethernet entry's height


Bug:378514300
Flag: com.android.systemui.qs_tile_detailed_view
Change-Id: I08ee726cee456d403f49b0ac3fb6cd089ad3f944
parent 564a067e
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2025 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.
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:color="?android:attr/colorControlHighlight">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@androidprv:color/materialColorPrimaryContainer"/>
            <corners android:radius="@dimen/settingslib_switch_bar_radius"/>
        </shape>
    </item>
</ripple>
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2025 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.
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:color="?android:attr/colorControlHighlight">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@androidprv:color/materialColorPrimary"/>
            <corners android:radius="@dimen/settingslib_switch_bar_radius"/>
        </shape>
    </item>
</ripple>
+33 −17
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
                <LinearLayout
                    android:id="@+id/ethernet_layout"
                    android:baselineAligned="false"
                    android:layout_height="@dimen/internet_details_toggle_row_height"
                    style="@style/InternetDialog.Network"
                    android:background="@drawable/settingslib_switch_bar_bg_on"
                    android:visibility="gone">
@@ -441,29 +442,44 @@
                    android:text="@string/turn_off_airplane_mode"
                    app:layout_constrainedWidth="true"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/share_wifi_button"
                    app:layout_constraintHorizontal_bias="0"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>

                <Button
            <LinearLayout
                android:id="@+id/share_wifi_button"
                    style="?android:attr/buttonBarNeutralButtonStyle"
                style="@style/InternetDialog.Network"
                android:layout_height="@dimen/tile_details_button_row_height"
                android:background="@drawable/settingslib_entry_bg_off"
                android:gravity="center">

                <FrameLayout
                    android:layout_width="@dimen/tile_details_button_size"
                    android:layout_height="@dimen/tile_details_button_size"
                    android:clickable="false">

                    <ImageView
                        android:contentDescription="@string/share_wifi_button_text"
                        android:src="@drawable/ic_screenshot_share"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                    android:layout_marginEnd="10dp"
                    android:clickable="true"
                    android:ellipsize="end"
                    android:focusable="true"
                    android:maxLines="1"
                        android:tint="@androidprv:color/materialColorOnSurface" />
                </FrameLayout>

                <FrameLayout
                    android:clickable="false"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/internet_dialog_network_layout_margin">

                    <TextView
                        android:text="@string/share_wifi_button_text"
                    android:visibility="gone"
                    app:layout_constrainedWidth="true"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintHorizontal_bias="0"
                    app:layout_constraintStart_toEndOf="@id/apm_button"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="@style/TextAppearance.TileDetailsEntryTitle" />
                </FrameLayout>
            </LinearLayout>

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
+2 −0
Original line number Diff line number Diff line
@@ -2249,6 +2249,8 @@
    <dimen name="internet_details_toggle_row_height">48dp</dimen>
    <dimen name="tile_details_switch_container_width">52dp</dimen>
    <dimen name="tile_details_switch_track_height">24dp</dimen>
    <dimen name="tile_details_button_row_height">40dp</dimen>
    <dimen name="tile_details_button_size">20dp</dimen>
    <!-- Tile Details end -->

</resources>
+1 −2
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.widget.Button
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.ProgressBar
import android.widget.Switch
import android.widget.TextView
import androidx.annotation.MainThread
import androidx.annotation.WorkerThread
@@ -118,7 +117,7 @@ constructor(
    private lateinit var airplaneModeSummaryTextView: TextView
    private lateinit var mobileDataToggle: MaterialSwitch
    private lateinit var wifiToggle: MaterialSwitch
    private lateinit var shareWifiButton: Button
    private lateinit var shareWifiButton: LinearLayout
    private lateinit var airplaneModeButton: Button
    private var alertDialog: AlertDialog? = null
    private var canChangeWifiState = false
Loading