Metalenses are compact lensing components based on rationally designed nanoscale building blocks. These planar devices are crucial for miniaturized imaging systems that can be integrated into portable electronic and optical devices. However, existing metalenses have fixed structures of hard materials that cannot be reshaped once fabricated and cannot adjust their focal spots adaptively based on the position of the object relative to the image. We developed a dynamic materials platform for adaptive imaging based on arrays of plasmonic nanoparticles that sustained lattice resonances. The lensing responses were obtained by patterning a reconfigurable polymer layer on top of the metal array. We achieved tunable focusing by one-step erasing and writing of the superstrate polymer layer using soft masks made from elastomers. During a single imaging session, our metalens device can evolve from a single-focus lens to a multi-focal lens that can form more than one image at any programmable 3D position.