--- a/mobile/android/base/LightweightThemeDrawable.java
+++ b/mobile/android/base/LightweightThemeDrawable.java
@@ -48,18 +48,19 @@ public class LightweightThemeDrawable ex
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
initializeBitmapShader();
}
@Override
public void draw(Canvas canvas) {
// Draw the colors, if available.
- if (mColorPaint != null)
+ if (mColorPaint != null) {
canvas.drawPaint(mColorPaint);
+ }
// Draw the bitmap.
canvas.drawPaint(mPaint);
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
@@ -70,17 +71,17 @@ public class LightweightThemeDrawable ex
// A StateListDrawable will reset the alpha value with 255.
// We cannot use to be the bitmap alpha.
mPaint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter filter) {
mPaint.setColorFilter(filter);
- }
+ }
/**
* Creates a paint that paint a particular color.
*
* @param color The color to be painted.
*/
public void setColor(int color) {
mColorPaint = new Paint(mPaint);
@@ -107,22 +108,22 @@ public class LightweightThemeDrawable ex
*/
public void setAlpha(int startAlpha, int endAlpha) {
mStartColor = startAlpha << 24;
mEndColor = endAlpha << 24;
initializeBitmapShader();
}
private void initializeBitmapShader() {
- // A bitmap-shader to draw the bitmap.
+ // A bitmap-shader to draw the bitmap.
// Clamp mode will repeat the last row of pixels.
// Hence its better to have an endAlpha of 0 for the linear-gradient.
- BitmapShader bitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
+ BitmapShader bitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
- // A linear-gradient to specify the opacity of the bitmap.
- LinearGradient gradient = new LinearGradient(0, 0, 0, mBitmap.getHeight(), mStartColor, mEndColor, Shader.TileMode.CLAMP);
+ // A linear-gradient to specify the opacity of the bitmap.
+ LinearGradient gradient = new LinearGradient(0, 0, 0, mBitmap.getHeight(), mStartColor, mEndColor, Shader.TileMode.CLAMP);
- // Make a combined shader -- a performance win.
+ // Make a combined shader -- a performance win.
// The linear-gradient is the 'SRC' and the bitmap-shader is the 'DST'.
- // Drawing the DST in the SRC will provide the opacity.
- mPaint.setShader(new ComposeShader(bitmapShader, gradient, PorterDuff.Mode.DST_IN));
+ // Drawing the DST in the SRC will provide the opacity.
+ mPaint.setShader(new ComposeShader(bitmapShader, gradient, PorterDuff.Mode.DST_IN));
}
}
--- a/mobile/android/base/TextSelection.java
+++ b/mobile/android/base/TextSelection.java
@@ -184,21 +184,21 @@ class TextSelection extends Layer implem
} catch (JSONException e) {
Log.e(LOGTAG, "JSON exception", e);
}
}
});
}
private void showActionMode(final JSONArray items) {
- String itemsString = items.toString();
- if (itemsString.equals(mCurrentItems)) {
- return;
- }
- mCurrentItems = itemsString;
+ String itemsString = items.toString();
+ if (itemsString.equals(mCurrentItems)) {
+ return;
+ }
+ mCurrentItems = itemsString;
if (mCallback != null) {
mCallback.updateItems(items);
return;
}
final Context context = mStartHandle.getContext();
if (context instanceof ActionModeCompat.Presenter) {
@@ -209,17 +209,17 @@ class TextSelection extends Layer implem
}
private void endActionMode() {
Context context = mStartHandle.getContext();
if (context instanceof ActionModeCompat.Presenter) {
final ActionModeCompat.Presenter presenter = (ActionModeCompat.Presenter) context;
presenter.endActionModeCompat();
}
- mCurrentItems = null;
+ mCurrentItems = null;
}
@Override
public void draw(final RenderContext context) {
// cache the relevant values from the context and bail out if they are the same. we do this
// because this draw function gets called a lot (once per compositor frame) and we want to
// avoid doing a lot of extra work in cases where it's not needed.
final float viewLeft = context.viewport.left - context.offset.x;
--- a/mobile/android/base/animation/ViewHelper.java
+++ b/mobile/android/base/animation/ViewHelper.java
@@ -2,61 +2,61 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.animation;
import android.view.View;
public final class ViewHelper {
- private ViewHelper() {
- }
+ private ViewHelper() {
+ }
- public static float getTranslationX(View view) {
- AnimatorProxy proxy = AnimatorProxy.create(view);
- return proxy.getTranslationX();
- }
+ public static float getTranslationX(View view) {
+ AnimatorProxy proxy = AnimatorProxy.create(view);
+ return proxy.getTranslationX();
+ }
- public static void setTranslationX(View view, float translationX) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- proxy.setTranslationX(translationX);
- }
+ public static void setTranslationX(View view, float translationX) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ proxy.setTranslationX(translationX);
+ }
- public static float getTranslationY(View view) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- return proxy.getTranslationY();
- }
+ public static float getTranslationY(View view) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ return proxy.getTranslationY();
+ }
- public static void setTranslationY(View view, float translationY) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- proxy.setTranslationY(translationY);
- }
+ public static void setTranslationY(View view, float translationY) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ proxy.setTranslationY(translationY);
+ }
- public static float getAlpha(View view) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- return proxy.getAlpha();
- }
+ public static float getAlpha(View view) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ return proxy.getAlpha();
+ }
- public static void setAlpha(View view, float alpha) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- proxy.setAlpha(alpha);
- }
+ public static void setAlpha(View view, float alpha) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ proxy.setAlpha(alpha);
+ }
- public static int getWidth(View view) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- return proxy.getWidth();
- }
+ public static int getWidth(View view) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ return proxy.getWidth();
+ }
- public static void setWidth(View view, int width) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- proxy.setWidth(width);
- }
+ public static void setWidth(View view, int width) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ proxy.setWidth(width);
+ }
- public static int getHeight(View view) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- return proxy.getHeight();
- }
+ public static int getHeight(View view) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ return proxy.getHeight();
+ }
- public static void setHeight(View view, int height) {
- final AnimatorProxy proxy = AnimatorProxy.create(view);
- proxy.setHeight(height);
- }
+ public static void setHeight(View view, int height) {
+ final AnimatorProxy proxy = AnimatorProxy.create(view);
+ proxy.setHeight(height);
+ }
}
--- a/mobile/android/base/background/preferences/PreferenceManagerCompat.java
+++ b/mobile/android/base/background/preferences/PreferenceManagerCompat.java
@@ -27,17 +27,17 @@ import android.content.Context;
import android.content.Intent;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.util.Log;
public class PreferenceManagerCompat {
- private static final String TAG = PreferenceManagerCompat.class.getSimpleName();
+ private static final String TAG = PreferenceManagerCompat.class.getSimpleName();
/**
* Interface definition for a callback to be invoked when a
* {@link Preference} in the hierarchy rooted at this {@link PreferenceScreen} is
* clicked.
*/
interface OnPreferenceTreeClickListener {
/**
@@ -47,185 +47,185 @@ public class PreferenceManagerCompat {
* @param preferenceScreen The {@link PreferenceScreen} that the
* preference is located in.
* @param preference The preference that was clicked.
* @return Whether the click was handled.
*/
boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference);
}
- static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
- try {
- Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
- c.setAccessible(true);
- return c.newInstance(activity, firstRequestCode);
- } catch (Exception e) {
- Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
- }
- return null;
- }
+ static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
+ try {
+ Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
+ c.setAccessible(true);
+ return c.newInstance(activity, firstRequestCode);
+ } catch (Exception e) {
+ Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
+ }
+ return null;
+ }
- /**
+ /**
* Sets the owning preference fragment
*/
static void setFragment(PreferenceManager manager, PreferenceFragment fragment) {
- // stub
+ // stub
}
/**
* Sets the callback to be invoked when a {@link Preference} in the
* hierarchy rooted at this {@link PreferenceManager} is clicked.
*
* @param listener The callback to be invoked.
*/
- static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
- try {
- Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
- onPreferenceTreeClickListener.setAccessible(true);
- if (listener != null) {
- Object proxy = Proxy.newProxyInstance(
- onPreferenceTreeClickListener.getType().getClassLoader(),
- new Class<?>[] { onPreferenceTreeClickListener.getType() },
- new InvocationHandler() {
- @Override
+ static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
+ try {
+ Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
+ onPreferenceTreeClickListener.setAccessible(true);
+ if (listener != null) {
+ Object proxy = Proxy.newProxyInstance(
+ onPreferenceTreeClickListener.getType().getClassLoader(),
+ new Class<?>[] { onPreferenceTreeClickListener.getType() },
+ new InvocationHandler() {
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) {
- if (method.getName().equals("onPreferenceTreeClick")) {
- return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
- } else {
- return null;
- }
- }
- });
- onPreferenceTreeClickListener.set(manager, proxy);
- } else {
- onPreferenceTreeClickListener.set(manager, null);
- }
- } catch (Exception e) {
- Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
- }
- }
+ if (method.getName().equals("onPreferenceTreeClick")) {
+ return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
+ } else {
+ return null;
+ }
+ }
+ });
+ onPreferenceTreeClickListener.set(manager, proxy);
+ } else {
+ onPreferenceTreeClickListener.set(manager, null);
+ }
+ } catch (Exception e) {
+ Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
+ }
+ }
- /**
+ /**
* Inflates a preference hierarchy from the preference hierarchies of
* {@link Activity Activities} that match the given {@link Intent}. An
* {@link Activity} defines its preference hierarchy with meta-data using
* the {@link #METADATA_KEY_PREFERENCES} key.
* <p>
* If a preference hierarchy is given, the new preference hierarchies will
* be merged in.
*
* @param queryIntent The intent to match activities.
* @param rootPreferences Optional existing hierarchy to merge the new
* hierarchies into.
* @return The root hierarchy (if one was not provided, the new hierarchy's
* root).
*/
- static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
- try {
+ static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
+ try {
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
m.setAccessible(true);
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, intent, screen);
return prefScreen;
} catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
- }
- return null;
- }
+ Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
+ }
+ return null;
+ }
- /**
+ /**
* Inflates a preference hierarchy from XML. If a preference hierarchy is
* given, the new preference hierarchies will be merged in.
*
* @param context The context of the resource.
* @param resId The resource ID of the XML to inflate.
* @param rootPreferences Optional existing hierarchy to merge the new
* hierarchies into.
* @return The root hierarchy (if one was not provided, the new hierarchy's
* root).
* @hide
*/
- static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
- try {
+ static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
+ try {
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
m.setAccessible(true);
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, activity, resId, screen);
return prefScreen;
} catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
- }
- return null;
- }
+ Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
+ }
+ return null;
+ }
- /**
+ /**
* Returns the root of the preference hierarchy managed by this class.
*
* @return The {@link PreferenceScreen} object that is at the root of the hierarchy.
*/
- static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
- try {
+ static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
+ try {
Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen");
m.setAccessible(true);
return (PreferenceScreen) m.invoke(manager);
} catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
- }
- return null;
- }
+ Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
+ }
+ return null;
+ }
- /**
+ /**
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
*/
- static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
- try {
+ static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
+ try {
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
m.setAccessible(true);
m.invoke(manager, requestCode, resultCode, data);
} catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
- }
- }
+ Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
+ }
+ }
- /**
+ /**
* Called by the {@link PreferenceManager} to dispatch the activity stop
* event.
*/
- static void dispatchActivityStop(PreferenceManager manager) {
- try {
+ static void dispatchActivityStop(PreferenceManager manager) {
+ try {
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop");
m.setAccessible(true);
m.invoke(manager);
} catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityStop by reflection", e);
- }
- }
+ Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityStop by reflection", e);
+ }
+ }
- /**
+ /**
* Called by the {@link PreferenceManager} to dispatch the activity destroy
* event.
*/
- static void dispatchActivityDestroy(PreferenceManager manager) {
- try {
- Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
- m.setAccessible(true);
- m.invoke(manager);
- } catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
- }
- }
+ static void dispatchActivityDestroy(PreferenceManager manager) {
+ try {
+ Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
+ m.setAccessible(true);
+ m.invoke(manager);
+ } catch (Exception e) {
+ Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
+ }
+ }
- /**
+ /**
* Sets the root of the preference hierarchy.
*
* @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
* @return Whether the {@link PreferenceScreen} given is different than the previous.
*/
- static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
- try {
- Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
- m.setAccessible(true);
- return ((Boolean) m.invoke(manager, screen));
- } catch (Exception e) {
- Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
- }
- return false;
- }
+ static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
+ try {
+ Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
+ m.setAccessible(true);
+ return ((Boolean) m.invoke(manager, screen));
+ } catch (Exception e) {
+ Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
+ }
+ return false;
+ }
}
--- a/mobile/android/base/prompts/ColorPickerInput.java
+++ b/mobile/android/base/prompts/ColorPickerInput.java
@@ -49,11 +49,11 @@ public class ColorPickerInput extends Pr
@Override
public boolean getScrollable() {
return true;
}
@Override
public boolean canApplyInputStyle() {
- return false;
+ return false;
}
}
--- a/mobile/android/base/tests/helpers/AssertionHelper.java
+++ b/mobile/android/base/tests/helpers/AssertionHelper.java
@@ -94,19 +94,19 @@ public final class AssertionHelper {
sAsserter.ok(expected == actual, message, DIAG_STRING);
}
public static void fAssertTrue(final String message, final boolean actual) {
sAsserter.ok(actual, message, DIAG_STRING);
}
public static void fAssertIsPixel(final String message, final int actual, final int r, final int g, final int b) {
- sAsserter.ispixel(actual, r, g, b, message);
+ sAsserter.ispixel(actual, r, g, b, message);
}
public static void fAssertIsNotPixel(final String message, final int actual, final int r, final int g, final int b) {
- sAsserter.isnotpixel(actual, r, g, b, message);
+ sAsserter.isnotpixel(actual, r, g, b, message);
}
public static void fFail(final String message) {
sAsserter.ok(false, message, DIAG_STRING);
}
}
--- a/mobile/android/base/updater/UpdateService.java
+++ b/mobile/android/base/updater/UpdateService.java
@@ -388,20 +388,20 @@ public class UpdateService extends Inten
if (downloadFile != null)
notificationIntent.putExtra(UpdateServiceHelper.EXTRA_PACKAGE_PATH_NAME, downloadFile.getAbsolutePath());
PendingIntent contentIntent = PendingIntent.getService(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent deleteIntent = PendingIntent.getService(this, 0, cancelIntent, PendingIntent.FLAG_CANCEL_CURRENT);
mBuilder = new NotificationCompat.Builder(this);
mBuilder.setContentTitle(getResources().getString(R.string.updater_downloading_title))
- .setContentText(mApplyImmediately ? "" : getResources().getString(R.string.updater_downloading_select))
- .setSmallIcon(android.R.drawable.stat_sys_download)
- .setContentIntent(contentIntent)
- .setDeleteIntent(deleteIntent);
+ .setContentText(mApplyImmediately ? "" : getResources().getString(R.string.updater_downloading_select))
+ .setSmallIcon(android.R.drawable.stat_sys_download)
+ .setContentIntent(contentIntent)
+ .setDeleteIntent(deleteIntent);
mBuilder.setProgress(100, 0, true);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
private void showDownloadFailure() {
Notification notification = new Notification(R.drawable.ic_status_logo, null, System.currentTimeMillis());
@@ -475,20 +475,20 @@ public class UpdateService extends Inten
int bytesRead = 0;
int lastNotify = 0;
while ((len = input.read(buf, 0, BUFSIZE)) > 0 && !mCancelDownload) {
output.write(buf, 0, len);
bytesRead += len;
// Updating the notification takes time so only do it every 1MB
- if(bytesRead - lastNotify > 1048576) {
- mBuilder.setProgress(length, bytesRead, false);
- mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
- lastNotify = bytesRead;
+ if (bytesRead - lastNotify > 1048576) {
+ mBuilder.setProgress(length, bytesRead, false);
+ mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
+ lastNotify = bytesRead;
}
}
mNotificationManager.cancel(NOTIFICATION_ID);
// if the download was canceled by the user
// delete the update package
if (mCancelDownload) {
--- a/mobile/android/base/widget/TabThumbnailWrapper.java
+++ b/mobile/android/base/widget/TabThumbnailWrapper.java
@@ -23,17 +23,17 @@ public class TabThumbnailWrapper extends
}
@Override
public int[] onCreateDrawableState(int extraSpace) {
final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
if (mRecording) {
mergeDrawableStates(drawableState, STATE_RECORDING);
- }
+ }
return drawableState;
}
public void setRecording(boolean recording) {
if (mRecording != recording) {
mRecording = recording;
refreshDrawableState();
}