We present a unified theory for the almost periodicity of functions with values in an arbitrary Banach space, measures and distributions via almost periodic elements for the action of a locally compact abelian group on a uniform topological space. We discuss the relation between Bohr- and Bochner-type almost periodicity, and similar conditions, and how the equivalence among such conditions relates to properties of the group action and the uniformity. We complete the paper by demonstrating how various examples considered earlier all fit in our framework.