Skip to content

Commit

Permalink
Build CarbonFibers into Settings package itself (2/3)
Browse files Browse the repository at this point in the history
Follow diff style guidelines

Change-Id: Id3a5ba0fb9da33e52cfe9397c91a8773ca9ec399
Signed-off-by: Daniel MM <[email protected]>
  • Loading branch information
daxxmax committed Mar 18, 2014
1 parent 3ac6f88 commit d0e8cc8
Show file tree
Hide file tree
Showing 28 changed files with 54 additions and 87 deletions.
46 changes: 23 additions & 23 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_JAVA_LIBRARIES := bouncycastle telephony-common
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13 android-support-v4

LOCAL_JAVA_LIBRARIES += org.cyanogenmod.hardware

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res

LOCAL_AAPT_FLAGS := --auto-add-overlay

LOCAL_PACKAGE_NAME := CarbonFibers
LOCAL_CERTIFICATE := platform
LOCAL_PRIVIELEGED_MODULE := true

include $(BUILD_PACKAGE)

#LOCAL_PATH:= $(call my-dir)
#include $(CLEAR_VARS)
#
#LOCAL_JAVA_LIBRARIES := bouncycastle telephony-common
#LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13 android-support-v4
#
#LOCAL_JAVA_LIBRARIES += org.cyanogenmod.hardware
#
#LOCAL_MODULE_TAGS := optional
#
#LOCAL_SRC_FILES := $(call all-java-files-under, src)
#
#LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
#
#LOCAL_AAPT_FLAGS := --auto-add-overlay
#
#LOCAL_PACKAGE_NAME := CarbonFibers
#LOCAL_CERTIFICATE := platform
#LOCAL_PRIVIELEGED_MODULE := true
#
#include $(BUILD_PACKAGE)
#
# Use the folloing include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
#include $(call all-makefiles-under,$(LOCAL_PATH))
4 changes: 1 addition & 3 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.carbon.fibers"
android:sharedUserId="android.uid.system" >
package="com.carbon.fibers" >

<uses-sdk android:minSdkVersion="19"/>
<original-package android:name="com.carbon.fibers" />

<uses-permission android:name="android.permission.REBOOT" />
Expand Down
2 changes: 1 addition & 1 deletion res/layout/buttons_list_view_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down
3 changes: 1 addition & 2 deletions res/layout/tab_ui_sb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
android:layout_height="wrap_content"
android:layout_gravity="top"
android:textColor="@color/color_text_holo_dark"
android:textAppearance="@style/TextAppearance.PagerTabs"
android:background="@color/color_carbon" />
android:textAppearance="@style/TextAppearance.PagerTabs" />

</android.support.v4.view.ViewPager>
</LinearLayout>
6 changes: 1 addition & 5 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
<attr format="string" name="separator" />
</declare-styleable>

<declare-styleable name="IconPreferenceScreen">
<attr name="icon" format="reference" />
</declare-styleable>

<declare-styleable name="SeekBarPreference">
<attr name="min" format="integer" />
<attr name="minm" format="integer" />
<attr name="interval" format="integer" />
<attr name="unitsLeft" format="string|reference" />
<attr name="unitsRight" format="string|reference" />
Expand Down
10 changes: 0 additions & 10 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,11 @@
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="text_view_condensed_style" parent="android:Widget.Holo.TextView">
<item name="android:fontFamily">sans-serif-condensed</item>
</style>

<style name="text_view_light_style" parent="android:Widget.Holo.TextView">
<item name="android:fontFamily">sans-serif-light</item>
</style>

<style name="button_style" parent="android:Widget.Holo.Button">
<item name="android:fontFamily">sans-serif-condensed</item>
</style>

<style name="TextAppearance.PagerTabs" parent="@android:style/TextAppearance.DeviceDefault.Small">
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textAllCaps">true</item>
<item name="android:textStyle">bold</item>
</style>
Expand All @@ -52,7 +43,6 @@
</style>

<style name="TextAppearance.QuickSettings">
<item name="android:fontFamily">sans-serif</item>
<item name="android:textSize">12sp</item>
<item name="android:textStyle">normal</item>
<item name="android:textAllCaps">true</item>
Expand Down
14 changes: 0 additions & 14 deletions res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
<style name="application_theme_dark" parent="@android:style/Theme.Holo" >
<item name="android:actionBarStyle">@android:style/Widget.Holo.ActionBar.Solid</item>
<item name="android:buttonStyle">@style/button_style</item>
<item name="android:textViewStyle">@style/text_view_light_style</item>
</style>

<style name="application_theme_light" parent="@android:style/Theme.Holo.Light.DarkActionBar" >
<item name="android:actionBarStyle">@android:style/Widget.Holo.ActionBar.Solid</item>
<item name="android:buttonStyle">@style/button_style</item>
<item name="android:textViewStyle">@style/text_view_condensed_style</item>
</style>

