Code refactoring

- move ToggleSwitch to the widget package

Change-Id: Id277fc11c78363bf7d7b229ef9ae91c1ec5d6774
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index 810b8b5..43306f2 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -17,7 +17,6 @@
 package com.android.settings.accessibility;
 
 import android.app.ActionBar;
-import android.app.Activity;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.Resources;
@@ -41,7 +40,8 @@
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
-import com.android.settings.accessibility.ToggleSwitch.OnBeforeCheckedChangeListener;
+import com.android.settings.widget.ToggleSwitch;
+import com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener;
 
 import java.util.Locale;
 
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index db473f8..7f0bb41 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -37,7 +37,8 @@
 import android.widget.TextView;
 
 import com.android.settings.R;
-import com.android.settings.accessibility.ToggleSwitch.OnBeforeCheckedChangeListener;
+import com.android.settings.widget.ToggleSwitch;
+import com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener;
 
 import java.util.Collections;
 import java.util.HashSet;
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index 384aafc..6da81b0 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -16,14 +16,10 @@
 
 package com.android.settings.accessibility;
 
-import android.accessibilityservice.AccessibilityService;
 import android.os.Bundle;
 import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.PreferenceScreen;
-import android.preference.SeekBarPreference;
 import android.provider.Settings;
 import android.view.View;
 import android.view.accessibility.AccessibilityManager;
@@ -31,7 +27,6 @@
 import android.widget.CompoundButton.OnCheckedChangeListener;
 
 import com.android.settings.R;
-import com.android.settings.accessibility.ToggleSwitch.OnBeforeCheckedChangeListener;
 
 public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceFragment
         implements Preference.OnPreferenceChangeListener {
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index 6558cc7..55e3199 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -17,7 +17,6 @@
 package com.android.settings.accessibility;
 
 import android.app.ActionBar;
-import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Color;
@@ -37,6 +36,7 @@
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.widget.ToggleSwitch;
 
 public abstract class ToggleFeaturePreferenceFragment
         extends SettingsPreferenceFragment {
diff --git a/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
index f4ac2cc..56680b8 100644
--- a/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
@@ -18,7 +18,8 @@
 
 import android.provider.Settings;
 
-import com.android.settings.accessibility.ToggleSwitch.OnBeforeCheckedChangeListener;
+import com.android.settings.widget.ToggleSwitch;
+import com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener;
 
 public class ToggleGlobalGesturePreferenceFragment
         extends ToggleFeaturePreferenceFragment {
diff --git a/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
index 92a778e..88c6caf 100644
--- a/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
@@ -16,21 +16,15 @@
 
 package com.android.settings.accessibility;
 
-import android.accessibilityservice.AccessibilityService;
 import android.os.Bundle;
 import android.preference.CheckBoxPreference;
-import android.preference.ListPreference;
 import android.preference.Preference;
-import android.preference.PreferenceScreen;
-import android.preference.SeekBarPreference;
 import android.provider.Settings;
 import android.view.View;
-import android.view.accessibility.AccessibilityManager;
 import android.widget.CompoundButton;
 import android.widget.CompoundButton.OnCheckedChangeListener;
 
 import com.android.settings.R;
-import com.android.settings.accessibility.ToggleSwitch.OnBeforeCheckedChangeListener;
 
 public class ToggleInversionPreferenceFragment extends ToggleFeaturePreferenceFragment
         implements Preference.OnPreferenceChangeListener {
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 27d07d2..0e8926a 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -18,7 +18,8 @@
 
 import android.provider.Settings;
 
-import com.android.settings.accessibility.ToggleSwitch.OnBeforeCheckedChangeListener;
+import com.android.settings.widget.ToggleSwitch;
+import com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener;
 
 public class ToggleScreenMagnificationPreferenceFragment
         extends ToggleFeaturePreferenceFragment {
diff --git a/src/com/android/settings/accessibility/ToggleSwitch.java b/src/com/android/settings/widget/ToggleSwitch.java
similarity index 96%
rename from src/com/android/settings/accessibility/ToggleSwitch.java
rename to src/com/android/settings/widget/ToggleSwitch.java
index e7c39e4..41abf8a 100644
--- a/src/com/android/settings/accessibility/ToggleSwitch.java
+++ b/src/com/android/settings/widget/ToggleSwitch.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.settings.accessibility;
+package com.android.settings.widget;
 
 import android.content.Context;
 import android.widget.Switch;