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

Commit a7a7bfe5 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Use DimmableIconPreference for Add user action

Moved DimmableIconPreference from location to the root package since it is
now used in several places.

Add user action now uses DimmableIconPreference. Added a new summary string,
which is displayed when no more users can be added.

Bug: 20892920
Change-Id: I00b00f80ba8933a00a2de85777b9f7e55d03c31b
parent c80084e5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5425,6 +5425,8 @@
    <string name="user_nickname">Nickname</string>
    <!-- Title for add user type dialog [CHAR LIMIT=45] -->
    <string name="user_add_user_type_title">Add</string>
    <!-- Summary for add user action, when it's disabled [CHAR LIMIT=100] -->
    <string name="user_add_max_count">You can add up to <xliff:g id="user_count">%1$d</xliff:g> users</string>
    <!-- Summary for add user entry in the choice dialog [CHAR LIMIT=none] -->
    <string name="user_add_user_item_summary">Users have their own apps and content</string>
    <!-- Summary for add restricted profile entry in the choice dialog [CHAR LIMIT=none] -->
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
            android:title="@string/user_list_title">
    </PreferenceCategory>

    <Preference
    <com.android.settings.DimmableIconPreference
            android:key="user_add"
            android:title="@string/user_add_user_or_profile_menu"
            android:icon="@drawable/ic_menu_add_dark" />
+3 −10
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.settings.location;
package com.android.settings;

import android.annotation.Nullable;
import android.content.Context;
@@ -35,16 +35,9 @@ public class DimmableIconPreference extends Preference {

    private final CharSequence mContentDescription;

    public DimmableIconPreference(Context context, AttributeSet attrs, int defStyle,
            @Nullable CharSequence contentDescription) {
        super(context, attrs, defStyle);
        mContentDescription = contentDescription;
    }

    public DimmableIconPreference(Context context, AttributeSet attrs,
            @Nullable CharSequence contentDescription) {
    public DimmableIconPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContentDescription = contentDescription;
        mContentDescription = null;
    }

    public DimmableIconPreference(Context context, @Nullable CharSequence contentDescription) {
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.preference.Preference;
import android.util.Log;

import com.android.settings.DimmableIconPreference;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.applications.InstalledAppDetails;
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;

import com.android.settings.DimmableIconPreference;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

Loading