Surface-Assisted Self-Assembly of a Hydrogel by Proton Diffusion