cmparts: Cleanup on aisle 9

 * Stop dumping shit into the top level of the package and relocate it
   to the widgets directory
 * Removed a few unused things

Change-Id: I19f2a2fadfd38dcc24a4de2de988f11056124cbb
diff --git a/res/layout/cmparts.xml b/res/layout/cmparts.xml
index 4dbe3da..9df0f3b 100644
--- a/res/layout/cmparts.xml
+++ b/res/layout/cmparts.xml
@@ -28,7 +28,8 @@
             android:layout_width="match_parent"
             android:layout_weight="1">
 
-        <org.cyanogenmod.cmparts.SwitchBar android:id="@+id/switch_bar"
+        <org.cyanogenmod.cmparts.widget.SwitchBar
+            android:id="@+id/switch_bar"
                   android:layout_height="?android:attr/actionBarSize"
                   android:layout_width="match_parent"
                   android:background="@drawable/switchbar_background"
diff --git a/res/layout/display_color_calibration.xml b/res/layout/display_color_calibration.xml
index bc1b001..5621f4c 100644
--- a/res/layout/display_color_calibration.xml
+++ b/res/layout/display_color_calibration.xml
@@ -37,7 +37,8 @@
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/color_red_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/color_red_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/color_red_text"
@@ -59,7 +60,8 @@
                 android:layout_below="@id/color_red_seekbar"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/color_green_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/color_green_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/color_green_text"
@@ -81,7 +83,8 @@
                 android:layout_below="@id/color_green_seekbar"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/color_blue_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/color_blue_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/color_blue_text"
diff --git a/res/layout/display_picture_adjustment.xml b/res/layout/display_picture_adjustment.xml
index ebbcb59..3543ce1 100644
--- a/res/layout/display_picture_adjustment.xml
+++ b/res/layout/display_picture_adjustment.xml
@@ -37,7 +37,8 @@
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/adj_hue_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/adj_hue_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/adj_hue_text"
@@ -59,7 +60,8 @@
                 android:layout_below="@id/adj_hue_seekbar"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/adj_saturation_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/adj_saturation_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/adj_saturation_text"
@@ -81,7 +83,8 @@
                 android:layout_below="@id/adj_saturation_seekbar"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/adj_intensity_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/adj_intensity_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/adj_intensity_text"
@@ -103,7 +106,8 @@
                 android:layout_below="@id/adj_intensity_seekbar"
                 android:layout_alignParentRight="true"
                 android:paddingTop="10dip" />
-        <org.cyanogenmod.cmparts.IntervalSeekBar android:id="@+id/adj_contrast_seekbar"
+        <org.cyanogenmod.cmparts.widget.IntervalSeekBar
+            android:id="@+id/adj_contrast_seekbar"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/adj_contrast_text"
diff --git a/res/layout/preference_list_fragment.xml b/res/layout/preference_list_fragment.xml
index ecab428..8e6a811 100644
--- a/res/layout/preference_list_fragment.xml
+++ b/res/layout/preference_list_fragment.xml
@@ -52,7 +52,7 @@
 
         <include layout="@layout/loading_container" />
 
-        <org.cyanogenmod.cmparts.FloatingActionButton
+        <org.cyanogenmod.cmparts.widget.FloatingActionButton
             android:id="@+id/fab"
             android:visibility="gone"
             android:clickable="true"
diff --git a/res/layout/switch_bar.xml b/res/layout/switch_bar.xml
index 14c84d9..6cf6f76 100644
--- a/res/layout/switch_bar.xml
+++ b/res/layout/switch_bar.xml
@@ -30,7 +30,8 @@
               android:textColor="@color/switchbar_text_color"
               android:textAlignment="viewStart" />
 
-    <org.cyanogenmod.cmparts.ToggleSwitch android:id="@+id/switch_widget"
+    <org.cyanogenmod.cmparts.widget.ToggleSwitch
+        android:id="@+id/switch_widget"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_vertical"
diff --git a/res/xml/perf_profile_settings.xml b/res/xml/perf_profile_settings.xml
index 05a3593..1938a69 100644
--- a/res/xml/perf_profile_settings.xml
+++ b/res/xml/perf_profile_settings.xml
@@ -40,7 +40,7 @@
         android:key="perf_profile_category"
         android:title="@string/perf_profile_category_title">
 
-        <org.cyanogenmod.cmparts.SeekBarPreference
+        <org.cyanogenmod.cmparts.widget.SeekBarPreference
             android:key="perf_seekbar"
             android:title="@string/perf_profile_title"
             android:max="4"
diff --git a/src/org/cyanogenmod/cmparts/PartsActivity.java b/src/org/cyanogenmod/cmparts/PartsActivity.java
index 52faa83..bc71369 100644
--- a/src/org/cyanogenmod/cmparts/PartsActivity.java
+++ b/src/org/cyanogenmod/cmparts/PartsActivity.java
@@ -34,6 +34,7 @@
 import com.android.settingslib.drawer.SettingsDrawerActivity;
 
 import org.cyanogenmod.cmparts.profiles.NFCProfileTagCallback;
+import org.cyanogenmod.cmparts.widget.SwitchBar;
 import org.cyanogenmod.internal.cmparts.PartInfo;
 import org.cyanogenmod.internal.cmparts.PartsList;
 
diff --git a/src/org/cyanogenmod/cmparts/SelfAvailablePreference.java b/src/org/cyanogenmod/cmparts/SelfAvailablePreference.java
deleted file mode 100644
index 58afc90..0000000
--- a/src/org/cyanogenmod/cmparts/SelfAvailablePreference.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.cyanogenmod.cmparts;
-
-import android.content.Context;
-
-/**
- * Interface for classes whose instances can provide the availability of the preference.
- */
-public interface SelfAvailablePreference {
-    /**
-     * @return the availability of the preference. Please make sure the availability in managed
-     * profile is taken into account.
-     */
-    boolean isAvailable(Context context);
-}
diff --git a/src/org/cyanogenmod/cmparts/SettingsPreferenceFragment.java b/src/org/cyanogenmod/cmparts/SettingsPreferenceFragment.java
index 4d7fcab..ff22a5f 100644
--- a/src/org/cyanogenmod/cmparts/SettingsPreferenceFragment.java
+++ b/src/org/cyanogenmod/cmparts/SettingsPreferenceFragment.java
@@ -27,7 +27,6 @@
 import android.content.pm.PackageManager;
 import android.net.Uri;
 import android.os.Bundle;
-import android.support.annotation.XmlRes;
 import android.support.v14.preference.PreferenceFragment;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceGroup;
@@ -41,13 +40,16 @@
 import android.util.ArraySet;
 import android.util.Log;
 import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.view.animation.*;
 
+import org.cyanogenmod.cmparts.widget.CustomDialogPreference;
+import org.cyanogenmod.cmparts.widget.DialogCreatable;
+import org.cyanogenmod.cmparts.widget.FloatingActionButton;
+import org.cyanogenmod.cmparts.widget.LayoutPreference;
+
 import java.util.Arrays;
 import java.util.UUID;
 
@@ -130,29 +132,10 @@
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
     }
 
-    @Override
-    public void addPreferencesFromResource(@XmlRes int preferencesResId) {
-        super.addPreferencesFromResource(preferencesResId);
-        checkAvailablePrefs(getPreferenceScreen());
-    }
-
     public FloatingActionButton getFloatingActionButton() {
         return mFloatingActionButton;
     }
 
-    private void checkAvailablePrefs(PreferenceGroup preferenceGroup) {
-        if (preferenceGroup == null) return;
-        for (int i = 0; i < preferenceGroup.getPreferenceCount(); i++) {
-            Preference pref = preferenceGroup.getPreference(i);
-            if (pref instanceof SelfAvailablePreference
-                    && !((SelfAvailablePreference) pref).isAvailable(getContext())) {
-                preferenceGroup.removePreference(pref);
-            } else if (pref instanceof PreferenceGroup) {
-                checkAvailablePrefs((PreferenceGroup) pref);
-            }
-        }
-    }
-
     public ViewGroup getButtonBar() {
         return mButtonBar;
     }
diff --git a/src/org/cyanogenmod/cmparts/input/ButtonBacklightBrightness.java b/src/org/cyanogenmod/cmparts/input/ButtonBacklightBrightness.java
index ddc82ac..12bc5a7 100644
--- a/src/org/cyanogenmod/cmparts/input/ButtonBacklightBrightness.java
+++ b/src/org/cyanogenmod/cmparts/input/ButtonBacklightBrightness.java
@@ -34,7 +34,7 @@
 import android.widget.SeekBar;
 import android.widget.TextView;
 
