1/* 2 * Copyright (C) 2017 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 */ 16package com.android.car.settings.display; 17 18import android.os.Bundle; 19 20import com.android.car.settings.R; 21import com.android.car.settings.common.ListSettingsFragment; 22import com.android.car.settings.common.TypedPagedListAdapter; 23 24import java.util.ArrayList; 25 26/** 27 * Activity to host Display related preferences. 28 */ 29public class DisplaySettingsFragment extends ListSettingsFragment { 30 31 public static DisplaySettingsFragment getInstance() { 32 DisplaySettingsFragment displaySettingsFragment = new DisplaySettingsFragment(); 33 Bundle bundle = ListSettingsFragment.getBundle(); 34 bundle.putInt(EXTRA_TITLE_ID, R.string.display_settings); 35 displaySettingsFragment.setArguments(bundle); 36 return displaySettingsFragment; 37 } 38 39 @Override 40 public ArrayList<TypedPagedListAdapter.LineItem> getLineItems() { 41 ArrayList<TypedPagedListAdapter.LineItem> lineItems = new ArrayList<>(); 42 lineItems.add(new AutoBrightnessLineItem(getContext())); 43 lineItems.add(new BrightnessLineItem(getContext())); 44 return lineItems; 45 } 46} 47