1
0
Fork 0
seedvault/app/src/main/java/com/stevesoltys/backup/activity/PopupWindowUtil.java
Steve Soltys 828f257426 Clean up package and class structure significantly
1. Add service layer for backup / restore operations.
2. Reduce amount of duplicate code in activity classes.
2019-03-01 23:34:04 -05:00

32 lines
1.1 KiB
Java

package com.stevesoltys.backup.activity;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupWindow;
import com.stevesoltys.backup.R;
/**
* @author Steve Soltys
*/
public class PopupWindowUtil {
public static PopupWindow showLoadingPopupWindow(Activity parent) {
LayoutInflater inflater = (LayoutInflater) parent.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup popupViewGroup = parent.findViewById(R.id.popup_layout);
View popupView = inflater.inflate(R.layout.progress_popup_window, popupViewGroup);
PopupWindow popupWindow = new PopupWindow(popupView, 750, 350, true);
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
popupWindow.setElevation(10);
popupWindow.setFocusable(false);
popupWindow.showAtLocation(popupView, Gravity.CENTER, 0, 0);
popupWindow.setOutsideTouchable(false);
return popupWindow;
}
}