-import org.cyanogenmod.cmparts.CustomDialogPreference;
+import org.cyanogenmod.cmparts.widget.CustomDialogPreference;
 import org.cyanogenmod.cmparts.R;
 
 import cyanogenmod.providers.CMSettings;
diff --git a/src/org/cyanogenmod/cmparts/livedisplay/DisplayColor.java b/src/org/cyanogenmod/cmparts/livedisplay/DisplayColor.java
index d112131..1bc9b38 100644
--- a/src/org/cyanogenmod/cmparts/livedisplay/DisplayColor.java
+++ b/src/org/cyanogenmod/cmparts/livedisplay/DisplayColor.java
@@ -26,8 +26,8 @@
 import android.widget.SeekBar;
 import android.widget.TextView;
 
-import org.cyanogenmod.cmparts.CustomDialogPreference;
-import org.cyanogenmod.cmparts.IntervalSeekBar;
+import org.cyanogenmod.cmparts.widget.CustomDialogPreference;
+import org.cyanogenmod.cmparts.widget.IntervalSeekBar;
 import org.cyanogenmod.cmparts.R;
 
 import cyanogenmod.hardware.LiveDisplayManager;
diff --git a/src/org/cyanogenmod/cmparts/livedisplay/DisplayTemperature.java b/src/org/cyanogenmod/cmparts/livedisplay/DisplayTemperature.java
index e272bb0..dedbbd7 100644
--- a/src/org/cyanogenmod/cmparts/livedisplay/DisplayTemperature.java
+++ b/src/org/cyanogenmod/cmparts/livedisplay/DisplayTemperature.java
@@ -27,7 +27,7 @@
 import android.widget.SeekBar;
 import android.widget.TextView;
 
-import org.cyanogenmod.cmparts.CustomDialogPreference;
+import org.cyanogenmod.cmparts.widget.CustomDialogPreference;
 import org.cyanogenmod.cmparts.R;
 import org.cyanogenmod.internal.util.MathUtils;
 
diff --git a/src/org/cyanogenmod/cmparts/livedisplay/PictureAdjustment.java b/src/org/cyanogenmod/cmparts/livedisplay/PictureAdjustment.java
index cb79840..b08964f 100644
--- a/src/org/cyanogenmod/cmparts/livedisplay/PictureAdjustment.java
+++ b/src/org/cyanogenmod/cmparts/livedisplay/PictureAdjustment.java
@@ -27,8 +27,8 @@
 import android.widget.SeekBar;
 import android.widget.TextView;
 
-import org.cyanogenmod.cmparts.CustomDialogPreference;
-import org.cyanogenmod.cmparts.IntervalSeekBar;
+import org.cyanogenmod.cmparts.widget.CustomDialogPreference;
+import org.cyanogenmod.cmparts.widget.IntervalSeekBar;
 import org.cyanogenmod.cmparts.R;
 
 import java.util.List;
diff --git a/src/org/cyanogenmod/cmparts/notificationlight/ApplicationLightPreference.java b/src/org/cyanogenmod/cmparts/notificationlight/ApplicationLightPreference.java
index fed43da..84f3a41 100644
--- a/src/org/cyanogenmod/cmparts/notificationlight/ApplicationLightPreference.java
+++ b/src/org/cyanogenmod/cmparts/notificationlight/ApplicationLightPreference.java
@@ -30,7 +30,7 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
-import org.cyanogenmod.cmparts.CustomDialogPreference;
+import org.cyanogenmod.cmparts.widget.CustomDialogPreference;
 import org.cyanogenmod.cmparts.R;
 
 public class ApplicationLightPreference extends CustomDialogPreference<LightSettingsDialog>
diff --git a/src/org/cyanogenmod/cmparts/notificationlight/NotificationLightSettings.java b/src/org/cyanogenmod/cmparts/notificationlight/NotificationLightSettings.java
index de3fc37..f45e4e2 100644
--- a/src/org/cyanogenmod/cmparts/notificationlight/NotificationLightSettings.java
+++ b/src/org/cyanogenmod/cmparts/notificationlight/NotificationLightSettings.java
@@ -41,8 +41,8 @@
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ListView;
 
-import org.cyanogenmod.cmparts.PackageListAdapter;
-import org.cyanogenmod.cmparts.PackageListAdapter.PackageItem;
+import org.cyanogenmod.cmparts.widget.PackageListAdapter;
+import org.cyanogenmod.cmparts.widget.PackageListAdapter.PackageItem;
 import org.cyanogenmod.cmparts.R;
 import org.cyanogenmod.cmparts.SettingsPreferenceFragment;
 
