Example usage for android.widget FrameLayout getPaddingBottom

List of usage examples for android.widget FrameLayout getPaddingBottom

Introduction

In this page you can find the example usage for android.widget FrameLayout getPaddingBottom.

Prototype

public int getPaddingBottom() 

Source Link

Document

Returns the bottom padding of this view.

Usage

From source file:com.tomeokin.lspush.biz.collect.ImageDialogFragment.java

@SuppressLint("InflateParams")
@NonNull/*w  ww  . jav  a  2  s.c  o  m*/
@Override
protected BaseDialogFragment.Builder config(@NonNull BaseDialogFragment.Builder builder) {
    ImageView imageView = (ImageView) LayoutInflater.from(getContext()).inflate(R.layout.dialog_image, null);
    builder.setTitle(R.string.use_current_image).addCustomMessageView(imageView)
            .addPositiveButton(R.string.dialog_ok, this).addNegativeButton(R.string.dialog_cancel, this);

    final String url = getArguments().getString(ARG_IMAGE_URL);
    final Uri uri = Uri.parse(url);
    int width = getArguments().getInt(ARG_IMAGE_WIDTH);
    int height = getArguments().getInt(ARG_IMAGE_HEIGHT);

    final View content = getActivity().getWindow().findViewById(Window.ID_ANDROID_CONTENT);
    final FrameLayout container = builder.getCustomViewHolder();
    final float radio = optimumRadio(content, container, width, height);
    width = (int) (width * radio);
    height = (int) (height * radio);

    ViewGroup.LayoutParams lp = container.getLayoutParams();
    lp.width = width + container.getPaddingLeft() + container.getPaddingRight();
    lp.height = height + container.getPaddingTop() + container.getPaddingBottom();

    Glide.with(this).load(uri).diskCacheStrategy(DiskCacheStrategy.ALL).override(width, height).fitCenter()
            .into(imageView);

    return builder;
}