/* Copyright 2019 Braden Farmer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.farmerbb.taskbar.ui;

import android.graphics.PixelFormat;
import android.view.WindowManager;
import android.widget.FrameLayout;

import com.farmerbb.taskbar.util.U;

public class ViewParams {
    public int width;
    public int height;
    public int gravity;
    public int flags;

    public ViewParams(int width, int height, int gravity, int flags) {
        this.width = width;
        this.height = height;
        this.gravity = gravity;
        this.flags = flags;
    }

    public WindowManager.LayoutParams toWindowManagerParams() {
        final WindowManager.LayoutParams wmParams = new WindowManager.LayoutParams(
                width,
                height,
                U.getOverlayType(),
                flags,
                PixelFormat.TRANSLUCENT
        );

        if(gravity > -1)
            wmParams.gravity = gravity;

        return wmParams;
    }

    public FrameLayout.LayoutParams toFrameLayoutParams() {
        final FrameLayout.LayoutParams flParams = new FrameLayout.LayoutParams(
                width,
                height
        );

        if(gravity > -1)
            flParams.gravity = gravity;

        return flParams;
    }
}
@@ -697,43 +697,8 @@
 ger;
-%0Aimport android.widget.FrameLayout;
 %0A%0Aim
@@ -1452,302 +1452,6 @@
    %7D
-%0A%0A    public FrameLayout.LayoutParams toFrameLayoutParams() %7B%0A        final FrameLayout.LayoutParams flParams = new FrameLayout.LayoutParams(%0A                width,%0A                height%0A        );%0A%0A        if(gravity %3E -1)%0A            flParams.gravity = gravity;%0A%0A        return flParams;%0A    %7D
 %0A%7D

Revert "Just in case I need this"