Skip to content

Commit 0f73ac8

Browse files
authored
Merge pull request #899 from Catrobat/release-v2.7.3
Release v2.7.3
2 parents 5d273a7 + 412968c commit 0f73ac8

File tree

118 files changed

+1392
-1075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1392
-1075
lines changed

.github/workflows/sync_crowdin_Paintroid.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ jobs:
4949

5050
- uses: crowdin/github-action@1.0.10
5151
with:
52-
upload_translations: true
52+
upload_sources: true
53+
upload_translations: false
5354
download_translations: true
5455
config: 'crowdin_Paintroid.yml'
5556
env:

.github/workflows/sync_crowdin_colorpicker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ jobs:
4949

5050
- uses: crowdin/github-action@1.0.10
5151
with:
52-
upload_translations: true
52+
upload_sources: true
53+
upload_translations: false
5354
download_translations: true
5455
config: 'crowdin_colorpicker.yml'
5556
env:

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pipeline {
106106
}
107107
post {
108108
always {
109-
junitAndCoverage "$reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml", 'unit', javaSrc
109+
junitAndCoverage "$reports/jacoco/jacocoTestDebugUnitTestReport/jacoco.xml", 'unit', javaSrc
110110
}
111111
}
112112
}

Jenkinsfile.releaseAPK

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pipeline {
3131

3232
// Code coverage
3333
JACOCO_XML = "${env.GRADLE_PROJECT_MODULE_NAME}/build/reports/coverage/debug/report.xml"
34-
JACOCO_UNIT_XML = "${env.GRADLE_PROJECT_MODULE_NAME}/build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml"
34+
JACOCO_UNIT_XML = "${env.GRADLE_PROJECT_MODULE_NAME}/build/reports/jacoco/jacocoTestDebugUnitTestReport/jacoco.xml"
3535

3636
// place the cobertura xml relative to the source, so that the source can be found
3737
JAVA_SRC = "${env.GRADLE_PROJECT_MODULE_NAME}/src/main/java"
@@ -96,33 +96,31 @@ pipeline {
9696
}
9797
}
9898

