1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.settings.dashboard; 18 19 import android.content.Context; 20 import android.support.v7.preference.Preference; 21 import android.support.v7.preference.PreferenceViewHolder; 22 import android.util.AttributeSet; 23 24 import com.android.settings.R; 25 26 public class ExpandPreference extends Preference { 27 28 public ExpandPreference(Context context, AttributeSet attrs, 29 int defStyleAttr, int defStyleRes) { 30 super(context, attrs, defStyleAttr, defStyleRes); 31 init(); 32 } 33 34 public ExpandPreference(Context context, AttributeSet attrs, int defStyleAttr) { 35 super(context, attrs, defStyleAttr); 36 init(); 37 } 38 39 public ExpandPreference(Context context, AttributeSet attrs) { 40 super(context, attrs); 41 init(); 42 } 43 44 public ExpandPreference(Context context) { 45 super(context); 46 init(); 47 } 48 49 private void init() { 50 setLayoutResource(R.layout.expand_preference); 51 setIcon(R.drawable.ic_arrow_down_24dp); 52 setTitle(R.string.advanced_section_header); 53 setOrder(999); 54 } 55 56 @Override 57 public void onBindViewHolder(PreferenceViewHolder holder) { 58 super.onBindViewHolder(holder); 59 holder.setDividerAllowedAbove(false); 60 } 61 } 62