android - 银河 s7 边缘拖放

标签 android samsung-galaxy

我有一位用户已从 Samsung Galaxy S6 Edge 升级到 Samsung 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 not working on Samsung S7 (6.0)

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

关于android - 银河 s7 边缘拖放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36073949/

相关文章:

android - 大布局影响 Galaxy Note

java - 蓝牙 (BLE) bluetoothLeAdvertiser.startAdvertising 抛出错误代码 2 (ADVERTISE_FAILED_TOO_MANY_ADVERTISERS)

java - 以编程方式设置图标会导致 RuntimeException。这是什么原因造成的?

java - 如何在 BottomSheetDialogFragment 内的 TextView 上设置文本

android eclipse 更新,现在应用程序在尝试运行时崩溃

java - 如何在最近屏幕后返回到上一个 Activity

tizen - 由于签名错误,设备上的应用程序安装失败 - tizen studio

java - 在 GUI 构建器中找到的对齐准则/对齐算法

Android:activity.getResources().getConfiguration().orientation 在 Samsung galaxy 设备上返回错误值

android - INSTALL_FAILED_DUPLICATE_PERMISSION 与三星 Galaxy S8