自定义preference的使用

control_iconsize_preference_top.xml

<?xml version="1.0" encoding="utf-8"?>

<ImageView
    android:id="@android:id/icon"
    android:layout_width="48dp"
    android:layout_height="48dp"
    android:layout_gravity="center"
    android:paddingLeft="16dp"
    />

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="10dp"
    android:layout_marginEnd="18dp"
    android:layout_marginTop="1dp"
    android:layout_marginBottom="1dp"
    android:layout_weight="1">

    <TextView android:id="@android:id/title"
        android:layout_width="wrap_content"
        android:layout_height="34dp"
        android:textSize="17sp"
        android:gravity="center_vertical"
        android:singleLine="true"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:ellipsize="marquee"
        android:fadingEdge="horizontal" />

    <TextView 
        android:id="@android:id/summary"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginStart="5dp"
        android:gravity="end"
        android:maxLines="1"
        android:ellipsize="end"
        android:layout_toEndOf="@android:id/title"
        android:layout_toStartOf="@id/iv_arrow_right"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="?android:attr/textColorSecondary"/>

<ImageView
    android:id="@+id/iv_arrow_right"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_centerVertical="true"
        android:layout_alignParentEnd="true"
        android:src="@drawable/ic_homepage_arrow_right"
        android:paddingLeft="16dp"/>

</RelativeLayout>

<!-- Preference should place its actual preference widget here. -->
<LinearLayout android:id="@android:id/widget_frame"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:gravity="center_vertical"
    android:paddingEnd="16dp"
    android:orientation="vertical" />

