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

Commit bf3391f1 authored by Svetoslav's avatar Svetoslav
Browse files

Adding UI for editing the name and the picture of a limited user.

A limited user may not have access to contacts, thus the settings
app has to be able to show UI for selecting a user photo from
gallery or via camera.

bug:8566861

Change-Id: I1974b1a19b0fee8c737d1345302e1b2fba108379
parent fce45015
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
<!--
     Copyright (C) 2013 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="wrap_content"
    android:layout_height="wrap_content"
    android:baselineAligned="false"
    android:padding="16dip">

    <ImageView
        android:id="@+id/user_photo"
        android:layout_width="56dip"
        android:layout_height="56dip"
        android:layout_gravity="bottom"
        android:layout_marginEnd="6dp"
        android:contentDescription="@null"
        android:background="@*android:drawable/spinner_background_holo_dark"
        android:scaleType="fitCenter"/>

    <EditText
        android:id="@+id/user_name"
        android:layout_width="0dip"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:layout_weight="1"
        android:layout_marginStart="6dp"
        android:ellipsize="end"
        android:singleLine="true"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textAlignment="viewStart"
        android:labelFor="@id/user_photo"
        android:inputType="text|textCapWords"
        android:selectAllOnFocus="true"
        android:hint="@string/user_nickname"/>

</LinearLayout>
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2013, 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.
*/
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    android:textColor="?android:attr/textColorAlertDialogListItem"
    android:gravity="center_vertical"
    android:paddingStart="16dip"
    android:paddingEnd="16dip"
    android:ellipsize="marquee"
/>
+4 −0
Original line number Diff line number Diff line
@@ -65,4 +65,8 @@
    <dimen name="circle_avatar_size">48dp</dimen>
    <dimen name="circle_avatar_frame_stroke_width">1dp</dimen>
    <dimen name="circle_avatar_frame_shadow_radius">3dp</dimen>

    <!-- Minimum width for the popup for updating a user's photo. -->
    <dimen name="update_user_photo_popup_min_width">300dip</dimen>

</resources>
+7 −1
Original line number Diff line number Diff line
@@ -4498,4 +4498,10 @@
    <string name="wizard_next">Next</string>
    <!-- Wizard next button label [CHAR LIMIT=25] -->
    <string name="wizard_finish">Finish</string>

    <!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
    <string name="user_image_take_photo" msgid="7496128293167402354">Take photo</string>
    <!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
    <string name="user_image_choose_photo" msgid="3746334626214970837">Choose photo from Gallery</string>

</resources>
+3 −4
Original line number Diff line number Diff line
@@ -18,9 +18,8 @@
        android:title="@string/application_restrictions"
        xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">

    <com.android.settings.SelectableEditTextPreference
    <Preference
        android:key="user_info"
            android:order="0"
            android:widgetLayout="@layout/preference_rename_widget" />
        android:order="0"/>

</PreferenceScreen>
Loading