Search code examples
androidsony-xperia

sony small app with fix window


I am working with Sony's smapp app and I want my window to be fixed or not resizable. need your help guys. Thanks..

    setMinimizedView(R.layout.main_minimized);

    setTitle(R.string.small_app_name);

    SmallAppWindow.Attributes attr = getWindow().getAttributes();


    attr.width = getResources().getDimensionPixelSize(R.dimen.min_width);
    attr.height = getResources().getDimensionPixelSize(R.dimen.min_height);
    attr.flags |= SmallAppWindow.Attributes.FLAG_HARDWARE_ACCELERATED;

    getWindow().setAttributes(attr);

}

Solution

  • There are three flags you can set:

    FLAG_NO_TITLEBAR, FLAG_HARDWARE_ACCELERATED, FLAG_RESIZABLE

    By default the resizable flag is true. This code will disable all flags:

    attr.flags = 0;
    

    It looks like you want hardware acceleration though so do the following to only have hardware acceleration:

    attr.flags = 0;
    attr.flags |= SmallAppWindow.Attributes.FLAG_HARDWARE_ACCELERATED;