control_iconsize_preference_middle.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize"
    android:background="@drawable/card_style_middle" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_gravity="center"
        android:paddingLeft="16dp"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="18dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
        android:layout_weight="1">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

	    <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="5dp"
            android:gravity="end"
            android:maxLines="1"
            android:ellipsize="end"
            android:layout_toEndOf="@android:id/title"
            android:layout_toStartOf="@id/iv_arrow_right"
            android:textAppearance="?android:attr/textAppearanceSmall"
	        android:textColor="?android:attr/textColorSecondary"/>

	    <ImageView
	        android:id="@+id/iv_arrow_right"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_centerVertical="true"
            android:layout_alignParentEnd="true"
            android:src="@drawable/ic_homepage_arrow_right"
            android:paddingLeft="16dp"/>

    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_bottom.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize"
    android:background="@drawable/card_style_bottom" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_gravity="center"
        android:paddingLeft="16dp"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="18dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
        android:layout_weight="1">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="5dp"
            android:gravity="end"
            android:maxLines="1"
            android:ellipsize="end"
            android:layout_toEndOf="@android:id/title"
            android:layout_toStartOf="@id/iv_arrow_right"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"/>

        <ImageView
            android:id="@+id/iv_arrow_right"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_centerVertical="true"
            android:layout_alignParentEnd="true"
            android:src="@drawable/ic_homepage_arrow_right"
            android:paddingLeft="16dp"/>

    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_airplane.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize"
    android:background="@drawable/card_style_top" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_gravity="center"
        android:paddingLeft="16dp"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="6dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
        android:layout_weight="1">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/title"
            android:layout_alignStart="@android:id/title"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:maxLines="4" />

    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_no_arrow_top.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize"
    android:background="@drawable/card_style_top" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="center"
	android:paddingLeft="0dp"
	android:visibility="gone"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="18dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
	android:layout_weight="1"
	android:paddingStart="16dp">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:layout_centerVertical="true"
	    android:layout_marginStart="5dp"
	    android:gravity="end"
	    android:maxLines="1"
            android:ellipsize="end"
	    android:layout_alignParentEnd="true"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"/>

	<com.starkylin.settings.widget.tick.TickView
            android:id="@+id/tick_view"
            android:layout_width="28dp"
            android:layout_height="28dp"
            android:layout_marginStart="5dp"
	    android:layout_alignParentEnd="true"
	    android:layout_centerVertical="true"
            android:visibility="gone"
            app:check_base_color="#00FFB7"
            app:check_tick_color="#00FFB7"
	    app:rate="normal" />

    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_no_arrow_middle.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize"
    android:background="@drawable/card_style_middle" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="center"
	android:paddingLeft="0dp"
	android:visibility="gone"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="18dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
	android:layout_weight="1"
	android:paddingStart="16dp">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:layout_centerVertical="true"
	    android:layout_marginStart="5dp"
	    android:gravity="end"
	    android:maxLines="1"
            android:ellipsize="end"
	    android:layout_alignParentEnd="true"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"/>

	<com.starkylin.settings.widget.tick.TickView
            android:id="@+id/tick_view"
            android:layout_width="28dp"
            android:layout_height="28dp"
            android:layout_marginStart="5dp"
	    android:layout_alignParentEnd="true"
	    android:layout_centerVertical="true"
            android:visibility="gone"
            app:check_base_color="#00FFB7"
            app:check_tick_color="#00FFB7"
            app:rate="normal" />
    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_no_arrow_bottom.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize"
    android:background="@drawable/card_style_bottom" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="center"
	android:paddingLeft="0dp"
	android:visibility="gone"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="18dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
	android:layout_weight="1"
	android:paddingStart="16dp">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:layout_centerVertical="true"
	    android:layout_marginStart="5dp"
	    android:gravity="end"
	    android:maxLines="1"
            android:ellipsize="end"
	    android:layout_alignParentEnd="true"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"/>

	<com.starkylin.settings.widget.tick.TickView
            android:id="@+id/tick_view"
            android:layout_width="28dp"
            android:layout_height="28dp"
            android:layout_marginStart="5dp"
	    android:layout_alignParentEnd="true"
	    android:layout_centerVertical="true"
            android:visibility="gone"
            app:check_base_color="#00FFB7"
            app:check_tick_color="#00FFB7"
            app:rate="normal" />
    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_no_arrow_transparent.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:background="@color/transparent"
    android:paddingEnd="?android:attr/scrollbarSize" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="center"
	android:paddingLeft="0dp"
	android:visibility="gone"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="18dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
	android:layout_weight="1"
	android:paddingStart="16dp">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:layout_centerVertical="true"
	    android:layout_marginStart="5dp"
	    android:gravity="end"
	    android:maxLines="1"
            android:ellipsize="end"
	    android:layout_alignParentEnd="true"
            android:textAppearance="?android:attr/textAppearanceSmall"
	    android:textColor="?android:attr/textColorSecondary"/>

	<com.starkylin.settings.widget.tick.TickView
            android:id="@+id/tick_view"
            android:layout_width="28dp"
	    android:layout_height="28dp"
	    android:layout_marginStart="5dp"
	    android:layout_alignParentEnd="true"
	    android:layout_centerVertical="true"
	    android:visibility="gone"
            app:check_base_color="#00FFB7"
            app:check_tick_color="#00FFB7"
            app:rate="normal" />

    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:paddingEnd="16dp"
        android:orientation="vertical" />

</LinearLayout>

control_iconsize_preference_satellite.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
     Preference is able to place a specific widget for its particular
     type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="58dp"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize">

    <ImageView
        android:id="@+id/icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_gravity="center"
	android:paddingLeft="16dp"
	android:src="@drawable/starkylin_voice_communication"
        />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="16dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
        android:layout_weight="1">

        <TextView android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="34dp"
            android:textSize="17sp"
            android:gravity="center_vertical"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@+id/summary"
            android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:layout_centerVertical="true"
	    android:layout_marginStart="5dp"
	    android:gravity="end"
	    android:maxLines="1"
            android:ellipsize="end"
	    android:layout_toEndOf="@id/title"
	    android:layout_toStartOf="@id/iv_arrow_right"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"/>

	<ImageView
	    android:id="@+id/iv_arrow_right"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_centerVertical="true"
	    android:layout_alignParentEnd="true"
	    android:src="@drawable/ic_homepage_arrow_right"
	    android:paddingLeft="16dp"/>

    </RelativeLayout>

</LinearLayout>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值