Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
MediaObserveUtil.getInstance().addListener(new OnScreenShotListener() {@Overridepublic void onScreenShot(String imagePath) {// Handle screenshot events}});
activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);
public interface IScreenRecord {int RECORD_STATUS_HIDDEN = 0;int RECORD_STATUS_SHOW = 1;int RECORD_STATUS_RECORDING = 2;void onScreenCaptureStarted();void onScreenCapturePaused();void onScreenCaptureResumed();void onScreenCaptureStopped(int reason);}
// 1. Image watermarkBitmapUtils.addWatermark(watermark, // Watermark imageimage, // Full size imagesrcImageWidth, // Full size image widthoffsetX, // X axis offsetoffsetY, // Y axis offsetaddInLeft, // Whether it is on the leftorientation // Rotation angle);// 2. Text watermarkBitmapUtils.addWatermarkWithText(watermark, // Watermark imageimage, // Full size imagesrcImageWidth, // Full size image widthtext, // Watermark textoffsetX, // X axis offsetoffsetY, // Y axis offsetaddInLeft, // Whether it is on the leftorientation // Rotation angle);// 3. Video watermark// Set video watermark parameters via TXJSAdapterConstantsPUSHER_KEY_WATERMARK_IMAGE // Watermark imagePUSHER_KEY_WATERMARK_LEFT // Watermark X position (percentage)PUSHER_KEY_WATERMARK_TOP // Watermark Y position (percentage)PUSHER_KEY_WATERMARK_WIDTH // Watermark width (percentage)
// Implement the IWaterMakerProxy API to create a custom watermark view@ProxyService(proxy = IWaterMakerProxy.class)public class MiniWaterMarkProxy implements IWaterMakerProxy {@Overridepublic View createWatermarkView(Context context, LayoutParams layoutParams,MiniAppInfo finAppInfo, JSONObject jsonObject) {TextView textView = new TextView(context);textView.setText("TCMPP Auth");textView.setTextColor(Color.RED);textView.setTextSize(30);// Set watermark position and sizelayoutParams.topMargin = 600;layoutParams.width = 1000;layoutParams.height = 1000;layoutParams.leftMargin = 100;return textView;}}
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback