/* 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;
    }
}
/* 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 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;
    }
}
Revert "Just in case I need this"