diff --git a/src/org/cyanogenmod/cmparts/power/PerfProfileSettings.java b/src/org/cyanogenmod/cmparts/power/PerfProfileSettings.java
index 56c77ec..6b61199 100644
--- a/src/org/cyanogenmod/cmparts/power/PerfProfileSettings.java
+++ b/src/org/cyanogenmod/cmparts/power/PerfProfileSettings.java
@@ -35,7 +35,7 @@
 import android.widget.Toast;
 
 import org.cyanogenmod.cmparts.R;
-import org.cyanogenmod.cmparts.SeekBarPreference;
+import org.cyanogenmod.cmparts.widget.SeekBarPreference;
 import org.cyanogenmod.cmparts.SettingsPreferenceFragment;
 import org.cyanogenmod.graphics.drawable.StopMotionVectorDrawable;
 
diff --git a/src/org/cyanogenmod/cmparts/profiles/AppGroupConfig.java b/src/org/cyanogenmod/cmparts/profiles/AppGroupConfig.java
index 2b1a21f..250cc1f 100644
--- a/src/org/cyanogenmod/cmparts/profiles/AppGroupConfig.java
+++ b/src/org/cyanogenmod/cmparts/profiles/AppGroupConfig.java
@@ -42,8 +42,8 @@
 import android.widget.ListView;
 import android.widget.Toast;
 
-import org.cyanogenmod.cmparts.PackageListAdapter;
-import org.cyanogenmod.cmparts.PackageListAdapter.PackageItem;
+import org.cyanogenmod.cmparts.widget.PackageListAdapter;
+import org.cyanogenmod.cmparts.widget.PackageListAdapter.PackageItem;
 import org.cyanogenmod.cmparts.R;
 import org.cyanogenmod.cmparts.SettingsPreferenceFragment;
 
diff --git a/src/org/cyanogenmod/cmparts/profiles/AppGroupList.java b/src/org/cyanogenmod/cmparts/profiles/AppGroupList.java
index ab267fe..747a7b8 100644
--- a/src/org/cyanogenmod/cmparts/profiles/AppGroupList.java
+++ b/src/org/cyanogenmod/cmparts/profiles/AppGroupList.java
@@ -29,7 +29,7 @@
 import android.widget.TextView;
 import android.widget.Toast;
 
-import org.cyanogenmod.cmparts.FloatingActionButton;
+import org.cyanogenmod.cmparts.widget.FloatingActionButton;
 import org.cyanogenmod.cmparts.R;
 import org.cyanogenmod.cmparts.SettingsPreferenceFragment;
 import org.cyanogenmod.internal.util.ScreenType;
diff --git a/src/org/cyanogenmod/cmparts/profiles/ProfileRingtonePreference.java b/src/org/cyanogenmod/cmparts/profiles/ProfileRingtonePreference.java
index 6eda71c..385739c 100644
--- a/src/org/cyanogenmod/cmparts/profiles/ProfileRingtonePreference.java
+++ b/src/org/cyanogenmod/cmparts/profiles/ProfileRingtonePreference.java
@@ -22,7 +22,7 @@
 import android.net.Uri;
 import android.util.AttributeSet;
 
