本文整理汇总了Java中com.google.android.apps.picview.PicViewConfig类的典型用法代码示例。如果您正苦于以下问题:Java PicViewConfig类的具体用法?Java PicViewConfig怎么用?Java PicViewConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PicViewConfig类属于com.google.android.apps.picview包,在下文中一共展示了PicViewConfig类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MultiColumnImageAdapter
import com.google.android.apps.picview.PicViewConfig; //导入依赖的package包/类
/**
* Instantiates a new MultiColumnImageAdapter.
*
* @param dataItems
* the list of data items to display
* @param inflater
* the inflater to be used to inflate the thumbnail slots
* @param listener
* a listener that is notified when an album was clicked on
* @param cachedImageFetcher
* used to fetch the thumbnail images
* @param displayMetrics
* used to determine who many thumbnails can be display on a single
* row
*/
public MultiColumnImageAdapter(List<ThumbnailItem<T>> dataItems,
LayoutInflater inflater, ThumbnailClickListener<T> listener,
CachedImageFetcher cachedImageFetcher, DisplayMetrics displayMetrics) {
this.dataItems = dataItems;
this.inflater = inflater;
this.listener = listener;
this.cachedImageFetcher = cachedImageFetcher;
// Determine how many thumbnails can be put onto one row.
float thumbnailWithPx = PicViewConfig.ALBUM_THUMBNAIL_SIZE
* displayMetrics.density;
slotsPerRow = (int) Math
.floor(displayMetrics.widthPixels / thumbnailWithPx);
Log.d(TAG, "Photos per row: " + slotsPerRow);
slotWidth = displayMetrics.widthPixels / slotsPerRow;
}
示例2: getPathToDb
import com.google.android.apps.picview.PicViewConfig; //导入依赖的package包/类
/**
* Returns a file for the data base with the given name.
*/
protected static File getPathToDb(String dbName) {
String sdCardPath = Environment.getExternalStorageDirectory()
.getAbsolutePath();
return new File(sdCardPath + File.separator + "data" + File.separator
+ PicViewConfig.APP_NAME_PATH + File.separator + dbName);
}