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

Commit 6fa669f8 authored by harinirajan's avatar harinirajan Committed by Harini Rajan
Browse files

Remove unused resources and create wear credential theme using overlays

Bug: 323607982
Test: Manual. See go/credential-selector-ui
Change-Id: If1c677cd6106b78a58b989bb7e8df3eb925d6561
parent f26f87f1
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:pathData="M23,10.5H17V13.5H23V10.5Z"
        android:fillColor="#188038"/>
    <path
        android:pathData="M6.5,17.5C3.5,17.5 1,15 1,12C1,9 3.5,6.5 6.5,6.5C9.5,6.5 12,9 12,12C12,15 9.5,17.5 6.5,17.5ZM6.5,9.5C5.1,9.5 4,10.6 4,12C4,13.4 5.1,14.5 6.5,14.5C7.9,14.5 9,13.4 9,12C9,10.6 7.9,9.5 6.5,9.5Z"
        android:fillColor="#4285F4"/>
    <path
        android:pathData="M21,13.5H19H17V16.5H19V15.5C19,14.9 19.4,14.5 20,14.5C20.6,14.5 21,14.9 21,15.5V16.5H23V13.5H21Z"
        android:fillColor="#34A853"/>
    <path
        android:pathData="M11.8,10.5H8.5C8.8,10.9 9,11.4 9,12C9,12.6 8.8,13.1 8.5,13.5H11.8C11.9,13 12,12.5 12,12C12,11.5 11.9,11 11.8,10.5Z"
        android:fillColor="#EA4335"/>
    <path
        android:pathData="M17,10.5H11.8C11.9,11 12,11.5 12,12C12,12.5 11.9,13 11.8,13.5H17V10.5Z"
        android:fillColor="#FBBC04"/>
</vector>
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2024 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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- font-family-device-default is expected to be preloaded in the font_customization.xml(/vendor/<OEM>/products/<PRODUCT>/fonts/fonts_customization.xml)-->
    <!-- Falls back to system default when font-family-device-default doesn't exist    -->
    <string name="wear_material_compose_display_1_font_family">font-family-device-default</string>
    <string name="wear_material_compose_display_2_font_family">font-family-device-default</string>
    <string name="wear_material_compose_display_3_font_family">font-family-device-default</string>
    <string name="wear_material_compose_title_1_font_family">font-family-medium-device-default</string>
    <string name="wear_material_compose_title_2_font_family">font-family-medium-device-default</string>
    <string name="wear_material_compose_title_3_font_family">font-family-device-default</string>
    <string name="wear_material_compose_body_1_font_family">font-family-text-device-default</string>
    <string name="wear_material_compose_body_2_font_family">font-family-text-device-default</string>
    <string name="wear_material_compose_button_font_family">font-family-text-medium-device-default</string>
    <string name="wear_material_compose_caption_1_font_family">font-family-text-medium-device-default</string>
    <string name="wear_material_compose_caption_2_font_family">font-family-text-medium-device-default</string>
    <string name="wear_material_compose_caption_3_font_family">font-family-text-medium-device-default</string>
</resources>
+0 −21
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 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.
  -->

<resources>
    <color name="wear_material_almond">#FFFCF7EB</color>
    <color name="wear_material_almond_dark">#FF262523</color>
</resources>
 No newline at end of file
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->

<resources>
    <overlayable name="CredentialSelectorStyles">
        <policy type="product|system|vendor|odm|oem">
            <!--START WEAR SPECIFIC FONT STRINGS -->
            <item type="string" name="wear_material_compose_display_1_font_family" />
            <item type="string" name="wear_material_compose_display_2_font_family" />
            <item type="string" name="wear_material_compose_display_3_font_family" />
            <item type="string" name="wear_material_compose_title_1_font_family" />
            <item type="string" name="wear_material_compose_title_2_font_family" />
            <item type="string" name="wear_material_compose_title_3_font_family" />
            <item type="string" name="wear_material_compose_body_1_font_family" />
            <item type="string" name="wear_material_compose_body_2_font_family" />
            <item type="string" name="wear_material_compose_button_font_family" />
            <item type="string" name="wear_material_compose_caption_1_font_family" />
            <item type="string" name="wear_material_compose_caption_2_font_family" />
            <item type="string" name="wear_material_compose_caption_3_font_family" />
            <!--END WEAR SPECIFIC FONT STRINGS -->

        </policy>

    </overlayable>

</resources>
+2 −6
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import androidx.core.graphics.drawable.toBitmap
import androidx.wear.compose.material.ChipColors
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.wear.compose.material.ChipDefaults
import com.android.credentialmanager.R
@@ -80,8 +79,7 @@ fun CredentialsScreenChip(
    icon: Drawable? = null,
    isAuthenticationEntryLocked: Boolean = false,
    modifier: Modifier = Modifier,
    colors: ChipColors =
        ChipDefaults.chipColors(backgroundColor = colorResource(R.color.wear_material_almond)),
    colors: ChipColors = ChipDefaults.primaryChipColors(),
    ) {
    val labelParam: (@Composable RowScope.() -> Unit) =
        {
@@ -168,11 +166,9 @@ fun ContinueChip(onClick: () -> Unit) {
            WearButtonText(
                text = stringResource(R.string.dialog_continue_button),
                textAlign = TextAlign.Center,
                color = colorResource(R.color.wear_material_almond_dark),
            )
        },
        colors =
        ChipDefaults.chipColors(backgroundColor = colorResource(R.color.wear_material_almond)),
        colors = ChipDefaults.primaryChipColors(),
    )
}

Loading