-import org.cyanogenmod.cmparts.RingtonePreference;
+import org.cyanogenmod.cmparts.widget.RingtonePreference;
 
 public class ProfileRingtonePreference extends RingtonePreference {
     private static final String TAG = "ProfileRingtonePreference";
diff --git a/src/org/cyanogenmod/cmparts/profiles/ProfilesSettings.java b/src/org/cyanogenmod/cmparts/profiles/ProfilesSettings.java
index bd502d1..3944af0 100644
--- a/src/org/cyanogenmod/cmparts/profiles/ProfilesSettings.java
+++ b/src/org/cyanogenmod/cmparts/profiles/ProfilesSettings.java
@@ -37,7 +37,7 @@
 import android.widget.FrameLayout;
 import android.widget.TextView;
 
-import org.cyanogenmod.cmparts.CMBaseSystemSettingSwitchBar;
+import org.cyanogenmod.cmparts.widget.CMBaseSystemSettingSwitchBar;
 import org.cyanogenmod.cmparts.PartsActivity;
 import org.cyanogenmod.cmparts.R;
 import org.cyanogenmod.cmparts.SettingsPreferenceFragment;
diff --git a/src/org/cyanogenmod/cmparts/CMBaseSystemSettingSwitchBar.java b/src/org/cyanogenmod/cmparts/widget/CMBaseSystemSettingSwitchBar.java
similarity index 98%
rename from src/org/cyanogenmod/cmparts/CMBaseSystemSettingSwitchBar.java
rename to src/org/cyanogenmod/cmparts/widget/CMBaseSystemSettingSwitchBar.java
index c10ce5d..5d368f0 100644
--- a/src/org/cyanogenmod/cmparts/CMBaseSystemSettingSwitchBar.java
+++ b/src/org/cyanogenmod/cmparts/widget/CMBaseSystemSettingSwitchBar.java
@@ -14,7 +14,7 @@
 * limitations under the License.
 */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.ContentResolver;
 import android.content.Context;
@@ -25,7 +25,7 @@
 
 import cyanogenmod.providers.CMSettings;
 
-public class CMBaseSystemSettingSwitchBar implements SwitchBar.OnSwitchChangeListener  {
+public class CMBaseSystemSettingSwitchBar implements SwitchBar.OnSwitchChangeListener {
     private Context mContext;
     private SwitchBar mSwitchBar;
     private SettingsObserver mSettingsObserver;
diff --git a/src/org/cyanogenmod/cmparts/CustomDialogPreference.java b/src/org/cyanogenmod/cmparts/widget/CustomDialogPreference.java
similarity index 99%
rename from src/org/cyanogenmod/cmparts/CustomDialogPreference.java
rename to src/org/cyanogenmod/cmparts/widget/CustomDialogPreference.java
index 8646097..f32b7dd 100644
--- a/src/org/cyanogenmod/cmparts/CustomDialogPreference.java
+++ b/src/org/cyanogenmod/cmparts/widget/CustomDialogPreference.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.app.AlertDialog;
 import android.app.Dialog;
diff --git a/src/org/cyanogenmod/cmparts/DialogCreatable.java b/src/org/cyanogenmod/cmparts/widget/DialogCreatable.java
similarity index 90%
rename from src/org/cyanogenmod/cmparts/DialogCreatable.java
rename to src/org/cyanogenmod/cmparts/widget/DialogCreatable.java
index 4a718b6..a871547 100644
--- a/src/org/cyanogenmod/cmparts/DialogCreatable.java
+++ b/src/org/cyanogenmod/cmparts/widget/DialogCreatable.java
@@ -14,10 +14,12 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.app.Dialog;
 
+import org.cyanogenmod.cmparts.SettingsPreferenceFragment;
+
 /**
  * Letting the class, assumed to be Fragment, create a Dialog on it. Should be useful
  * you want to utilize some capability in {@link SettingsPreferenceFragment} but don't want
diff --git a/src/org/cyanogenmod/cmparts/FloatingActionButton.java b/src/org/cyanogenmod/cmparts/widget/FloatingActionButton.java
similarity index 95%
rename from src/org/cyanogenmod/cmparts/FloatingActionButton.java
rename to src/org/cyanogenmod/cmparts/widget/FloatingActionButton.java
index 976dd54..8c8cd26 100644
--- a/src/org/cyanogenmod/cmparts/FloatingActionButton.java
+++ b/src/org/cyanogenmod/cmparts/widget/FloatingActionButton.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.animation.AnimatorInflater;
 import android.content.Context;
@@ -24,6 +24,8 @@
 import android.view.ViewOutlineProvider;
 import android.widget.ImageView;
 
+import org.cyanogenmod.cmparts.R;
+
 public class FloatingActionButton extends ImageView {
 
     public FloatingActionButton(Context context, AttributeSet attrs) {
diff --git a/src/org/cyanogenmod/cmparts/IntervalSeekBar.java b/src/org/cyanogenmod/cmparts/widget/IntervalSeekBar.java
similarity index 97%
rename from src/org/cyanogenmod/cmparts/IntervalSeekBar.java
rename to src/org/cyanogenmod/cmparts/widget/IntervalSeekBar.java
index 995d34d..7c7b427 100644
--- a/src/org/cyanogenmod/cmparts/IntervalSeekBar.java
+++ b/src/org/cyanogenmod/cmparts/widget/IntervalSeekBar.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.content.res.TypedArray;
@@ -21,6 +21,8 @@
 import android.util.Log;
 import android.widget.SeekBar;
 
+import org.cyanogenmod.cmparts.R;
+
 /**
  * Custom SeekBar that allows setting both a minimum and maximum value.
  * This also handles floating point values (to 2 decimal places) through
diff --git a/src/org/cyanogenmod/cmparts/LayoutPreference.java b/src/org/cyanogenmod/cmparts/widget/LayoutPreference.java
similarity index 97%
rename from src/org/cyanogenmod/cmparts/LayoutPreference.java
rename to src/org/cyanogenmod/cmparts/widget/LayoutPreference.java
index 5e9786b..f6f339b 100644
--- a/src/org/cyanogenmod/cmparts/LayoutPreference.java
+++ b/src/org/cyanogenmod/cmparts/widget/LayoutPreference.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.content.res.Resources;
@@ -27,6 +27,8 @@
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
 
+import org.cyanogenmod.cmparts.R;
+
 public class LayoutPreference extends Preference {
 
     private View mRootView;
diff --git a/src/org/cyanogenmod/cmparts/PackageListAdapter.java b/src/org/cyanogenmod/cmparts/widget/PackageListAdapter.java
similarity index 98%
rename from src/org/cyanogenmod/cmparts/PackageListAdapter.java
rename to src/org/cyanogenmod/cmparts/widget/PackageListAdapter.java
index 2c506ef..fcc2684 100644
--- a/src/org/cyanogenmod/cmparts/PackageListAdapter.java
+++ b/src/org/cyanogenmod/cmparts/widget/PackageListAdapter.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.content.Intent;
@@ -32,6 +32,8 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import org.cyanogenmod.cmparts.R;
+
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
diff --git a/src/org/cyanogenmod/cmparts/RingtonePreference.java b/src/org/cyanogenmod/cmparts/widget/RingtonePreference.java
similarity index 99%
rename from src/org/cyanogenmod/cmparts/RingtonePreference.java
rename to src/org/cyanogenmod/cmparts/widget/RingtonePreference.java
index d262fad..4203700 100644
--- a/src/org/cyanogenmod/cmparts/RingtonePreference.java
+++ b/src/org/cyanogenmod/cmparts/widget/RingtonePreference.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.content.Intent;
diff --git a/src/org/cyanogenmod/cmparts/SeekBarPreference.java b/src/org/cyanogenmod/cmparts/widget/SeekBarPreference.java
similarity index 98%
rename from src/org/cyanogenmod/cmparts/SeekBarPreference.java
rename to src/org/cyanogenmod/cmparts/widget/SeekBarPreference.java
index 7fd7414..393901a 100644
--- a/src/org/cyanogenmod/cmparts/SeekBarPreference.java
+++ b/src/org/cyanogenmod/cmparts/widget/SeekBarPreference.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.content.res.TypedArray;
@@ -33,6 +33,8 @@
 
 import com.android.settingslib.RestrictedPreference;
 
+import org.cyanogenmod.cmparts.R;
+
 /**
  * Based on android.preference.SeekBarPreference, but uses support preference as base.
  */
diff --git a/src/org/cyanogenmod/cmparts/SwitchBar.java b/src/org/cyanogenmod/cmparts/widget/SwitchBar.java
similarity index 98%
rename from src/org/cyanogenmod/cmparts/SwitchBar.java
rename to src/org/cyanogenmod/cmparts/widget/SwitchBar.java
index 7739b55..2e5b1fb 100644
--- a/src/org/cyanogenmod/cmparts/SwitchBar.java
+++ b/src/org/cyanogenmod/cmparts/widget/SwitchBar.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.content.res.TypedArray;
@@ -32,6 +32,8 @@
 import android.widget.Switch;
 import android.widget.TextView;
 
+import org.cyanogenmod.cmparts.R;
+
 import java.util.ArrayList;
 
 public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedChangeListener,
diff --git a/src/org/cyanogenmod/cmparts/ToggleSwitch.java b/src/org/cyanogenmod/cmparts/widget/ToggleSwitch.java
similarity index 97%
rename from src/org/cyanogenmod/cmparts/ToggleSwitch.java
rename to src/org/cyanogenmod/cmparts/widget/ToggleSwitch.java
index 8858a30..0bde18f 100644
--- a/src/org/cyanogenmod/cmparts/ToggleSwitch.java
+++ b/src/org/cyanogenmod/cmparts/widget/ToggleSwitch.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.cyanogenmod.cmparts;
+package org.cyanogenmod.cmparts.widget;
 
 import android.content.Context;
 import android.util.AttributeSet;