The wake bubble expansion and contraction by adding a dense-plasma wall in the background plasma during the mode transition from laser wakefield to plasma wakefield accel- eration is investigated by particle-in-cell simulations. The electrons are injected continuously into the cavity until the lateral bubble size equals the inner diameter of the wall. The injected electron bunch from the laser wakefield acceleration (LWFA) scheme is quasi phase-stably accel- erated forward because of the longitudinal contraction of the bubble. After the laser pulse is depleted completely, the electron bunch generated from the LWFA scheme drives a plasma wake- field. The electrons remaining in the channel are trapped and accelerated by the plasma wakefield. Ultimately, two energetic electron bunches with a narrow energy spread and low emittance are obtained.