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

Commit 6ffe4e0e authored by Tony Mak's avatar Tony Mak
Browse files

Add work profile footer in work tab

Screenshot(work mode is on): https://hsv.googleplex.com/6279751685636096
Screenshot (work mode is off): https://hsv.googleplex.com/6279751685636096

TODO:
It is just the UX bit, once the platform change is in, we should then
consume the new API to
1. Turn on / off work mode
2. Get the organization name and set the textview accordingly.

BUG=69905244

Change-Id: Id94ae57625d6b629dac89c1c28f8d65f395fff6c
parent 0c2d9b0f
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <path
        android:pathData="M20,6h-4V4c0,-1.11 -0.89,-2 -2,-2h-4C8.89,2 8,2.89 8,4v2H4C2.89,6 2.01,6.89 2.01,8L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2V8C22,6.89 21.11,6 20,6zM12,15c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2s2,0.9 2,2S13.1,15 12,15zM14,6h-4V4h4V6z"
        android:fillColor="?android:attr/textColorHint"/>
</vector>
 No newline at end of file
+72 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:paddingBottom="@dimen/all_apps_work_profile_tab_footer_bottom_padding"
      android:paddingLeft="@dimen/dynamic_grid_cell_padding_x"
      android:paddingRight="@dimen/dynamic_grid_cell_padding_x"
      android:paddingTop="@dimen/all_apps_work_profile_tab_footer_top_padding">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <Switch
            android:id="@+id/work_mode_toggle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:theme="@style/WorkModeSwitchTheme"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@id/work_mode_toggle"
            android:layout_alignParentLeft="true"
            android:ellipsize="end"
            android:fontFamily="roboto-regular"
            android:lines="1"
            android:text="@string/work_profile_toggle_label"
            android:textColor="?android:attr/textColorTertiary"
            android:textSize="16sp"/>

    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingTop="8dp">

        <ImageView
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:src="@drawable/ic_corp"/>

        <TextView
            android:id="@+id/managed_by_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:ellipsize="end"
            android:lines="1"
            android:paddingLeft="12dp"
            android:textColor="?android:attr/textColorHint"
            android:textSize="13sp"/>
    </LinearLayout>
</LinearLayout>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -40,4 +40,6 @@

    <color name="all_apps_bg_hand_fill">#E5E5E5</color>
    <color name="all_apps_bg_hand_fill_dark">#9AA0A6</color>

    <color name="work_profile_color">#FF6D00</color>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@
    <dimen name="all_apps_tabs_indicator_height">2dp</dimen>
    <dimen name="all_apps_header_top_padding">36dp</dimen>
    <dimen name="all_apps_prediction_row_divider_height">17dp</dimen>
    <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen>
    <dimen name="all_apps_work_profile_tab_footer_bottom_padding">20dp</dimen>

<!-- Search bar in All Apps -->
    <dimen name="all_apps_header_max_elevation">3dp</dimen>
+3 −0
Original line number Diff line number Diff line
@@ -324,4 +324,7 @@
    <!-- Label of tab to indicate work apps -->
    <string name="all_apps_work_tab">Work</string>

    <!-- Label of the work mode toggle -->
    <string name="work_profile_toggle_label">Work profile</string>

</resources>
Loading