migrated widgets project so it has nothing unnecessary

project can now be build with android studio or by running the command gradlew build
This commit is contained in:
plamen5kov
2016-07-01 16:17:45 +03:00
parent e0bbb91ec0
commit 5942abc15f
33 changed files with 189 additions and 354 deletions

View File

@@ -1,13 +0,0 @@
package org.nativescript.widgets;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@@ -6,4 +6,4 @@
</application>
</manifest>
</manifest>

View File

@@ -88,7 +88,7 @@ public class Async
OutputStream outStream = connection.getOutputStream();
openedStreams.push(outStream);
OutputStreamWriter writer = new java.io.OutputStreamWriter(outStream);
OutputStreamWriter writer = new OutputStreamWriter(outStream);
openedStreams.push(writer);
writer.write((String) this.content);
@@ -97,7 +97,7 @@ public class Async
public static class RequestResult
{
public static final class ByteArrayOutputStream2 extends java.io.ByteArrayOutputStream
public static final class ByteArrayOutputStream2 extends ByteArrayOutputStream
{
public ByteArrayOutputStream2()
{
@@ -171,7 +171,7 @@ public class Async
openedStreams.push(inStream);
BufferedInputStream buffer = new java.io.BufferedInputStream(inStream, 4096);
BufferedInputStream buffer = new BufferedInputStream(inStream, 4096);
openedStreams.push(buffer);
ByteArrayOutputStream2 responseStream = contentLength != -1 ? new ByteArrayOutputStream2(contentLength) : new ByteArrayOutputStream2();
@@ -363,7 +363,7 @@ public class Async
InputStream stream = null;
try
{
stream = new java.net.URL(params[0]).openStream();
stream = new URL(params[0]).openStream();
Bitmap bmp = BitmapFactory.decodeStream(stream);
return bmp;
}

View File

@@ -159,9 +159,9 @@ public class BorderDrawable extends ColorDrawable {
if (supportsPathOp) {
// Path.Op can be used in API level 19+ to achieve the perfect geometry.
Path backgroundPath = new Path();
backgroundPath.addRoundRect(backgroundBoundsF, outerRadius, outerRadius, android.graphics.Path.Direction.CCW);
backgroundPath.addRoundRect(backgroundBoundsF, outerRadius, outerRadius, Path.Direction.CCW);
Path backgroundNoRepeatPath = new Path();
backgroundNoRepeatPath.addRect(params.posX, params.posY, params.posX + imageWidth, params.posY + imageHeight, android.graphics.Path.Direction.CCW);
backgroundNoRepeatPath.addRect(params.posX, params.posY, params.posX + imageWidth, params.posY + imageHeight, Path.Direction.CCW);
intersect(backgroundPath, backgroundNoRepeatPath);
canvas.drawPath(backgroundPath, backgroundImagePaint);
} else {
@@ -182,26 +182,26 @@ public class BorderDrawable extends ColorDrawable {
borderPaint.setAntiAlias(true);
if (this.clipPath != null && !this.clipPath.isEmpty()) {
borderPaint.setStyle(android.graphics.Paint.Style.STROKE);
borderPaint.setStyle(Paint.Style.STROKE);
borderPaint.setStrokeWidth(borderWidth);
drawClipPath(this.clipPath, canvas, borderPaint, backgroundBoundsF, density);
} else {
if (outerRadius <= 0) {
borderPaint.setStyle(android.graphics.Paint.Style.STROKE);
borderPaint.setStyle(Paint.Style.STROKE);
borderPaint.setStrokeWidth(borderWidth);
canvas.drawRect(middleBoundsF, borderPaint);
} else if (outerRadius >= borderWidth) {
borderPaint.setStyle(android.graphics.Paint.Style.STROKE);
borderPaint.setStyle(Paint.Style.STROKE);
borderPaint.setStrokeWidth(borderWidth);
float middleRadius = Math.max(0, outerRadius - halfBorderWidth);
canvas.drawRoundRect(middleBoundsF, middleRadius, middleRadius, borderPaint);
} else {
Path borderPath = new Path();
RectF borderOuterBoundsF = new RectF(bounds.left, bounds.top, bounds.right, bounds.bottom);
borderPath.addRoundRect(borderOuterBoundsF, outerRadius, outerRadius, android.graphics.Path.Direction.CCW);
borderPath.addRoundRect(borderOuterBoundsF, outerRadius, outerRadius, Path.Direction.CCW);
RectF borderInnerBoundsF = new RectF(bounds.left + borderWidth, bounds.top + borderWidth, bounds.right - borderWidth, bounds.bottom - borderWidth);
borderPath.addRect(borderInnerBoundsF, android.graphics.Path.Direction.CW);
borderPaint.setStyle(android.graphics.Paint.Style.FILL);
borderPath.addRect(borderInnerBoundsF, Path.Direction.CW);
borderPaint.setStyle(Paint.Style.FILL);
canvas.drawPath(borderPath, borderPaint);
}
}
@@ -247,7 +247,7 @@ public class BorderDrawable extends ColorDrawable {
top = cY - rY;
right = (rX * 2) + left;
bottom = (rY * 2) + top;
canvas.drawOval(new android.graphics.RectF(left, top, right, bottom), paint);
canvas.drawOval(new RectF(left, top, right, bottom), paint);
break;
case "polygon":
Path path = new Path();

View File

View File

@@ -1,15 +0,0 @@
package org.nativescript.widgets;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}