Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
Update icon & bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianscar authored and Tianscar committed Jun 26, 2021
1 parent 3f7de3a commit 3132c45
Show file tree
Hide file tree
Showing 34 changed files with 506 additions and 2,354 deletions.
5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId "com.ansdoship.pixelarteditor"
minSdkVersion 16
targetSdkVersion 30
versionCode 2
versionName "0.0.2.3-beta"
versionCode 3
versionName "0.0.3.0-beta"
vectorDrawables {
useSupportLibrary = true
}
Expand All @@ -47,6 +47,8 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.Tianscar:AndroidUtils:1.0.2'
implementation 'com.github.Tianscar:SimpleBitmap:1.0.1b'
implementation 'org.apache.commons.io:commonsIO:2.5.0'
implementation project(path: ':colorpicker')
implementation 'io.noties.markwon:core:4.6.2'
Expand Down
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
766 changes: 453 additions & 313 deletions app/src/main/java/com/ansdoship/pixelarteditor/MainActivity.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

package com.ansdoship.pixelarteditor.editor.graphics;
package com.ansdoship.pixelarteditor.editor;

import android.graphics.Bitmap;
public final class SelectionPopupFlag {

import androidx.annotation.Nullable;
public final static int LEFT = 0;

public class BitmapUtils {
public final static int RIGHT = 1;

private BitmapUtils (){}
public final static int TOP = 2;

public static void recycleBitmap(Bitmap bitmap) {
if (bitmap != null) {
if (!bitmap.isRecycled()) {
bitmap.recycle();
}
}
}

public static void recycleBitmap(@Nullable Bitmap... bitmaps) {
if (bitmaps == null) {
return;
}
for (Bitmap bitmap : bitmaps) {
recycleBitmap(bitmap);
}
}
public final static int BOTTOM = 3;

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class ToolFlag {

public final static int COLORIZE = 5;

public final static class ShapeFlag {
public static final class ShapeFlag {

public final static int LINE = 0;

Expand All @@ -57,9 +57,11 @@ public final static class SelectionFlag {

public final static int NONE = -1;

public final static int CUT = 0;
public final static int SELECTED = 0;

public final static int COPY = 1;
public final static int CUT = 1;

public final static int COPY = 2;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import androidx.annotation.NonNull;

import com.ansdoship.pixelarteditor.editor.graphics.BitmapChanger;
import com.ansdoship.pixelarteditor.editor.graphics.BitmapUtils;
import com.tianscar.simplebitmap.BitmapChanger;
import com.tianscar.simplebitmap.BitmapUtils;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -89,7 +89,7 @@ public void addToolBuffer (@NonNull ToolBuffer toolBuffer) {
}
replaceCacheBitmap(Bitmap.createBitmap(mCacheBitmap));
if (mToolBufferList.get(0).getBufferFlag() == BufferFlag.BITMAP) {
BitmapUtils.recycleBitmap(((BitmapBuffer)(mToolBufferList.get(0))).getBitmap());
BitmapUtils.recycle(((BitmapBuffer)(mToolBufferList.get(0))).getBitmap());
}
mToolBufferList = mToolBufferList.subList(subIndex, size);
}
Expand Down Expand Up @@ -179,7 +179,7 @@ private void replaceCurrentBitmap(Bitmap newBitmap) {
}
Bitmap temp = mCurrentBitmap;
mCurrentBitmap = newBitmap;
BitmapUtils.recycleBitmap(temp);
BitmapUtils.recycle(temp);
}

private void replaceCacheBitmap(Bitmap newBitmap) {
Expand All @@ -188,7 +188,7 @@ private void replaceCacheBitmap(Bitmap newBitmap) {
}
Bitmap temp = mCacheBitmap;
mCacheBitmap = newBitmap;
BitmapUtils.recycleBitmap(temp);
BitmapUtils.recycle(temp);
}

private void drawToolBuffer (@NonNull Bitmap bitmap, @NonNull ToolBuffer toolBuffer) {
Expand Down Expand Up @@ -230,7 +230,7 @@ private void drawToolBuffer (@NonNull Bitmap bitmap, @NonNull ToolBuffer toolBuf
canvas.drawBitmap(selectedBitmap,
((SelectionBuffer) toolBuffer).getDstX(),
((SelectionBuffer) toolBuffer).getDstY(), mBitmapPaint);
BitmapUtils.recycleBitmap(selectedBitmap);
BitmapUtils.recycle(selectedBitmap);
canvas.save();
canvas.restore();
break;
Expand All @@ -251,7 +251,7 @@ private void drawToolBuffer (@NonNull Bitmap bitmap, @NonNull ToolBuffer toolBuf
canvas.drawBitmap(tempBitmap,
((BitmapBuffer) toolBuffer).getX(),
((BitmapBuffer) toolBuffer).getY(), mBitmapPaint);
BitmapUtils.recycleBitmap(tempBitmap);
BitmapUtils.recycle(tempBitmap);
canvas.save();
canvas.restore();
break;
Expand Down
Loading

0 comments on commit 3132c45

Please sign in to comment.