Bonjour,

afin d'obtenir un résultat similaire à PreferenceFragment, je cherche à comprendre comment sont gérés les dividers afin d'avoir un divider plus large sous une catégorie que sous un préférence standard. Je pensais qu'ils aveient intégré une View dans les layouts mais ça n'est pas le cas, par exemple dans preference_category_holo.xml :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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 used for PreferenceCategory in a PreferenceActivity. -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    style="?android:attr/listSeparatorTextViewStyle"
    android:id="@+android:id/title"
    android:paddingStart="@dimen/preference_item_padding_side"
    android:paddingEnd="@dimen/preference_item_padding_side" />
J'ai ensuite un peu fouiller le source code du package android.preference et notamment la class PreferenceGroupAdapter mais ça n'a pas donné grand chose.

Je serais très intéressé de savoir comment ils ont fait si quelqu'un a des info.

Merci d'avance pour toute aide.