Invoke one into the Activity to get info about the Display size
@param activity The Activity
558021
public static void initSizeData(Activity activity) {
    DisplayMetrics metrics = new DisplayMetrics();
    activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
    DISPLAY_WIDTH = metrics.widthPixels;
    DISPLAY_HEIGHT = metrics.heightPixels;
  }
638291
@Override
    public void onActivityResumed(Activity activity) {
        HMSAgentLog.d("onResumed:" + StrUtils.objDesc(activity));
        setCurActivity(activity);

        List<IActivityResumeCallback> tmdCallbacks = new ArrayList<IActivityResumeCallback>(resumeCallbacks);
        for (IActivityResumeCallback callback : tmdCallbacks) {
            callback.onActivityResume(activity);
        }
    }
467806
private int setViewSize(int mode, int size, int drawableWidth) {
        int viewSize;
        switch (mode) {
            case MeasureSpec.EXACTLY:
                viewSize = size;
                break;

            case MeasureSpec.AT_MOST:
                viewSize = Math.min(drawableWidth, size);
                break;

            case MeasureSpec.UNSPECIFIED:
                viewSize = drawableWidth;
                break;

            default:
                viewSize = size;
                break;
        }
        return viewSize;
    }
700182
@Nullable
    private Display currentDisplay() {
        if (Build.VERSION.SDK_INT >= JELLY_BEAN_MR1) {
            return getDisplay();
        } else {
            Context context = getContext();
            if (!(context instanceof Activity)) {
                return null;
            }
            return ((Activity) context).getWindowManager().getDefaultDisplay();
        }
    }
1345572
public static void typeface(Activity activity) {
		if (sDefaultTypefaceCollection == null) {
			throw new IllegalStateException("Default typeface collection not initialized. Forgot to call init()?");
		}
		typeface(activity.findViewById(android.R.id.content), sDefaultTypefaceCollection);
	}
1167541
public static void setFlag(Activity activity, final int bits, boolean on) {
        Window win = activity.getWindow();
        WindowManager.LayoutParams winParams = win.getAttributes();
        if (on) {
            winParams.flags |= bits;
        } else {
            winParams.flags &= ~bits;
        }
        win.setAttributes(winParams);
    }
868565
public static int getScreenWidth(Context context) {
        DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        return metrics.widthPixels;
    }
46812
private void setCurrentForegroundActivity(Activity activity) {
		if (activity != null) {
			currentForegroundApptentiveActivity = new WeakReference<>(activity);
		} else {
			ApptentiveToastNotificationManager manager = ApptentiveToastNotificationManager.getInstance(null, false);
			if (manager != null) {
				manager.cleanUp();
			}
			currentForegroundApptentiveActivity = null;
		}
	}
905630
public static void putViewState(@NonNull Activity activity, @NonNull String viewId,
      @NonNull Object viewState) {
    if (activity == null) {
      throw new NullPointerException("Activity is null");
    }

    ActivityScopedCache scopedCache = getOrCreateActivityScopedCache(activity);
    scopedCache.putViewState(viewId, viewState);
  }
825853
public void enableUniformSize(final boolean enable) {
        if (mUniformSize != enable) {
            mUniformSize = enable;
            if (mContainer != null) {
                mContainer.onLayoutChanged(this);
            }
        }
    }
1308193
@Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);

        if (mAdjustViewSize) {
            if (!(getParent() instanceof RelativeLayout)) {
                throw new IllegalStateException("Only RelativeLayout is supported as parent of this view");
            }

            final int sWidth = ScreenHelper.getScreenWidth(getContext());
            final int sHeight = ScreenHelper.getScreenHeight(getContext());

            RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();

            params.width = (int) (sWidth * mButtonMenu.getMainButtonSize());
            params.height = (int) (sWidth * mButtonMenu.getMainButtonSize());
            params.setMargins(0, 0, 0, (int) (sHeight * mButtonMenu.getBottomPadding()));
        }
    }
675741
public void updateSizes(@ProgressDrawableSize int size) {
        final DisplayMetrics metrics = mResources.getDisplayMetrics();
        final float screenDensity = metrics.density;

        if (size == LARGE) {
            setSizeParameters(CIRCLE_DIAMETER_LARGE*screenDensity, CIRCLE_DIAMETER_LARGE*screenDensity, CENTER_RADIUS_LARGE*screenDensity,
                    STROKE_WIDTH_LARGE*screenDensity, ARROW_WIDTH_LARGE*screenDensity, ARROW_HEIGHT_LARGE*screenDensity);
        } else {
            setSizeParameters(CIRCLE_DIAMETER*screenDensity, CIRCLE_DIAMETER*screenDensity, CENTER_RADIUS*screenDensity, STROKE_WIDTH*screenDensity,
                    ARROW_WIDTH*screenDensity, ARROW_HEIGHT*screenDensity);
        }
    }
368628
@Override
  public void show( final Component c, final int iX, final int iY )
  {
    super.show( c, iX, iY );

    EventQueue.invokeLater(
      () -> {
        if( !_bResizedWidth && _viewer.getWidth() > MAX_WIDTH )
        {
          //noinspection SuspiciousNameCombination
          _scroller.setPreferredSize( new Dimension( MAX_WIDTH, MAX_WIDTH ) );
          _bResizedWidth = true;
          pack();
          setVisible( false );
          show( c, iX, iY );
          return;
        }
        if( !_bResizedHeight && isViewerLessThanHalfFull() )
        {
          _scroller.setPreferredSize( new Dimension( MAX_WIDTH, _scroller.getHeight() / 2 ) );
          _bResizedHeight = true;
          pack();
          setVisible( false );
          show( c, iX, iY );
        }
      } );
  }
708074
protected void setWidth(View view, int width) {
        ViewGroup.LayoutParams lp = view.getLayoutParams();
        lp.width = width;
        view.setLayoutParams(lp);
    }
767720
@TargetApi(VERSION_CODES.KITKAT)
    public static void hideSystemUI(Activity activity) {
        // Set the IMMERSIVE flag.
        // Set the content to appear under the system bars so that the content
        // doesn't resize when the system bars hideSelf and show.
        View decorView = activity.getWindow().getDecorView();
        decorView.setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hideSelf nav bar
                        | View.SYSTEM_UI_FLAG_FULLSCREEN // hideSelf status bar
                        | View.SYSTEM_UI_FLAG_IMMERSIVE
        );
    }
997601
public static boolean isActivityFullscreen(Activity activity)
    {
        WindowManager.LayoutParams attrs = activity.getWindow().getAttributes();
        if ((attrs.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == WindowManager.LayoutParams.FLAG_FULLSCREEN)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
206681
private void discoverContent(Activity activity) {
        discoveryRepeatCnt_ = 0;
        if (discoveredViewList_.size() < cdManifest_.getMaxViewHistorySize()) { // check if max discovery views reached
            handler_.removeCallbacks(readContentRunnable);
            lastActivityReference_ = new WeakReference<>(activity);
            handler_.postDelayed(readContentRunnable, VIEW_SETTLE_TIME);
        }
    }