Exemplo n.º 1
0
    private void initViews() {
      mBackgroundLayout = (BackgroundLayout) findViewById(R.id.background);
      mBackgroundLayout.setBaseColor(mWindowColor);
      mBackgroundLayout.setCornerRadius(mCornerRadius);
      if (mWidth != 0) {
        updateBackgroundSize();
      }

      mCustomViewContainer = (FrameLayout) findViewById(R.id.container);
      addViewToFrame(mView);

      if (mDeterminateView != null) {
        mDeterminateView.setMax(mMaxProgress);
      }
      if (mIndeterminateView != null) {
        mIndeterminateView.setAnimationSpeed(mAnimateSpeed);
      }

      mLabelText = (TextView) findViewById(com.kaopiz.kprogresshud.R.id.label);
      if (mLabel != null) {
        mLabelText.setText(mLabel);
        mLabelText.setVisibility(View.VISIBLE);
      } else {
        mLabelText.setVisibility(View.GONE);
      }
      mDetailsText = (TextView) findViewById(com.kaopiz.kprogresshud.R.id.details_label);
      if (mDetailsLabel != null) {
        mDetailsText.setText(mDetailsLabel);
        mDetailsText.setVisibility(View.VISIBLE);
      } else {
        mDetailsText.setVisibility(View.GONE);
      }
    }
Exemplo n.º 2
0
 private void updateBackgroundSize() {
   ViewGroup.LayoutParams params = mBackgroundLayout.getLayoutParams();
   params.width = Helper.dpToPixel(mWidth, getContext());
   params.height = Helper.dpToPixel(mHeight, getContext());
   mBackgroundLayout.setLayoutParams(params);
 }