@Override
    protected void onAttachedToWindow() {
      // This is called when the view is attached to a window.
      // At this point it has a Surface and will start drawing.
      if (DBG) mSlidingCardManager.log("WindowAttachNotifierView: onAttachedToWindow!");
      super.onAttachedToWindow();

      // The code in showPopup() needs to know the sizes and
      // positions of some views in the mMainFrame view hierarchy,
      // in order to set the popup window's size and position.  That
      // means that showPopup() needs to be called *after* the whole
      // in-call UI has been measured and laid out.  At this point
      // that hasn't happened yet, so we can't directly call
      // mSlidingCardManager.showPopup() from here.
      //
      // Also, to reduce flicker onscreen, we'd like the PopupWindow
      // to appear *before* any of the main view hierarchy becomes
      // visible.  So we use the main view hierarchy's
      // ViewTreeObserver to get notified *after* the layout
      // happens, but before anything gets drawn.

      // Get the ViewTreeObserver for the main InCallScreen view
      // hierarchy.  (You can only call getViewTreeObserver() after
      // the view tree gets attached to a Window, which is why we do
      // this here rather than in InCallScreen.onCreate().)
      final ViewTreeObserver viewTreeObserver = getViewTreeObserver();
      // Arrange for the SlidingCardManager to get called after
      // the main view tree has been laid out.
      // (addOnPreDrawListener() would also be basically equivalent here.)
      viewTreeObserver.addOnGlobalLayoutListener(mSlidingCardManager);

      // See SlidingCardManager.onGlobalLayout() for the next step.
    }
 /** Now we know the dimensions of the view, setup the bounds and paints */
 @Override
 public void onAttachedToWindow() {
   super.onAttachedToWindow();
   setupBounds();
   setupPaints();
   invalidate();
 }
Exemple #3
0
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    isAttachedToWindow = true;

    if (dirtyAnimation) {
      knobState = this.mIsChecked;
      if (knobState) {
        knobMoveAnimator.setFloatValues(knobMoveRate, 1.0F);
        knobMoveAnimator.start();

        innerContentAnimator.setFloatValues(innerContentRate, 0.0F);
        innerContentAnimator.start();
      } else {
        knobMoveAnimator.setFloatValues(knobMoveRate, 0.0F);
        knobMoveAnimator.start();

        innerContentAnimator.setFloatValues(innerContentRate, 1.0F);
        innerContentAnimator.start();
      }

      knobExpandAnimator.setFloatValues(knobExpandRate, 0.0F);
      knobExpandAnimator.start();

      if (AnSwitch.this.onSwitchStateChangeListener != null && mIsChecked != preIsOn) {
        AnSwitch.this.onSwitchStateChangeListener.onSwitchStateChange(mIsChecked);
      }

      dirtyAnimation = false;
    }
  }
Exemple #4
0
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    if (mUIElement != null) {
      mUIElement.swapHost(this);
    }
  }
 public void onAttachedToWindow() {
   super.onAttachedToWindow();
   if (mPocket.holding()) {
     show(false);
   } else {
     hide(false);
   }
 }
Exemple #6
0
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   if (mStyleId != 0) {
     ThemeManager.getInstance().registerOnThemeChangedListener(this);
     onThemeChanged(null);
   }
 }
 @Override
 public void onAttachedToWindow() {
   super.onAttachedToWindow();
   mAttachedToWindow = true;
   if (mRouteTypes != 0) {
     mRouter.addCallback(mRouteTypes, mRouterCallback);
     updateRouteInfo();
   }
 }
  // FIXME Is it correct to find referenced view?
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    if (alphaSliderViewId != 0)
      setAlphaSlider((AlphaSlider) getRootView().findViewById(alphaSliderViewId));
    if (lightnessSliderViewId != 0)
      setLightnessSlider((LightnessSlider) getRootView().findViewById(lightnessSliderViewId));
  }
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   if (!mAttached) {
     mAttached = true;
     IntentFilter intentFilter = new IntentFilter(Intent.ACTION_DATE_CHANGED);
     getContext().registerReceiver(dateChangedReceiver, intentFilter);
   }
   mCalendar = new Time();
 }
  @Override
  public void onAttachedToWindow() {
    super.onAttachedToWindow();

    mAttachedToWindow = true;
    if (!mSelector.isEmpty()) {
      mRouter.addCallback(mSelector, mCallback);
    }
    refreshRoute();
  }
  @Override
  public void onAttachedToWindow() {
    super.onAttachedToWindow();

    IntentFilter filter = new IntentFilter();
    filter.addAction(Intent.ACTION_BATTERY_CHANGED);
    filter.addAction(ACTION_LEVEL_TEST);
    final Intent sticky = getContext().registerReceiver(mTracker, filter);
    if (sticky != null) {
      // preload the battery level
      mTracker.onReceive(getContext(), sticky);
    }

    mAttached = true;
  }
Exemple #12
0
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    if (!isHardwareAccelerated()) {
      Log.w(
          LOG_TAG,
          "A TextureView or a subclass can only be " + "used with hardware acceleration enabled.");
    }

    if (mHadSurface) {
      invalidate(true);
      mHadSurface = false;
    }
  }
Exemple #13
0
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    mParent.requestTransparentRegion(this);
    mSession = getWindowSession();
    mLayout.token = getWindowToken();
    mLayout.setTitle("SurfaceView");
    mViewVisibility = getVisibility() == VISIBLE;

    if (!mGlobalListenersAdded) {
      ViewTreeObserver observer = getViewTreeObserver();
      observer.addOnScrollChangedListener(mScrollChangedListener);
      observer.addOnPreDrawListener(mDrawListener);
      mGlobalListenersAdded = true;
    }
  }
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    if (!mAttached) {
      mAttached = true;
      IntentFilter filter = new IntentFilter();
      filter.addAction(Intent.ACTION_TIME_TICK);
      filter.addAction(Intent.ACTION_TIME_TICK);
      filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);

      getContext().registerReceiver(mIntentReceiver, filter);
    }

    calendar = new Time();

    onTimeChanged();
  }
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    if (!mAttached) {
      mAttached = true;
      IntentFilter filter = new IntentFilter();

      filter.addAction(Intent.ACTION_TIME_TICK);
      filter.addAction(Intent.ACTION_TIME_CHANGED);
      filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);

      getContext().registerReceiver(mIntentReceiver, filter, null, mHandler);
    }

    // NOTE: It's safe to do these after registering the receiver since the receiver always runs
    // in the main thread, therefore the receiver can't run before this method returns.

    // The time zone may have changed while the receiver wasn't registered, so update the Time
    mCalendar = new Time();

    // Make sure we update to the current time
    onTimeChanged();
  }
  @Override
  protected void onAttachedToWindow() {

    super.onAttachedToWindow();
  }
Exemple #17
0
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   PlayAnimator();
 }
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   mHandler.sendEmptyMessageDelayed(GATHER_MSG, 500);
 }
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   mIsAttachWindow = true;
 }
 @Override
 protected void onAttachedToWindow() {
   animator.start();
   super.onAttachedToWindow();
 }
 @Override
 protected void onAttachedToWindow() {
   mAnimate = true;
   super.onAttachedToWindow();
 }
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   mStop = false;
   mHandler.sendEmptyMessage(HANDLER_INVALIDATE_ACTIVE);
 }
 public void onAttachedToWindow() {
   super.onAttachedToWindow();
   spring.addListener(springListener);
 }