zetbaitsu / Compressor

An android image compression library.
7.08k stars 963 forks source link

Not able to call compress method in Java #138

Closed DevKalpeshSathe closed 4 years ago

DevKalpeshSathe commented 4 years ago

Was trying to implement in java but giving errors. If possible guide for implementation in Java.

Object f = Compressor.INSTANCE.compress(c, new File(finalDestination.getPath()), Dispatchers.getIO(), (Function1<Compression, Unit>) unit -> { return Unit.INSTANCE; }, new Continuation() { @NotNull @Override public CoroutineContext getContext() { return Dispatchers.getIO(); }

        @Override
        public void resumeWith(@NotNull Object o) {
            File file = (File) o;
        }
    });
zetbaitsu commented 4 years ago

For java, you can use older version https://github.com/zetbaitsu/Compressor/blob/master/README_v2.md or try implement using this solution https://github.com/zetbaitsu/Compressor/blob/master/README_v2.md