Code Monkey home page Code Monkey logo

Comments (6)

Eteokles avatar Eteokles commented on May 18, 2024

Maybe you can create an extended class of ImageView with the ColorFilter...

from tileview.

moagrius avatar moagrius commented on May 18, 2024

I've never worked with ColorFilter before, but I believe you can apply it to any drawable.

You might be able to do something wtih a custom implementation of BitmapDecoder, but since that returns a bitmap, not a drawable, it might not work. If you can get it to work here (maybe by decoding the bitmap, wrapping it in a drawable, applying the filter, then getting back the modified bitmap), it'd certainly be the easiest way. Take a look at the BitmapDecoder classes and the [setTileDecoder](http://moagrius.github.io/TileView/com/qozix/tileview/TileView.html#setTileDecoder(com.qozix.tileview.graphics.BitmapDecoder) method.

That said, again, I'm not sure it's possible.

The most efficient way would probably be to hack the core... TileManager is the class that controls (and is the superview) of all Tiles, and is probably where you want to be. The TileManager instance member is a private property, so as I said a hack would be required.

HTH

from tileview.

mcff2 avatar mcff2 commented on May 18, 2024

Hi, my question is in fact not how to use a ColorFilter. As mogrius said, any drawable supports ColorFilter. My question is where to put it.

I put it inside the Tile.render() method, which produces what I wrote above : it works for one second, then the tile gets back its original colors.

from tileview.

moagrius avatar moagrius commented on May 18, 2024

I'd probably try to override TileManager.onDraw and apply the filter there, once (on just the parent, not each tile), but as I said I don't have any experience with ColorFilter so it's just a guess.

from tileview.

moagrius avatar moagrius commented on May 18, 2024

@mcff2 I just had another thought - I can't see any reason why it would work "for a second" then revert, unless it has something to do with the transition. Try tileView.setTransitionsEnabled(false); and see if that helps...

from tileview.

moagrius avatar moagrius commented on May 18, 2024

no response in a few days - i'm going to close the issue for now. @mcff2 post back if you still need help and i'll re-open

from tileview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.