| Chunk |
|---|
| Conflicting content |
|---|
import android.graphics.PorterDuffColorFilter; import android.graphics.PorterDuff; import android.os.Handler; <<<<<<< HEAD import android.preference.PreferenceManager; import android.service.dreams.DreamService; ======= import android.provider.Settings; //import android.service.dreams.Dream; >>>>>>> 9df9aff951dce59b327f56f5821386a7b40798bd import android.util.Log; import android.view.View; import android.view.animation.AccelerateInterpolator; |
| Solution content |
|---|
import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.os.Handler; import android.preference.PreferenceManager; import android.service.dreams.DreamService; import android.util.Log; import android.view.View; import android.view.animation.AccelerateInterpolator; |
| File |
|---|
| Screensaver.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
<<<<<<< HEAD
import com.android.deskclock.Utils.ScreensaverMoveSaverRunnable;
public class Screensaver extends DreamService {
=======
public class Screensaver { //extends Dream {
>>>>>>> 9df9aff951dce59b327f56f5821386a7b40798bd
static final boolean DEBUG = false;
static final String TAG = "DeskClock/Screensaver";
|
| Solution content |
|---|
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import com.android.deskclock.Utils.ScreensaverMoveSaverRunnable;
public class Screensaver extends DreamService {
static final boolean DEBUG = false;
static final String TAG = "DeskClock/Screensaver";
|
| File |
|---|
| Screensaver.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Class signature |
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
static final String TAG = "DeskClock/Screensaver";
private View mContentView, mSaverView;
<<<<<<< HEAD
private View mAnalogClock, mDigitalClock;
private String mDateFormat;
private String mDateFormatForAccessibility;
=======
private TextView mAlarmButton;
private static TimeInterpolator mSlowStartWithBrakes =
new TimeInterpolator() {
@Override
public float getInterpolation(float x) {
return (float)(Math.cos((Math.pow(x,3) + 1) * Math.PI) / 2.0f) + 0.5f;
}
};
private final Handler mHandler = new Handler();
private boolean mPlugged = false;
private final BroadcastReceiver mPowerIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
// Only keep the screen on if we're plugged in.
boolean plugged = (0 != intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0));
if (plugged != mPlugged) {
if (DEBUG) Log.v(TAG, plugged ? "plugged in" : "unplugged");
mPlugged = plugged;
if (mPlugged) {
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
} else {
// getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
}
}
}
};
/*
private final Runnable mMoveSaverRunnable = new Runnable() {
@Override
public void run() {
long delay = MOVE_DELAY;
if (DEBUG) Log.d(TAG,
String.format("mContentView=(%d x %d) container=(%d x %d)",
mContentView.getWidth(), mContentView.getHeight(),
mSaverView.getWidth(), mSaverView.getHeight()
));
final float xrange = mContentView.getWidth() - mSaverView.getWidth();
final float yrange = mContentView.getHeight() - mSaverView.getHeight();
if (xrange == 0 && yrange == 0) {
delay = 500; // back in a split second
} else {
final int nextx = (int) (Math.random() * xrange);
final int nexty = (int) (Math.random() * yrange);
>>>>>>> 9df9aff951dce59b327f56f5821386a7b40798bd
private final Handler mHandler = new Handler();
|
| Solution content |
|---|
static final String TAG = "DeskClock/Screensaver";
private View mContentView, mSaverView;
private View mAnalogClock, mDigitalClock;
private String mDateFormat;
private String mDateFormatForAccessibility;
private final Handler mHandler = new Handler();
|
| File |
|---|
| Screensaver.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
private final Handler mHandler = new Handler();
<<<<<<< HEAD
private final ScreensaverMoveSaverRunnable mMoveSaverRunnable;
=======
Animator xShrink = ObjectAnimator.ofFloat(mSaverView, "scaleX", 1f, 0.85f);
Animator xGrow = ObjectAnimator.ofFloat(mSaverView, "scaleX", 0.85f, 1f);
Animator yShrink = ObjectAnimator.ofFloat(mSaverView, "scaleY", 1f, 0.85f);
Animator yGrow = ObjectAnimator.ofFloat(mSaverView, "scaleY", 0.85f, 1f);
AnimatorSet shrink = new AnimatorSet(); shrink.play(xShrink).with(yShrink);
AnimatorSet grow = new AnimatorSet(); grow.play(xGrow).with(yGrow);
Animator fadeout = ObjectAnimator.ofFloat(mSaverView, "alpha", 1f, 0f);
Animator fadein = ObjectAnimator.ofFloat(mSaverView, "alpha", 0f, 1f);
if (SLIDE) {
s.play(xMove).with(yMove);
s.setDuration(SLIDE_TIME);
s.play(shrink.setDuration(SLIDE_TIME/2));
s.play(grow.setDuration(SLIDE_TIME/2)).after(shrink);
s.setInterpolator(mSlowStartWithBrakes);
} else {
AccelerateInterpolator accel = new AccelerateInterpolator();
DecelerateInterpolator decel = new DecelerateInterpolator();
shrink.setDuration(FADE_TIME).setInterpolator(accel);
fadeout.setDuration(FADE_TIME).setInterpolator(accel);
grow.setDuration(FADE_TIME).setInterpolator(decel);
fadein.setDuration(FADE_TIME).setInterpolator(decel);
s.play(shrink);
s.play(fadeout);
s.play(xMove.setDuration(0)).after(FADE_TIME);
s.play(yMove.setDuration(0)).after(FADE_TIME);
s.play(fadein).after(FADE_TIME);
s.play(grow).after(FADE_TIME);
}
s.start();
}
long now = System.currentTimeMillis();
long adjust = (now % 60000);
delay = delay
+ (MOVE_DELAY - adjust) // minute aligned
- (SLIDE ? 0 : FADE_TIME) // start moving before the fade
;
if (DEBUG) Log.d(TAG,
"will move again in " + delay + " now=" + now + " adjusted by " + adjust);
}
mHandler.removeCallbacks(this);
mHandler.postDelayed(this, delay);
}
};
*/
>>>>>>> 9df9aff951dce59b327f56f5821386a7b40798bd
public Screensaver() {
if (DEBUG) Log.d(TAG, "Screensaver allocated");
mMoveSaverRunnable = new ScreensaverMoveSaverRunnable(mHandler); |
| Solution content |
|---|
private final Handler mHandler = new Handler();
private final ScreensaverMoveSaverRunnable mMoveSaverRunnable;
public Screensaver() {
if (DEBUG) Log.d(TAG, "Screensaver allocated");
mMoveSaverRunnable = new ScreensaverMoveSaverRunnable(mHandler); |
| File |
|---|
| Screensaver.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| Chunk |
|---|
| Conflicting content |
|---|
if (DEBUG) Log.d(TAG, "Screensaver created");
super.onCreate();
<<<<<<< HEAD
mDateFormat = getString(R.string.abbrev_wday_month_day_no_year);
mDateFormatForAccessibility = getString(R.string.full_wday_month_day_no_year);
=======
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
// Hack: we want this to be *mostly* non-interactive, but still allow the user to click
// on the alarms button. The Dream class doesn't make this super easy right now, so
// we want to skip over Dream.dispatchTouchEvent() (which would finish() the saver
// immediately in non-interactive mode) and handle touches ourself.
return getWindow().superDispatchTouchEvent(event);
}
@Override
public void onStart() {
if (DEBUG) Log.d(TAG, "Screensaver started");
super.onStart();
// We want the screen saver to exit upon user interaction.
setInteractive(false);
// However, we *do* actually want to trap some touch events, so
// see dispatchTouchEvent above
// XXX: should be done by Dream base class
final IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
registerReceiver(mPowerIntentReceiver, filter);
>>>>>>> 9df9aff951dce59b327f56f5821386a7b40798bd
}
@Override |
| Solution content |
|---|
if (DEBUG) Log.d(TAG, "Screensaver created");
super.onCreate();
mDateFormat = getString(R.string.abbrev_wday_month_day_no_year);
mDateFormatForAccessibility = getString(R.string.full_wday_month_day_no_year);
}
@Override |
| File |
|---|
| Screensaver.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
Utils.updateDate(mDateFormat, mDateFormatForAccessibility,mContentView);
Utils.refreshAlarm(Screensaver.this, mContentView);
}
<<<<<<< HEAD
=======
*/
>>>>>>> 9df9aff951dce59b327f56f5821386a7b40798bd
} |
| Solution content |
|---|
Utils.updateDate(mDateFormat, mDateFormatForAccessibility,mContentView);
Utils.refreshAlarm(Screensaver.this, mContentView);
}
} |
| File |
|---|
| Screensaver.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Other |