コード例 #1
0
  @Override
  protected void onFinishInflate() {
    super.onFinishInflate();

    // Get the individual components
    mDropTargetBar = findViewById(R.id.drag_target_bar);
    mInfoDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.info_target_text);
    mDeleteDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.delete_target_text);

    mInfoDropTarget.setSearchDropTargetBar(this);
    mDeleteDropTarget.setSearchDropTargetBar(this);

    mEnableDropDownDropTargets =
        getResources().getBoolean(R.bool.config_useDropTargetDownTransition);

    // Create the various fade animations
    if (mEnableDropDownDropTargets) {
      LauncherAppState app = LauncherAppState.getInstance();
      DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
      mBarHeight = grid.searchBarSpaceHeightPx;
      mDropTargetBar.setTranslationY(-mBarHeight);
      mDropTargetBarAnim =
          LauncherAnimUtils.ofFloat(mDropTargetBar, "translationY", -mBarHeight, 0f);

    } else {
      mDropTargetBar.setAlpha(0f);
      mDropTargetBarAnim = LauncherAnimUtils.ofFloat(mDropTargetBar, "alpha", 0f, 1f);
    }
    setupAnimation(mDropTargetBarAnim, mDropTargetBar);
  }
コード例 #2
0
  @Override
  protected void onFinishInflate() {
    super.onFinishInflate();

    // Get the individual components
    mDropTargetBar = findViewById(R.id.drag_target_bar);
    mInfoDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.info_target_text);
    mDeleteDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.delete_target_text);
    mUninstallDropTarget =
        (ButtonDropTarget) mDropTargetBar.findViewById(R.id.uninstall_target_text);

    mInfoDropTarget.setSearchDropTargetBar(this);
    mDeleteDropTarget.setSearchDropTargetBar(this);
    mUninstallDropTarget.setSearchDropTargetBar(this);

    // Create the various fade animations
    mDropTargetBar.setAlpha(0f);
    mShowDropTargetBarAnim = LauncherAnimUtils.ofFloat(mDropTargetBar, "alpha", 0f, 1f);
    setupAnimation(mShowDropTargetBarAnim, mDropTargetBar);
  }