1 /* 2 * Copyright (C) 2015 Samsung System LSI 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package com.android.bluetooth.map; 17 18 import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; 19 20 import android.app.Activity; 21 import android.os.Bundle; 22 import android.widget.ExpandableListView; 23 24 import com.android.bluetooth.R; 25 26 import java.util.ArrayList; 27 import java.util.LinkedHashMap; 28 29 30 public class BluetoothMapSettings extends Activity { 31 32 private static final String TAG = "BluetoothMapSettings"; 33 private static final boolean D = BluetoothMapService.DEBUG; 34 private static final boolean V = BluetoothMapService.VERBOSE; 35 36 37 BluetoothMapAccountLoader mLoader = new BluetoothMapAccountLoader(this); 38 LinkedHashMap<BluetoothMapAccountItem, ArrayList<BluetoothMapAccountItem>> mGroups; 39 40 @Override onCreate(Bundle savedInstanceState)41 protected void onCreate(Bundle savedInstanceState) { 42 super.onCreate(savedInstanceState); 43 getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); 44 /* set UI */ 45 setContentView(R.layout.bluetooth_map_settings); 46 /* create structure for list of groups + items*/ 47 mGroups = mLoader.parsePackages(true); 48 49 50 /* update expandable listview with correct items */ 51 ExpandableListView listView = 52 (ExpandableListView) findViewById(R.id.bluetooth_map_settings_list_view); 53 54 BluetoothMapSettingsAdapter adapter = 55 new BluetoothMapSettingsAdapter(this, listView, mGroups, 56 mLoader.getAccountsEnabledCount()); 57 listView.setAdapter(adapter); 58 } 59 60 61 } 62