Skip to content

Commit

Permalink
Merge pull request #5 from corcoran/jb
Browse files Browse the repository at this point in the history
Framework: Whitespace cleanup

thanks a bunch for correcting!!!!!!!!!!!
  • Loading branch information
kufikugel committed Nov 10, 2012
2 parents 2522618 + b2c7379 commit 55910ee
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private void makeBar() {
addLightsOutButton(lightsOut, v, landscape, false);

if (v.getId() == R.id.back){
mBackIcon = mBackLandIcon = v.getDrawable();
mBackIcon = mBackLandIcon = v.getDrawable();
}

if (mNumberOfButtons == 3 && j != (mNumberOfButtons - 1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ class NotificationWallpaper extends FrameLayout {

private final String TAG = "NotificationWallpaperUpdater";

private final String NOTIF_WALLPAPER_IMAGE_PATH = "/data/data/com.android.settings/files/notification_wallpaper.jpg";
private final String NOTIF_WALLPAPER_IMAGE_PATH = "/data/data/com.android.settings/files/notification_wallpaper.jpg";

private ImageView mNotificationWallpaperImage;
private float wallpaperAlpha;

Context mContext;
Context mContext;

Bitmap bitmapWallpaper;

public NotificationWallpaper(Context context, AttributeSet attrs) {
super(context);
mContext = context;
mContext = context;
setNotificationWallpaper();
SettingsObserver observer = new SettingsObserver(new Handler());
SettingsObserver observer = new SettingsObserver(new Handler());
observer.observe();
}

public void setNotificationWallpaper() {
File file = new File(NOTIF_WALLPAPER_IMAGE_PATH);

if (file.exists()) {
removeAllViews();
wallpaperAlpha = Settings.System.getFloat(getContext()
.getContentResolver(), Settings.System.NOTIF_WALLPAPER_ALPHA, 0.0f);
removeAllViews();
wallpaperAlpha = Settings.System.getFloat(getContext()
.getContentResolver(), Settings.System.NOTIF_WALLPAPER_ALPHA, 0.0f);

mNotificationWallpaperImage = new ImageView(getContext());
mNotificationWallpaperImage.setScaleType(ScaleType.CENTER);
Expand Down Expand Up @@ -76,17 +76,17 @@ class SettingsObserver extends ContentObserver {
}

void observe() {
ContentResolver resolver = mContext.getContentResolver();
ContentResolver resolver = mContext.getContentResolver();
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.NOTIF_WALLPAPER_ALPHA), false, this);
Settings.System.NOTIF_WALLPAPER_ALPHA), false, this);
}

@Override
public void onChange(boolean selfChange, Uri uri) {
wallpaperAlpha = Settings.System.getFloat(getContext()

wallpaperAlpha = Settings.System.getFloat(getContext()
.getContentResolver(), Settings.System.NOTIF_WALLPAPER_ALPHA, 0.0f);
setNotificationWallpaper();
setNotificationWallpaper();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.android.systemui.statusbar.phone;


import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorListenerAdapter;
Expand Down Expand Up @@ -124,7 +123,6 @@

public class PhoneStatusBar extends BaseStatusBar {
static final String TAG = "PhoneStatusBar";


public static final boolean DEBUG = false;
public static final boolean SPEW = DEBUG;
Expand Down Expand Up @@ -178,7 +176,7 @@ public class PhoneStatusBar extends BaseStatusBar {
private float mFlingGestureMaxOutputVelocityPx; // how fast can it really go? (should be a little
// faster than mSelfCollapseVelocityPx)

private final String NOTIF_WALLPAPER_IMAGE_PATH = "/data/data/com.android.settings/files/notification_wallpaper.jpg";
private final String NOTIF_WALLPAPER_IMAGE_PATH = "/data/data/com.android.settings/files/notification_wallpaper.jpg";

PhoneStatusBarPolicy mIconPolicy;

Expand Down Expand Up @@ -709,9 +707,9 @@ protected void updateRecentsPanel() {
// a bit jarring
mRecentsPanel.setMinSwipeAlpha(0.03f);
if (mNavigationBarView != null) {
if (mNavigationBarView.getRecentsButton() !=null) {
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
}
if (mNavigationBarView.getRecentsButton() !=null) {
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
}
}
}

Expand Down Expand Up @@ -805,18 +803,18 @@ private void prepareNavigationBarView() {
mNavigationBarView.reorient();

if (mNavigationBarView.getRecentsButton() != null){
mNavigationBarView.getRecentsButton().setOnClickListener(mRecentsClickListener);
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
mNavigationBarView.getRecentsButton().setOnClickListener(mRecentsClickListener);
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
}
if (mNavigationBarView.getHomeButton() != null) {
mNavigationBarView.getHomeButton().setOnTouchListener(mHomeSearchActionListener);
mNavigationBarView.getHomeButton().setOnTouchListener(mHomeSearchActionListener);
}
updateSearchPanel();
}

protected void setNavigationBarParams(){
if (mNavigationBarView == null) return;
ContentResolver resolver = mContext.getContentResolver();
if (mNavigationBarView == null) return;
ContentResolver resolver = mContext.getContentResolver();
float opacity = Settings.System.getFloat(resolver, Settings.System.NAVIGATION_BAR_TRANSPARENCY, 0.0f);
mNavigationBarView.getBackground().setAlpha((int) ((1-opacity) * 255));
}
Expand Down Expand Up @@ -1226,7 +1224,7 @@ public void showClock(boolean show) {
clock.setVisibility(show ? View.VISIBLE : View.GONE);
}
if (centerClock && cclock != null) {
cclock.setVisibility(show ? View.VISIBLE : View.GONE);
cclock.setVisibility(show ? View.VISIBLE : View.GONE);
}
}

Expand Down Expand Up @@ -2674,8 +2672,8 @@ void updateResources() {
} catch (IOException e) {
// we're screwed here fellas
}
setStatusBarParams(mStatusBarView);
setNavigationBarParams();
setStatusBarParams(mStatusBarView);
setNavigationBarParams();
} else {

if (mClearButton instanceof TextView) {
Expand Down Expand Up @@ -2842,26 +2840,26 @@ void observe() {
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.EXPANDED_VIEW_WIDGET), false, this);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.HIGH_END_GFX_ENABLED), false, this);
Settings.System.HIGH_END_GFX_ENABLED), false, this);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.STATUS_BAR_TRANSPARENCY), false, this);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.NAVIGATION_BAR_TRANSPARENCY), false, this);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.NOTIF_WALLPAPER_ALPHA), false, this);
Settings.System.NAVIGATION_BAR_TRANSPARENCY), false, this);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.NOTIF_WALLPAPER_ALPHA), false, this);
update();
}

