1/*
2 * Copyright (C) 2014 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
17package com.android.inputmethod.latin.settings;
18
19import android.os.Bundle;
20
21import com.android.inputmethod.latin.R;
22import com.android.inputmethod.latin.common.Constants;
23import com.android.inputmethod.latin.define.ProductionFlags;
24
25/**
26 * "Appearance" settings sub screen.
27 */
28public final class AppearanceSettingsFragment extends SubScreenFragment {
29    @Override
30    public void onCreate(final Bundle icicle) {
31        super.onCreate(icicle);
32        addPreferencesFromResource(R.xml.prefs_screen_appearance);
33        if (!ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED ||
34                Constants.isPhone(Settings.readScreenMetrics(getResources()))) {
35            removePreference(Settings.PREF_ENABLE_SPLIT_KEYBOARD);
36        }
37    }
38
39    @Override
40    public void onResume() {
41        super.onResume();
42        CustomInputStyleSettingsFragment.updateCustomInputStylesSummary(
43                findPreference(Settings.PREF_CUSTOM_INPUT_STYLES));
44        ThemeSettingsFragment.updateKeyboardThemeSummary(findPreference(Settings.SCREEN_THEME));
45    }
46}
47