99-
stage('Approve upload to bintray.com') {
99+
stage('Approve generation of AAR file') {
100100
options {
101101
timeout(time: 60, unit: 'MINUTES')
102102
}
103103
steps {
104104
script {
105-
env.APPROVE_UPLOAD_AAR = input message: 'User input required',
106-
parameters: [choice(name: 'Upload', choices: 'no\nyes',
107-
description: 'Do you want to upload the AAR files to bintray.com?')]
105+
env.APPROVE_AAR = input message: 'User input required',
106+
parameters: [choice(name: 'Generate', choices: 'no\nyes',
107+
description: 'Do you want to generate the AAR file?')]
108108
}
109109
}
110110
}
111111

112-
stage('Bintray upload') {
112+
stage('AAR file') {
113113
when {
114-
environment name: 'APPROVE_UPLOAD_AAR', value: 'yes'
114+
environment name: 'APPROVE_AAR', value: 'yes'
115115
}
116116
steps {
117117
script {
118118
sh '''
119119
set +x
120-
./gradlew bintrayUpload \
121-
-PbintrayUser=$bintrayUser \
122-
-PbintrayKey=$bintrayKey \
123-
-PdryRun=false
120+
./gradlew publishToMavenLocal
124121
'''
125122
}
123+
archiveArtifacts artifacts: '**/*-release.aar'
126124
}
127125
}
128126
}

Paintroid/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ emulators {
4343
}
4444

4545
apply plugin: 'com.android.library'
46-
apply plugin: 'jacoco-android'
46+
apply plugin: 'com.hiya.jacoco-android'
4747
apply plugin: 'checkstyle'
4848
apply plugin: 'pmd'
49-
apply plugin: 'com.novoda.bintray-release'
49+
apply plugin: 'com.github.panpf.bintray-publish'
5050
apply plugin: 'com.getkeepsafe.dexcount'
5151
apply plugin: 'kotlin-android'
5252

@@ -64,6 +64,7 @@ jacocoAndroidUnitTestReport {
6464
csv.enabled false
6565
html.enabled true
6666
xml.enabled true
67+
destination project.getBuildDir().getPath() + "/reports/jacoco/jacocoTestDebugUnitTestReport"
6768
}
6869

6970
android {
@@ -137,8 +138,8 @@ dependencies {
137138
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'
138139
androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0"
139140

140-
pmd 'net.sourceforge.pmd:pmd-core:5.8.1'
141-
pmd 'net.sourceforge.pmd:pmd-java:5.8.1'
141+
pmd 'net.sourceforge.pmd:pmd-core:6.32.0'
142+
pmd 'net.sourceforge.pmd:pmd-java:6.32.0'
142143

143144
checkstyle 'com.puppycrawl.tools:checkstyle:7.6'
144145
}

Paintroid/src/androidTest/java/org/catrobat/paintroid/test/espresso/FileFromOtherSourceIntegrationTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ public class FileFromOtherSourceIntegrationTest {
4949
public static GrantPermissionRule grantPermissionRule = EspressoUtils.grantPermissionRulesVersionCheck();
5050

5151
private ContentResolver resolver;
52+
private MainActivity activity;
5253

5354
@Before
5455
public void setUp() {
5556
onToolBarView().performSelectTool(ToolType.BRUSH);
5657
deletionFileList = new ArrayList<>();
58+
activity = launchActivityRule.getActivity();
5759
resolver = launchActivityRule.getActivity().getContentResolver();
5860
}
5961

@@ -64,7 +66,7 @@ public void testGetSharedPictureFromOtherApp() {
6466
Bitmap receivedBitmap = null;
6567

6668
try {
67-
receivedBitmap = FileIO.getBitmapFromUri(resolver, receivedUri);
69+
receivedBitmap = FileIO.getBitmapFromUri(resolver, receivedUri, activity);
6870
} catch (Exception e) {
6971
Log.e("Can't read", "Can't get Bitmap from File");
7072
}
@@ -93,7 +95,7 @@ public void testGetSharedPictureFromOtherApp() {
9395
Objects.requireNonNull(mainActivityIntentUri);
9496

9597
try {
96-
mainActivityIntentBitmap = FileIO.getBitmapFromUri(resolver, mainActivityIntentUri);
98+
mainActivityIntentBitmap = FileIO.getBitmapFromUri(resolver, mainActivityIntentUri, activity);
9799
} catch (Exception e) {
98100
Log.e("Can't read", "Can't get Bitmap from File");
99101
}

Paintroid/src/androidTest/java/org/catrobat/paintroid/test/espresso/MenuFileActivityIntegrationTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.catrobat.paintroid.MainActivity;
3737
import org.catrobat.paintroid.R;
3838
import org.catrobat.paintroid.common.Constants;
39+
import org.catrobat.paintroid.presenter.MainActivityPresenter;
3940
import org.catrobat.paintroid.test.espresso.util.BitmapLocationProvider;
4041
import org.catrobat.paintroid.test.espresso.util.DrawingSurfaceLocationProvider;
4142
import org.catrobat.paintroid.test.espresso.util.EspressoUtils;
@@ -331,6 +332,9 @@ public void testSaveImage() {
331332
onView(withText(R.string.save_button_text)).perform(click());
332333

333334
assertNotNull(activity.model.getSavedPictureUri());
335+
if (!activity.model.isOpenedFromCatroid()) {
336+
assertNotSame("", MainActivityPresenter.getPathFromUri(this.activity, activity.model.getSavedPictureUri()));
337+
}
334338

335339
addUriToDeletionFileList(activity.model.getSavedPictureUri());
336340
}
@@ -350,9 +354,15 @@ public void testSaveCopy() {
350354

351355
onView(withText(R.string.menu_save_image)).perform(click());
352356

357+
onView(withId(R.id.pocketpaint_image_name_save_text))
358+
.perform(replaceText("save1"));
359+
353360
onView(withText(R.string.save_button_text)).perform(click());
354361

355362
assertNotNull(activity.model.getSavedPictureUri());
363+
if (!activity.model.isOpenedFromCatroid()) {
364+
assertNotSame("", MainActivityPresenter.getPathFromUri(this.activity, activity.model.getSavedPictureUri()));
365+
}
356366

357367
addUriToDeletionFileList(activity.model.getSavedPictureUri());
358368

@@ -368,13 +378,20 @@ public void testSaveCopy() {
368378
.performOpenMoreOptions();
369379

370380
onView(withText(R.string.menu_save_copy)).perform(click());
381+
382+
onView(withId(R.id.pocketpaint_image_name_save_text))
383+
.perform(replaceText("copy1"));
384+
371385
onView(withText(R.string.save_button_text)).perform(click());
372386

373387
File newFile = new File(activity.model.getSavedPictureUri().toString());
374388

375389
assertNotSame("Changes to saved", oldFile, newFile);
376390

377391
assertNotNull(activity.model.getSavedPictureUri());
392+
if (!activity.model.isOpenedFromCatroid()) {
393+
assertNotSame("", MainActivityPresenter.getPathFromUri(this.activity, activity.model.getSavedPictureUri()));
394+
}
378395

379396
addUriToDeletionFileList(activity.model.getSavedPictureUri());
380397
}

Paintroid/src/androidTest/java/org/catrobat/paintroid/test/espresso/ScrollingViewIntegrationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public void testScrollingViewDrawTool() {
9191
);
9292
actionBarHeight = (int) styledAttributes.getDimension(0, 0);
9393

94-
float yMiddle = (surfaceHeight / 2 + actionBarHeight + statusBarHeight);
95-
float yTop = (actionBarHeight + statusBarHeight);
94+
float yMiddle = surfaceHeight / 2 + actionBarHeight + statusBarHeight;
95+
float yTop = actionBarHeight + statusBarHeight;
9696
float yBottom = surfaceHeight + yTop - 1;
9797

9898
PointF middle = new PointF(xMiddle, yMiddle);
@@ -145,8 +145,8 @@ public void testScrollingViewCursorTool() {
145145
float xLeft = 1;
146146
float xMiddle = surfaceWidth / 2;
147147

148-
float yMiddle = (surfaceHeight / 2 + actionBarHeight + statusBarHeight);
149-
float yTop = (actionBarHeight + statusBarHeight);
148+
float yMiddle = surfaceHeight / 2 + actionBarHeight + statusBarHeight;
149+
float yTop = actionBarHeight + statusBarHeight;
150150
float yBottom = surfaceHeight + yTop - 1;
151151

152152
PointF middle = new PointF(xMiddle, yMiddle);
@@ -226,7 +226,7 @@ public void longpressOnPointAndCheckIfCanvasPointHasChangedInXOrY(PointF clickPo
226226

227227
PointF endPointCanvas = perspective.getCanvasPointFromSurfacePoint(startPointSurface);
228228

229-
assertTrue("scrolling did not work", (startPointCanvas.x != endPointCanvas.x) || (startPointCanvas.y != endPointCanvas.y));
229+
assertTrue("scrolling did not work", startPointCanvas.x != endPointCanvas.x || startPointCanvas.y != endPointCanvas.y);
230230
}
231231

232232
public void longpressOnPointAndCheckIfCanvasPointHasNotChanged(PointF clickPoint) {
@@ -303,7 +303,7 @@ public void dragAndCheckIfCanvasHasMovedInXOrY(PointF fromPoint, PointF toPoint)
303303

304304
String message = "startX(" + startPointCanvas.x + ") != endX(" + endPointCanvas.x
305305
+ ") || startY(" + startPointCanvas.y + ") != endY(" + endPointCanvas.y + ")";
306-
assertTrue(message, (startPointCanvas.x != endPointCanvas.x) || (startPointCanvas.y != endPointCanvas.y));
306+
assertTrue(message, startPointCanvas.x != endPointCanvas.x || startPointCanvas.y != endPointCanvas.y);
307307
}
308308

309309
public void dragAndCheckIfCanvasHasNotMoved(PointF fromPoint, PointF toPoint) {

Paintroid/src/androidTest/java/org/catrobat/paintroid/test/espresso/catroid/MoreOptionsIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void testMoreOptionsShareImageClick() {
117117
.checkPixelColor(Color.BLACK, BitmapLocationProvider.MIDDLE);
118118
onTopBarView()
119119
.performOpenMoreOptions();
120-
onView(withText("Share image"))
120+
onView(withText(R.string.share_image_menu))
121121
.perform(click());
122122
UiDevice mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
123123
UiObject uiObject = mDevice.findObject(new UiSelector());

Paintroid/src/androidTest/java/org/catrobat/paintroid/test/espresso/dialog/ColorDialogIntegrationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public void testIfRGBSeekBarsDoChangeColor() {
278278
onView(withId(R.id.color_picker_rgb_alpha_value)).check(matches(
279279
withText(
280280
Integer.toString(
281-
((int) (Color.alpha(currentSelectedColor) / 2.55f))
281+
(int) (Color.alpha(currentSelectedColor) / 2.55f)
282282
)
283283
)
284284
));
@@ -366,7 +366,7 @@ public void testHEXUpdatingOnColorChange() {
366366

367367
onView(withId(R.id.color_picker_color_rgb_hex)).check(matches(
368368
withText(
369-
String.format("#FF%06X", (0xFFFFFF & currentSelectColor)))));
369+
String.format("#FF%06X", 0xFFFFFF & currentSelectColor))));
370370

371371
onView(allOf(withId(R.id.color_picker_tab_icon), withBackground(R.drawable.ic_color_picker_tab_hsv))).perform(click());
372372
onView(withClassName(containsString(TAB_VIEW_HSV_SELECTOR_CLASS))).check(matches(isDisplayed()));
@@ -387,7 +387,7 @@ public void testHEXUpdatingOnColorChange() {
387387

388388
onView(withId(R.id.color_picker_color_rgb_hex)).check(matches(
389389
withText(
390-
String.format("#FF%06X", (0xFFFFFF & currentSelectColor)))));
390+
String.format("#FF%06X", 0xFFFFFF & currentSelectColor))));
391391

392392
onView(withId(R.id.color_picker_color_rgb_seekbar_red)).perform(touchCenterLeft());
393393
onView(withId(R.id.color_picker_color_rgb_seekbar_blue)).perform(touchCenterLeft());
@@ -408,7 +408,7 @@ public void testHEXUpdatingOnColorChange() {
408408

409409
onView(withId(R.id.color_picker_color_rgb_hex)).check(matches(
410410
withText(
411-
String.format("#FF%06X", (0xFFFFFF & currentSelectColor)))));
411+
String.format("#FF%06X", 0xFFFFFF & currentSelectColor))));
412412
}
413413

414414
@Test
@@ -531,7 +531,7 @@ public void testColorPickerInitializesRgbTabTransparentColor() {
531531
onView(withId(R.id.color_picker_rgb_alpha_value)).check(matches(
532532
withText(
533533
Integer.toString(
534-
((int) (Color.alpha(Color.TRANSPARENT) / 2.55f))
534+
(int) (Color.alpha(Color.TRANSPARENT) / 2.55f)
535535
)
536536
)
537537
));
@@ -548,7 +548,7 @@ public void testInsertInvalidHexInputAndSlideSeekbar() {
548548
onView(withId(R.id.color_picker_color_rgb_seekbar_blue)).perform(touchCenterRight());
549549
onView(withId(R.id.color_picker_color_rgb_hex)).check(matches(
550550
withText(
551-
String.format("#FF%06X", (0xFFFFFF & 0xFF0000FF)))));
551+
String.format("#FF%06X", 0xFFFFFF & 0xFF0000FF))));
552552
}
553553

554554
@Test

0 commit comments

Comments
 (0)