Almost periodicity in time-dependent and state-dependent delay differential equations