<style name="application_theme_about" parent="@android:style/Theme.Holo" >
<item name="android:actionBarStyle">@android:style/Widget.Holo.ActionBar.Solid</item>
<item name="android:buttonStyle">@style/button_style</item>
<item name="android:textViewStyle">@style/text_view_light_style</item>
<item name="android:windowBackground">@color/carbon_grey2</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion res/xml/active_display_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/ad_settings_title" >

<SwitchPreference
Expand Down
3 changes: 1 addition & 2 deletions res/xml/carrier_label_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/carrier_label_title"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers">
android:title="@string/carrier_label_title">

<PreferenceCategory
android:key="carrier_label_general"
Expand Down
3 changes: 1 addition & 2 deletions res/xml/lockscreen_buttons_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers" >
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<com.carbon.fibers.preference.SystemSettingCheckBoxPreference
android:key="home_unlock_screen"
Expand Down
3 changes: 1 addition & 2 deletions res/xml/lockscreen_general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers" >
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<ListPreference
android:key="lockscreen_battery_status"
Expand Down
3 changes: 1 addition & 2 deletions res/xml/lockscreen_notifications.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/lockscreen_notifications"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers">
android:title="@string/lockscreen_notifications">

<PreferenceCategory
android:key="category_general"
Expand Down
1 change: 0 additions & 1 deletion res/xml/navbar_button_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/nav_bar_button_style">

<!-- Status bar tweaks -->
Expand Down
1 change: 0 additions & 1 deletion res/xml/pie_button_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/pie_button_style">

<PreferenceCategory
Expand Down
1 change: 0 additions & 1 deletion res/xml/pie_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/pie_style">

<PreferenceCategory
Expand Down
3 changes: 1 addition & 2 deletions res/xml/pie_trigger.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/pie_control_trigger_positions"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
android:title="@string/pie_control_trigger_positions">

<Preference
style="?android:preferenceInformationStyle"
Expand Down
10 changes: 5 additions & 5 deletions res/xml/progressbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/progressbar_title" >

<PreferenceCategory
Expand All @@ -34,7 +34,7 @@
android:title="@string/progressbar_speed_title"
android:summary="@string/progressbar_speed_title"
android:max="31"
settings:min="1"
settings:minm="1"
settings:unitsLeft="Speed: "
settings:unitsRight=""
android:defaultValue="10" />
Expand All @@ -45,7 +45,7 @@
android:title="@string/progressbar_width_title"
android:summary="@string/progressbar_width_title"
android:max="12"
settings:min="0"
settings:minm="0"
settings:unitsLeft="Stroke width: "
settings:unitsRight="dp"
android:defaultValue="4" />
Expand All @@ -56,7 +56,7 @@
android:title="@string/progressbar_length_title"
android:summary="@string/progressbar_length_title"
android:max="48"
settings:min="0"
settings:minm="0"
settings:unitsLeft="Separator length: "
settings:unitsRight="dp"
android:defaultValue="10" />
Expand All @@ -67,7 +67,7 @@
android:title="@string/progressbar_count_title"
android:summary="@string/progressbar_count_title"
android:max="12"
settings:min="1"
settings:minm="1"
settings:unitsLeft="Sections Count: "
settings:unitsRight=""
android:defaultValue="6" />
Expand Down
5 changes: 2 additions & 3 deletions res/xml/quicksettings_tiles_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
-->

<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
xmlns:android="http://schemas.android.com/apk/res/android">

<PreferenceCategory
android:title="@string/quicksettings_tiles_style">
Expand Down Expand Up @@ -59,4 +58,4 @@

</PreferenceCategory>

</PreferenceScreen>
</PreferenceScreen>
2 changes: 1 addition & 1 deletion res/xml/sb_notification_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/notification_drawer_title"
xmlns:settings="http://schemas.android.com/apk/res/com.carbon.fibers">
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">

<ListPreference
android:key="notification_drawer_collapse_on_dismiss"
Expand Down
4 changes: 2 additions & 2 deletions src/com/carbon/fibers/chameleonos/SeekBarPreference.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SeekBarPreference extends Preference implements OnSeekBarChangeList
private final String TAG = getClass().getName();

private static final String ANDROIDNS = "http://schemas.android.com/apk/res/android";
private static final String SETTINGS = "http://schemas.android.com/apk/res/com.carbon.fibers";
private static final String SETTINGS = "http://schemas.android.com/apk/res/com.android.settings";
private static final int DEFAULT_VALUE = 50;

private int mMaxValue = 100;
Expand Down Expand Up @@ -55,7 +55,7 @@ private void setValuesFromXml(AttributeSet attrs) {
attrs, R.styleable.SeekBarPreference);

