Snapdragon浅析

https://source.codeaurora.org/quic/la/platform/packages/apps/SnapdragonGallery/?h=caf/android_ui.lnx.2.0.1-rel-base


TimeLinePage下的数据加载:

GalleryAcitivity.initializeByIntent()

GalleryAcitivity.startTimelinePage()在这里组装media path  “/cluster/{/combo/{/local/all,/picasa/all}}/time”传到TimeLinePage里,然后启动TimeLinePage

TimeLinePage.initializeData(Bundle data)中获取media path

mMediaSet = mActivity.getDataManager().getMediaSet(mMediaSetPath);
DataManager.getMediaSet(Path path)
DataManager.getMediaObject(Path path) 这里的mSourceMap.get(path.getPrefix());通过path的prefix来获取具体是哪个MediaSource的子类;

在initializeSourceMap()里将mSourceMap初始化出来,每个子类初始化时会设置自己的prefix

ClusterSource.createMediaObject(Path path)这里使用ClusterSource子类的createMediaObject(Path path),通过匹配出来的matchType,来创建对应的MediaSource子类ClusterAlbumSet;
DataManager.getMediaSetsFromString(String segment)这里会通过匹配出来的字串,再创建出其他的MediaSource子类ComboSource,LocalSource,PicasaSource,然后在通过matchType创建子类:ComboAlbumSet,LocalAlbumSet,EmptyAlbumSet

mAlbumDataAdapter = new TimeLineDataLoader(mActivity, mMediaSet);这里的mMediaSet是ClusterAlbumSet


TimeLInePage.onResume()中 mAlbumDataAdapter.resume();

TimeLineDataLoader.resume()中启动ReloadTask

ClusterAlbumSet.reload()

ComboAlbumSet.reload()

LocalAlbumSet.reload()

PicasaSource.reload()

updateClusters()
TimeClustering.run(MediaSet baseSet)
MediaSet.enumerateTotalMediaItems(ItemConsumer consumer)
MediaSet.enumerateTotalMediaItems(ItemConsumer consumer, int startIndex)
ClusterAlbum.enumerateMediaItems(ItemConsumer consumer, int startIndex)
DataManager.mapMediaItems(ArrayList<Path> list, ItemConsumer consumer, int startIndex)
LocalSource.mapMediaItems(ArrayList<PathId> list, ItemConsumer consumer)
processMapMediaItems(ArrayList<PathId> list, ItemConsumer consumer, boolean isImage)
getMediaItemById(GalleryApp application, boolean isImage, ArrayList<Integer> ids)
loadOrUpdateItem(Path path, Cursor cursor, DataManager dataManager, GalleryApp app, boolean isImage)


Thumbnail加载:

TimeLinePage.initializeData(Bundle data)中

mAlbumView.setModel(mAlbumDataAdapter);

TimeLineSlotRender.setModel(TimeLineDataLoader model)中

mDataWindow = new TimeLineSlidingWindow(mActivity, model, CACHE_SIZE, mLabelSpec,
                    mSlotView);

TimeLinePage.onResume()中

mAlbumView.resume();

TimeLineSlotRender.resume中

mDataWindow.resume();

TimeLineSlidingWindow.resume()中

prepareSlotContent(i);

TimeLineSlidingWindow.prepareSlotContent(int slotIndex)中

entry.contentLoader = new ThumbnailLoader(slotIndex, entry.item);

TimeLineSlidingWindow.resume()中

updateAllImageRequests();

TimeLineSlidingWindow.updateAllImageRequests()中

for (int i = mActiveStart, n = mActiveEnd; i < n; ++i) {
            if (requestSlotImage(i)) ++mActiveRequestCount;
        }

TimeLineSlidingWindow.requestSlotImage(int slotIndex)

entry.contentLoader.startLoad();

ThumbnailLoader.submitBitmapTask(FutureListener<Bitmap> l)中

LocalVideo.requestImage(int type)

ImageCacheRequest.run()中

通过MPath等信息在ImageCacheService中查找图片,如果cache中存在,直接冲cache中获取,如果不存在,则通过localFilePath去解析图片,并将图片保存到cache中


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值