繁体   English   中英

银河 s7 边缘拖放

[英]galaxy s7 edge drag and drop

我有一个用户已从三星 Galaxy S6 Edge 升级到三星 Galaxy S7 Edge。

我的应用程序能够拖放扑克牌图像。

用户表示此功能在 S7 Edge 上不起作用,但在 S6 Edge 上起作用。

拖动工作,这表明 onTouch() 和 onDrag() 正在工作,但是当一个对象被放下时,它返回到它的原始位置而不是所需的位置。

protected void measureDisplay() {
    // get info about screen size to determine style of images to use
    display = getWindowManager().getDefaultDisplay();
    size = new Point();
    display.getSize(size);

    displayMetrics = new DisplayMetrics();
    // get the density of the display
    display.getMetrics(displayMetrics);

    width = size.x;
    height = size.y;
}

private void measureBoard(View v) {
    // get the current view width and height
    float viewWidth = v.getWidth();
    float viewHeight = v.getHeight();

    // extract the image offsets inside the view
    Matrix matrix = ((ImageView) v).getImageMatrix();
    float[] values = new float[9];
    matrix.getValues(values);
    boardLeft = values[2]; // the X offset
    boardRight = viewWidth - boardLeft;
    boardTop = values[5]; // the Y offset
    boardBottom = viewHeight - boardTop;
    cardOffsetW = (boardRight - boardLeft) / 10;
    cardOffsetH = (boardBottom - boardTop) / 10;
}

至少可以通过了解用户是否安装了三星的 Game Tuner 来解决幕后显示缩放的一些问题。 它会更改任何“游戏”应用程序的分辨率,并且可能无需打开即可完成。

要解决此问题,请让用户在 Game Tuner 中为您的游戏指定分辨率(他们可以在每个应用程序的基础上执行此操作)。 在此处查看更多信息: DragEventListener 不适用于三星 S7 (6.0)

我正在为我的游戏进行更新,如果他们安装了 Game Tuner,它会弹出一条消息。

这个应用程序: https : //play.google.com/store/apps/details?id=com.evozi.displayscaling将解决三星设备上的问题。 在我们的游戏中,我们遇到了类似的问题,解决方案是更改此设置。 我希望三星将在下一次操作系统更新中提供修复,因此我们确实需要通知用户此错误并迫使他们更改设置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM