1 /*
2 * Copyright (C) 2014 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 import com.android.bluetooth.R;
18 import com.android.bluetooth.map.BluetoothMapEmailSettingsItem;
19 
20 import java.util.ArrayList;
21 import java.util.LinkedHashMap;
22 
23 import android.app.Activity;
24 import android.os.Bundle;
25 import android.widget.ExpandableListView;
26 
27 
28 public class BluetoothMapEmailSettings extends Activity {
29 
30     private static final String TAG = "BluetoothMapEmailSettings";
31     private static final boolean D = BluetoothMapService.DEBUG;
32     private static final boolean V = BluetoothMapService.VERBOSE;
33 
34 
35 
36     BluetoothMapEmailSettingsLoader mLoader = new BluetoothMapEmailSettingsLoader(this);
37     LinkedHashMap<BluetoothMapEmailSettingsItem,ArrayList<BluetoothMapEmailSettingsItem>> mGroups;
38 
39     @Override
onCreate(Bundle savedInstanceState)40     protected void onCreate(Bundle savedInstanceState) {
41         super.onCreate(savedInstanceState);
42         /* set UI */
43         setContentView(R.layout.bluetooth_map_email_settings);
44         /* create structure for list of groups + items*/
45         mGroups = mLoader.parsePackages(true);
46 
47 
48         /* update expandable listview with correct items */
49         ExpandableListView listView = (ExpandableListView) findViewById(R.id.bluetooth_map_email_settings_list_view);
50 
51         BluetoothMapEmailSettingsAdapter adapter = new BluetoothMapEmailSettingsAdapter(this,listView, mGroups, mLoader.getAccountsEnabledCount());
52         listView.setAdapter(adapter);
53     }
54 
55 
56 }
57