Search in sources :

Example 1 with FilterWatermarkRepresentation

use of com.android.gallery3d.filtershow.filters.FilterWatermarkRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class FilterShowActivity method showWaterMark.

private void showWaterMark(FilterRepresentation representation) {
    FilterWatermarkRepresentation watermarkRepresentation = (FilterWatermarkRepresentation) representation;
    if (mWaterMarkView != null) {
        rlImageContainer.removeView(mWaterMarkView);
        hasWaterMark = false;
        watermarkRepresentation.reset();
    }
    DisplayMetrics dm = getResources().getDisplayMetrics();
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(dm.widthPixels, dm.heightPixels);
    String textHint;
    switch(watermarkRepresentation.getMarkType()) {
        case 0:
            textHint = locationStr;
            break;
        case 2:
            textHint = temperature;
            break;
        default:
            textHint = watermarkRepresentation.getTextHint();
            break;
    }
    WaterMarkView waterMarkView = watermarkRepresentation.getWaterMarkView(textHint);
    rlImageContainer.addView(waterMarkView, params);
    mWaterMarkView = waterMarkView;
    mSaveWaterMark.useRepresentation(representation);
    imgComparison.bringToFront();
    mSaveWaterMark.getExifData(this, mSelectedImageUri);
    mWaterMarkView.mTouchable = true;
    hasWaterMark = true;
}
Also used : FilterWatermarkRepresentation(com.android.gallery3d.filtershow.filters.FilterWatermarkRepresentation) RelativeLayout(android.widget.RelativeLayout) DisplayMetrics(android.util.DisplayMetrics) WaterMarkView(com.android.gallery3d.filtershow.category.WaterMarkView)

Aggregations

DisplayMetrics (android.util.DisplayMetrics)1 RelativeLayout (android.widget.RelativeLayout)1 WaterMarkView (com.android.gallery3d.filtershow.category.WaterMarkView)1 FilterWatermarkRepresentation (com.android.gallery3d.filtershow.filters.FilterWatermarkRepresentation)1