mMaxValue = attrs.getAttributeIntValue(ANDROIDNS, "max", 100);
mMinValue = attrs.getAttributeIntValue(SETTINGS, "min", 0);
mMinValue = attrs.getAttributeIntValue(SETTINGS, "minm", 0);
mUnitsLeft = getAttributeStringValue(attrs, SETTINGS, "unitsLeft", "");
String units = getAttributeStringValue(attrs, SETTINGS, "units", "");
mUnitsRight = getAttributeStringValue(attrs, SETTINGS, "unitsRight", units);
Expand Down
1 change: 1 addition & 0 deletions src/com/carbon/fibers/fragments/ls/KeyguardSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View view = inflater.inflate(R.layout.tab_ui_sb, container, false);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mPagerTabStrip = (PagerTabStrip) view.findViewById(R.id.pagerTabStrip);
mPagerTabStrip.setTabIndicatorColorResource(android.R.color.white);

StatusBarAdapter StatusBarAdapter = new StatusBarAdapter(getFragmentManager());
mViewPager.setAdapter(StatusBarAdapter);
Expand Down
3 changes: 2 additions & 1 deletion src/com/carbon/fibers/fragments/navbar/NavbarTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View view = inflater.inflate(R.layout.tab_ui_sb, container, false);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mPagerTabStrip = (PagerTabStrip) view.findViewById(R.id.pagerTabStrip);
mPagerTabStrip.setTabIndicatorColorResource(android.R.color.white);

NavigationAdapter NavigationAdapter = new NavigationAdapter(getFragmentManager());
mViewPager.setAdapter(NavigationAdapter);
Expand Down Expand Up @@ -114,4 +115,4 @@ private String[] getTitles() {
getString(R.string.navigation_bar_general_category)};
return titleString;
}
}
}
1 change: 1 addition & 0 deletions src/com/carbon/fibers/fragments/pie/PieTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View view = inflater.inflate(R.layout.tab_ui_sb, container, false);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mPagerTabStrip = (PagerTabStrip) view.findViewById(R.id.pagerTabStrip);
mPagerTabStrip.setTabIndicatorColorResource(android.R.color.white);

StatusBarAdapter StatusBarAdapter = new StatusBarAdapter(getFragmentManager());
mViewPager.setAdapter(StatusBarAdapter);
Expand Down
2 changes: 2 additions & 0 deletions src/com/carbon/fibers/fragments/sb/QuickSettingsTiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
mContainer.setClipToPadding(false);
mInflater = inflater;

QuickSettingsUtil.removeUnsupportedTiles(getActivity());

// We have both a panel and the ribbon config, see which one we are using
Bundle args = getArguments();
if (args != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/carbon/fibers/fragments/sb/QuickSettingsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static void enableTile(String id) {
}
}

private static synchronized void removeUnsupportedTiles(Context context) {
protected static synchronized void removeUnsupportedTiles(Context context) {
// Don't show mobile data options if not supported
if (!QSUtils.deviceSupportsMobileData(context)) {
removeTile(TILE_MOBILEDATA);
Expand Down
1 change: 1 addition & 0 deletions src/com/carbon/fibers/fragments/sb/SbSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View view = inflater.inflate(R.layout.tab_ui_sb, container, false);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mPagerTabStrip = (PagerTabStrip) view.findViewById(R.id.pagerTabStrip);
mPagerTabStrip.setTabIndicatorColorResource(android.R.color.white);

StatusBarAdapter StatusBarAdapter = new StatusBarAdapter(getFragmentManager());
mViewPager.setAdapter(StatusBarAdapter);
Expand Down
1 change: 1 addition & 0 deletions src/com/carbon/fibers/fragments/ui/InterfaceSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View view = inflater.inflate(R.layout.tab_ui_sb, container, false);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mPagerTabStrip = (PagerTabStrip) view.findViewById(R.id.pagerTabStrip);
mPagerTabStrip.setTabIndicatorColorResource(android.R.color.white);

StatusBarAdapter StatusBarAdapter = new StatusBarAdapter(getFragmentManager());
mViewPager.setAdapter(StatusBarAdapter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SpecialSeekBarPreference extends Preference implements OnSeekBarCha
private final String TAG = getClass().getName();

private static final String ANDROIDNS = "http://schemas.android.com/apk/res/android";
private static final String SETTINGS = "http://schemas.android.com/apk/res/com.carbon.fibers";
private static final String SETTINGS = "http://schemas.android.com/apk/res/com.android.settings";
private static final int DEFAULT_VALUE = 50;

private int mMaxValue = 100;
Expand Down Expand Up @@ -70,7 +70,7 @@ private void initPreference(Context context, AttributeSet attrs) {

private void setValuesFromXml(AttributeSet attrs) {
mMaxValue = attrs.getAttributeIntValue(ANDROIDNS, "max", 100);
mMinValue = attrs.getAttributeIntValue(SETTINGS, "min", 0);
mMinValue = attrs.getAttributeIntValue(SETTINGS, "minm", 0);
mUnitsLeft = getAttributeStringValue(attrs, SETTINGS, "unitsLeft", "");
String units = getAttributeStringValue(attrs, SETTINGS, "units", "");
mUnitsRight = getAttributeStringValue(attrs, SETTINGS, "unitsRight", units);
Expand Down

0 comments on commit d0e8cc8

Please sign in to comment.