diff options
author | Pavel Zhamaitsiak <pavelz@google.com> | 2015-03-23 14:43:24 -0700 |
---|---|---|
committer | Pavel Zhamaitsiak <pavelz@google.com> | 2015-03-23 14:43:24 -0700 |
commit | ee5f27dbeeef90381de905d05b3b67bc1837df20 (patch) | |
tree | 53ab28c8b4c663cf910b7489c9c521bfbe4028fd /src/com/android | |
parent | 71a692225efed6ac3b318441bc31e637204561f6 (diff) | |
download | packages_apps_Settings-ee5f27dbeeef90381de905d05b3b67bc1837df20.tar.gz packages_apps_Settings-ee5f27dbeeef90381de905d05b3b67bc1837df20.tar.bz2 packages_apps_Settings-ee5f27dbeeef90381de905d05b3b67bc1837df20.zip |
Update Wi-Fi Calling settings
- Update strings
- Move WFC mode summary strings to framework/base
- Update screens to reflect latest UX requirements
Change-Id: Ibcb1a0b6eec2342dfbaa30f90fe728976ad80a0d
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/WifiCallingSettings.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index 8e2c7ed9f..5167ab0a1 100644 --- a/src/com/android/settings/WifiCallingSettings.java +++ b/src/com/android/settings/WifiCallingSettings.java @@ -25,10 +25,12 @@ import android.content.IntentFilter; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.PreferenceScreen; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log; import android.widget.Switch; +import android.widget.TextView; import com.android.ims.ImsConfig; import com.android.ims.ImsManager; @@ -52,6 +54,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment private SwitchBar mSwitchBar; private Switch mSwitch; private ListPreference mButtonWfcMode; + private TextView mEmptyView; private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() { /* @@ -89,6 +92,10 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mSwitchBar = activity.getSwitchBar(); mSwitch = mSwitchBar.getSwitch(); mSwitchBar.show(); + + mEmptyView = (TextView) getView().findViewById(android.R.id.empty); + getListView().setEmptyView(mEmptyView); + mEmptyView.setText(R.string.wifi_calling_off_explanation); } @Override @@ -106,7 +113,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(message) .setTitle(title) - .setIcon(android.R.drawable.stat_sys_warning) + .setIcon(android.R.drawable.ic_dialog_alert) .setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.show(); @@ -206,6 +213,13 @@ public class WifiCallingSettings extends SettingsPreferenceFragment int wfcMode = ImsManager.getWfcMode(context); mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode)); mButtonWfcMode.setEnabled(isChecked); + + final PreferenceScreen preferenceScreen = getPreferenceScreen(); + if (isChecked) { + preferenceScreen.addPreference(mButtonWfcMode); + } else { + preferenceScreen.removePreference(mButtonWfcMode); + } } @Override @@ -224,17 +238,17 @@ public class WifiCallingSettings extends SettingsPreferenceFragment } static int getWfcModeSummary(Context context, int wfcMode) { - int resId = R.string.wifi_calling_off_summary; + int resId = com.android.internal.R.string.wifi_calling_off_summary; if (ImsManager.isWfcEnabledByUser(context)) { switch (wfcMode) { case ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY: - resId = R.string.wfc_mode_wifi_only_summary; + resId = com.android.internal.R.string.wfc_mode_wifi_only_summary; break; case ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED: - resId = R.string.wfc_mode_cellular_preferred_summary; + resId = com.android.internal.R.string.wfc_mode_cellular_preferred_summary; break; case ImsConfig.WfcModeFeatureValueConstants.WIFI_PREFERRED: - resId = R.string.wfc_mode_wifi_preferred_summary; + resId = com.android.internal.R.string.wfc_mode_wifi_preferred_summary; break; default: Log.e(TAG, "Unexpected WFC mode value: " + wfcMode); |