-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove rxjava dependency, shrink plugin size
- Loading branch information
Showing
3 changed files
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,6 @@ import com.intellij.openapi.vfs.VirtualFile | |
import com.intellij.openapi.vfs.VirtualFileVisitor | ||
import com.tinify.Tinify | ||
import org.apache.commons.lang.StringUtils | ||
import rx.Observable | ||
import rx.schedulers.Schedulers | ||
import java.io.IOException | ||
import java.util.* | ||
import java.util.concurrent.Executors | ||
|
@@ -31,7 +29,7 @@ import java.util.concurrent.Executors | |
* Created by alvince on 2017/6/28. | ||
* | ||
* @author [email protected] | ||
* @version 1.0.1, 7/21/2017 | ||
* @version 1.0.1, 1/21/2018 | ||
* @since 1.0 | ||
*/ | ||
class TinyPicUploadAction : TinifyAction() { | ||
|
@@ -60,14 +58,7 @@ class TinyPicUploadAction : TinifyAction() { | |
tinifySource.clear() | ||
val descriptor = FileChooserDescriptor(true, true, false, false, false, true) | ||
val selectedFiles = FileChooser.chooseFiles(descriptor, project, project.baseDir) | ||
Observable.just(selectedFiles) | ||
.subscribeOn(Schedulers.io()) | ||
.filter { selectedFiles.isNotEmpty() } | ||
.subscribe({ | ||
selectedFiles.forEach { parseFilePicked(it) } | ||
// logger.debug("${tinifySource.toArray()}") | ||
uploadAndTinify() | ||
}, { it.printStackTrace() }) | ||
FilePickTask(selectedFiles).start() | ||
} | ||
|
||
@Suppress("name_shadowing") | ||
|
@@ -109,6 +100,16 @@ class TinyPicUploadAction : TinifyAction() { | |
} | ||
|
||
|
||
internal inner class FilePickTask(private val files: Array<VirtualFile>) : Thread() { | ||
override fun run() { | ||
super.run() | ||
if (files.isNotEmpty()) { | ||
files.forEach { parseFilePicked(it) } | ||
uploadAndTinify() | ||
} | ||
} | ||
} | ||
|
||
internal inner class TaskRunnable(file: VirtualFile) : Runnable { | ||
private val name: String = file.path | ||
private val flowable: TinifyFlowable = TinifyFlowable(file) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<idea-plugin> | ||
<id>com.alvincezy.TinyPic2</id> | ||
<name>Tinify Picture</name> | ||
<version>1.0.1</version> | ||
<version>1.0.2</version> | ||
<vendor email="[email protected]" url="https://github.com/alvince/TinyPic2">alvince</vendor> | ||
|
||
<description><![CDATA[ | ||
|
@@ -26,7 +26,8 @@ | |
]]></description> | ||
|
||
<change-notes><![CDATA[ | ||
Fix compat android studio.<br/> | ||
<h3>1.0.2 - Shrink plugin size</h3> | ||
<h3>1.0.1 - Fix compat android studio</h3> | ||
]]> | ||
</change-notes> | ||
|
||
|