@Override
public void onChange(boolean selfChange) {
updateSettings();
update();
update();
}
public void update() {
ContentResolver resolver = mContext.getContentResolver();
setStatusBarParams(mStatusBarView);
setNavigationBarParams();
setNotificationWallpaperHelper();
setNavigationBarParams();
setNotificationWallpaperHelper();
}
}

Expand Down Expand Up @@ -2944,17 +2942,17 @@ public void updateSettings() {
}

private void setNotificationWallpaperHelper() {
float wallpaperAlpha = Settings.System.getFloat(mContext.getContentResolver(), Settings.System.NOTIF_WALLPAPER_ALPHA, 0.0f);
float wallpaperAlpha = Settings.System.getFloat(mContext.getContentResolver(), Settings.System.NOTIF_WALLPAPER_ALPHA, 0.0f);
File file = new File(NOTIF_WALLPAPER_IMAGE_PATH);

if (file.exists()) {
mNotificationPanel.setBackgroundResource(0);
mNotificationPanel.setBackgroundResource(0);
} else {
mNotificationPanel.setBackgroundResource(R.drawable.notification_panel_bg);
Drawable background = mNotificationPanel.getBackground();
background.setAlpha((int) ((1-wallpaperAlpha) * 255));
Drawable background = mNotificationPanel.getBackground();
background.setAlpha((int) ((1-wallpaperAlpha) * 255));
}
}


}
}

0 comments on commit 55910ee

Please sign in to comment.