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

Commit 13f3ffed authored by Andy Wickham's avatar Andy Wickham Committed by Tony Wickham
Browse files

Adds initial Taskbar Edu implementation.

Currently it just pops up with one placeholder image for splitscreen.
The Next button doesn't do anything.

Screenshots:
Light: https://screenshot.googleplex.com/B27CwBcwobHTghN.png
Dark: https://screenshot.googleplex.com/48EuJZv8evd5RGW.png

Known issues:
 - Back gesture is picked up behind by the app behind the taskbar.
 - When the flag is enabled, the Edu shows up each time you open
   an app, rather than only the first time.

Bug: 180605356
Test: Manual
Change-Id: Ifba9aa59abf1501b5f8ddebb3fcc13df85f6efaa
parent 40f86763
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->

<inset
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <ripple
        android:color="?android:attr/colorControlHighlight">
        <item>
            <shape android:shape="rectangle">
                <corners android:radius="16dp"  />
                <solid android:color="?androidprv:attr/colorSurface"/>
                <stroke
                    android:width="1dp"
                    android:color="?androidprv:attr/colorAccentPrimaryVariant"/>
            </shape>
        </item>
    </ripple>
</inset>
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->

<inset
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <ripple
        android:color="?android:attr/colorControlHighlight">
        <item>
            <shape android:shape="rectangle">
                <corners android:radius="16dp"/>
                <solid android:color="?androidprv:attr/colorAccentPrimary"/>
            </shape>
        </item>
    </ripple>
</inset>
 No newline at end of file
+24.5 KiB
Loading image diff...
+82 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->

<com.android.launcher3.taskbar.TaskbarEduView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:gravity="bottom"
    android:orientation="vertical"
    android:layout_marginHorizontal="108dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/edu_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/bg_rounded_corner_bottom_sheet"
        android:gravity="center_horizontal"
        android:paddingHorizontal="36dp"
        android:paddingTop="64dp">

        <TextView
            android:id="@+id/edu_header"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            app:layout_constraintTop_toTopOf="parent"
            android:gravity="center_horizontal"
            style="@style/TextHeadline"
            android:text="@string/taskbar_edu_header_1"
            android:fontFamily="google-sans"
            android:textColor="?android:attr/textColorPrimary"
            android:textSize="24sp"
            android:maxLines="2"/>

        <ImageView
            android:id="@+id/edu_illustration"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            app:layout_constraintTop_toBottomOf="@id/edu_header"
            android:src="@drawable/taskbar_edu_splitscreen"/>

        <Button
            android:id="@+id/edu_close_button"
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:layout_marginBottom="92dp"
            app:layout_constraintTop_toBottomOf="@id/edu_illustration"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:text="@string/taskbar_edu_close"
            style="@style/TaskbarEdu.Button.Close"
            android:textColor="?android:attr/textColorPrimary"/>

        <Button
            android:id="@+id/edu_next_button"
            android:layout_width="wrap_content"
            android:layout_height="36dp"
            android:layout_marginBottom="92dp"
            app:layout_constraintTop_toBottomOf="@id/edu_illustration"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            android:text="@string/taskbar_edu_next"
            style="@style/TaskbarEdu.Button.Next"
            android:textColor="?androidprv:attr/textColorOnAccent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
</com.android.launcher3.taskbar.TaskbarEduView>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -165,4 +165,5 @@
    <dimen name="taskbar_stashed_size">24dp</dimen>
    <dimen name="taskbar_stashed_handle_width">220dp</dimen>
    <dimen name="taskbar_stashed_handle_height">6dp</dimen>
    <dimen name="taskbar_edu_bg_corner_radius">28dp</dimen>
</resources>
Loading