Shape-shifting polymers usually require not only reversible stimuli-responsive ability, but also strong mechanical properties. A novel shape-shifting photochromic hydrogel system was designed and fabricated through embedding hydrophobic spiropyran (SP) into double polymeric network (DN) by micellar copolymerization. Here, sodium alginate (Alg) and poly acrylate-co-methyl acrylate-co-spiropyran (P(SA-co-MA-co-SPMA)) were employed as the first network and the second network respectively to realize high mechanical strength. After soaked in the CaCl2 solution, the carboxyl groups in the system undergo metal complexation with Ca2+ to enhance the hydrogel. Moreover, after the hydrogel is exposed to UV-light, the closed isomer of spiropyran in the hydrogel network can be converted into an open zwitterionic isomer MC, which is considered to interact with Ca2+ ions. Interestingly, Ca2+ and UV-light responsive programmable shape of the copolymer hydrogel can recover to its original form by immersing in pure water. Since its excellent metal ion and UV-light stimuli-responsive and mechanical properties, the hydrogel has potential applications in the field of soft actuators.