use of com.aviary.android.feather.widget.HorizontalVariableListView in project mobile-android by photo.
the class StickersPanel method onCreate.
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bitmap bitmap) {
super.onCreate(bitmap);
mStatus = new SimpleStatusMachine();
// determine if the external packs are enabled
mExternalPacksEnabled = Constants.getExternalStickersEnabled();
// init layout components
mListPacks = (HorizontalVariableListView) getOptionView().findViewById(R.id.list_packs);
mListStickers = (HorizontalVariableListView) getOptionView().findViewById(R.id.list_stickers);
mViewFlipper = (ViewFlipper) getOptionView().findViewById(R.id.flipper);
mImageView = (ImageViewDrawableOverlay) getContentView().findViewById(R.id.overlay);
// init services
mPluginService = getContext().getService(PluginService.class);
mConfigService = getContext().getService(ConfigService.class);
mPreferenceService = getContext().getService(PreferenceService.class);
mCacheService = getContext().getService(ImageCacheService.class);
// TODO: only for testing
// mCacheService.deleteCache();
// setup the main horizontal listview
mListPacks.setGravity(Gravity.BOTTOM);
mListPacks.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
mListPacks.setEdgeGravityY(Gravity.BOTTOM);
// setup the stickers listview
mListStickers.setGravity(Gravity.BOTTOM);
mListStickers.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
mListStickers.setEdgeGravityY(Gravity.BOTTOM);
// setup the main imageview
((ImageViewDrawableOverlay) mImageView).setForceSingleSelection(false);
((ImageViewDrawableOverlay) mImageView).setDropTargetListener(this);
((ImageViewDrawableOverlay) mImageView).setScaleWithContent(true);
// create the default action list
mActionList = MoaActionFactory.actionList();
// load the configuration for the sticker drawable
mStickerHvEllipse = mConfigService.getInteger(R.integer.feather_sticker_highlight_ellipse);
mStickerHvStrokeWidth = mConfigService.getInteger(R.integer.feather_sticker_highlight_stroke_width);
mStickerHvStrokeColorStateList = mConfigService.getColorStateList(R.color.feather_sticker_color_stroke_selector);
mStickerHvFillColorStateList = mConfigService.getColorStateList(R.color.feather_sticker_color_fill_selector);
mStickerHvMinSize = mConfigService.getInteger(R.integer.feather_sticker_highlight_minsize);
mStickerHvPadding = mConfigService.getInteger(R.integer.feather_sticker_highlight_padding);
mFeaturedCount = mConfigService.getInteger(R.integer.feather_featured_count);
mFeaturedDefaultTitle = mConfigService.getString(R.string.feather_featured);
// update the background drawable
View content = getOptionView().findViewById(R.id.background);
content.setBackgroundDrawable(RepeatableHorizontalDrawable.createFromView(content));
mImageManager = new AsyncImageManager();
// create the preview for the main imageview
createAndConfigurePreview();
if (android.os.Build.VERSION.SDK_INT > 8) {
DragControllerService dragger = getContext().getService(DragControllerService.class);
dragger.addDropTarget((DropTarget) mImageView);
dragger.setMoveTarget(mImageView);
dragger.setDragListener(this);
// TODO: remember to activate this!
// dragger.activate();
setDragController(dragger);
}
}
use of com.aviary.android.feather.widget.HorizontalVariableListView in project mobile-android by photo.
the class BordersPanel method onCreate.
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bitmap bitmap) {
super.onCreate(bitmap);
mImageManager = new AsyncImageManager(1);
mThumbnailOptions = new Options();
mThumbnailOptions.inPreferredConfig = Config.RGB_565;
mPluginService = getContext().getService(PluginService.class);
mCacheService = getContext().getService(ImageCacheService.class);
mPreferenceService = getContext().getService(PreferenceService.class);
if (mPluginType == FeatherIntent.PluginType.TYPE_FILTER)
mExternalPacksEnabled = Constants.getValueFromIntent(Constants.EXTRA_EFFECTS_ENABLE_EXTERNAL_PACKS, true);
else
mExternalPacksEnabled = Constants.getValueFromIntent(Constants.EXTRA_FRAMES_ENABLE_EXTERNAL_PACKS, true);
mViewFlipper = (ViewFlipper) getOptionView().findViewById(R.id.flipper);
mHList = (HorizontalVariableListView) getOptionView().findViewById(R.id.list);
mHList.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
mPreview = BitmapUtils.copy(mBitmap, Bitmap.Config.ARGB_8888);
// ImageView Switcher setup
mImageSwitcher = (ImageSwitcher) getContentView().findViewById(R.id.switcher);
initContentImage(mImageSwitcher);
// Horizontal list setup
mHList.setOnScrollListener(this);
View content = getOptionView().findViewById(R.id.background);
content.setBackgroundDrawable(RepeatableHorizontalDrawable.createFromView(content));
try {
updateArrowBitmap = BitmapFactory.decodeResource(getContext().getBaseContext().getResources(), R.drawable.feather_update_arrow);
} catch (Throwable t) {
}
mEnableEffectAnimation = Constants.ANDROID_SDK > android.os.Build.VERSION_CODES.GINGERBREAD && SystemUtils.getCpuMhz() > 800;
// mSelectedPosition = 0;
}
Aggregations