0

Can someone help me to know how to call the setTileDecoder() method of TileView Library (moagrius) by passing our own custom decoder .

Pete
  • 57,112
  • 28
  • 117
  • 166
DSM
  • 1
  • 1

2 Answers2

0

You create your own class that implements BitmapDecoder (https://github.com/moagrius/TileView/blob/master/src/com/qozix/tileview/graphics/BitmapDecoder.java), then pass in an instance to TileView.setTileDecoder.

There's a wiki page here: https://github.com/moagrius/TileView/wiki/Tile-Sources

momo
  • 3,885
  • 4
  • 33
  • 54
0

Assume you already have codes to load the tiles from asset folder, now you want to convert it to load from file directory and all you have to do is....create a custom BitmapDecoder and add a line of code.

After you created your custom class which implements BitmapDecoder and has a function call decode and return you a bitmap

public class BitmapDecodeFileDirectory implements BitmapDecoder

You call the setDecoder like this

String whateverYourPath = getFilesDir().toString()
tileView.setDecoder(new BitmapDecodeFileDirectory());
tileView.addDetailLevel(1.000f, whateverYourPath);
NOT_A_PROGRAMMER
  • 1,794
  • 2
  • 20
  • 31