| Chunk |
|---|
| Conflicting content |
|---|
return yBounds;
}
<<<<<<< HEAD
public void adjustNightMode() {
if (QuranSettings.getInstance().isNightMode() && !colorFilterOn) {
setBackgroundColor(Color.BLACK);
float[] matrix = {
-1, 0, 0, 0, 255,
0, -1, 0, 0, 255,
0, 0, -1, 0, 255,
0, 0, 0, 1, 0
};
setColorFilter(new ColorMatrixColorFilter(matrix));
colorFilterOn = true;
} else if (!QuranSettings.getInstance().isNightMode() && colorFilterOn) {
clearColorFilter();
setBackgroundColor(getResources().getColor(R.color.page_background));
colorFilterOn = false;
}
invalidate();
=======
private class PageScalingData {
float screenRatio, pageRatio, scaledPageHeight, scaledPageWidth,
widthFactor, heightFactor, offsetX, offsetY;
public PageScalingData(Drawable page) {
screenRatio = QuranScreenInfo.getInstance().getRatio();
pageRatio = (float) (1.0* page.getIntrinsicHeight()/page.getIntrinsicWidth());
// depending on whether or not you will have a top or bottom offset
if (screenRatio < pageRatio){
scaledPageHeight = getHeight();
scaledPageWidth = (float) (1.0*getHeight()/page.getIntrinsicHeight()*page.getIntrinsicWidth());
} else {
scaledPageWidth = getWidth();
scaledPageHeight = (float)(1.0*getWidth()/page.getIntrinsicWidth()*page.getIntrinsicHeight());
}
widthFactor = scaledPageWidth / page.getIntrinsicWidth();
heightFactor = scaledPageHeight / page.getIntrinsicHeight();
offsetX = (getWidth() - scaledPageWidth)/2;
offsetY = (getHeight() - scaledPageHeight)/2;
}
>>>>>>> f6bdf586faaf6aab7d05794412e48d742229cc5d
}
@Override |
| Solution content |
|---|
return yBounds;
}
public void adjustNightMode() {
if (QuranSettings.getInstance().isNightMode() && !colorFilterOn) {
setBackgroundColor(Color.BLACK);
float[] matrix = {
-1, 0, 0, 0, 255,
0, -1, 0, 0, 255,
0, 0, -1, 0, 255,
0, 0, 0, 1, 0
};
setColorFilter(new ColorMatrixColorFilter(matrix));
colorFilterOn = true;
} else if (!QuranSettings.getInstance().isNightMode() && colorFilterOn) {
clearColorFilter();
setBackgroundColor(getResources().getColor(R.color.page_background));
colorFilterOn = false;
}
invalidate();
}
private class PageScalingData {
float screenRatio, pageRatio, scaledPageHeight, scaledPageWidth,
widthFactor, heightFactor, offsetX, offsetY;
public PageScalingData(Drawable page) {
screenRatio = (1.0f*getHeight())/(1.0f*getWidth());
pageRatio = (float) (1.0* page.getIntrinsicHeight()/page.getIntrinsicWidth());
// depending on whether or not you will have a top or bottom offset
if (screenRatio < pageRatio){
scaledPageHeight = getHeight();
scaledPageWidth = (float) (1.0*getHeight()/page.getIntrinsicHeight()*page.getIntrinsicWidth());
} else {
scaledPageWidth = getWidth();
scaledPageHeight = (float)(1.0*getWidth()/page.getIntrinsicWidth()*page.getIntrinsicHeight());
}
widthFactor = scaledPageWidth / page.getIntrinsicWidth();
heightFactor = scaledPageHeight / page.getIntrinsicHeight();
offsetX = (getWidth() - scaledPageWidth)/2;
offsetY = (getHeight() - scaledPageHeight)/2;
}
}
@Override |
| File |
|---|
| HighlightingImageView.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Attribute |
| Class signature |
| If statement |
| Method declaration |
| Method invocation |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
scaledPageWidth = getWidth();
Bitmap bm = BitmapFactory.decodeResource(
getResources(), R.drawable.highlight);
<<<<<<< HEAD
float screenRatio = (1.0f*getHeight())/(1.0f*getWidth());
float pageRatio = (float) (1.0* page.getIntrinsicHeight()/page.getIntrinsicWidth());
float scaledPageHeight;
float scaledPageWidth;
// depending on whether or not you will have a top or bottom offset
if (screenRatio < pageRatio){
scaledPageHeight = getHeight();
scaledPageWidth = (float) (1.0*getHeight()/page.getIntrinsicHeight()*page.getIntrinsicWidth());
} else {
scaledPageHeight = (float)(1.0*getWidth()/page.getIntrinsicWidth()*page.getIntrinsicHeight());
}
float widthFactor = scaledPageWidth / page.getIntrinsicWidth();
float heightFactor = scaledPageHeight / page.getIntrinsicHeight();
float offsetX = (getWidth() - scaledPageWidth)/2;
float offsetY = (getHeight() - scaledPageHeight)/2;
=======
PageScalingData scalingData = new PageScalingData(page);
>>>>>>> f6bdf586faaf6aab7d05794412e48d742229cc5d
for (AyahBounds b : currentlyHighlighting){
RectF scaled = new RectF(b.getMinX() * scalingData.widthFactor, |
| Solution content |
|---|
Bitmap bm = BitmapFactory.decodeResource(
getResources(), R.drawable.highlight);
PageScalingData scalingData = new PageScalingData(page);
for (AyahBounds b : currentlyHighlighting){
RectF scaled = new RectF(b.getMinX() * scalingData.widthFactor, |
| File |
|---|
| HighlightingImageView.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Cast expression |
| Comment |
| If statement |
| Method invocation |
| Variable |