Aims. We investigate kink oscillations of loops observed in an active region with the Atmospheric Imaging Assembly (AIA) instrument on board the Solar Dynamics Observatory (SDO) spacecraft before and after a flare.Methods. The oscillations were depicted and analysed with time-distance maps, extracted from the cuts taken parallel or perpendicular to the loop axis. Moving loops were followed in time with steadily moving slits. The period of oscillations and its time variation were determined by best-fitting harmonic functions.Results. We show that before and well after the occurrence of the flare, the loops experience low-amplitude decayless oscillations.The flare and the coronal mass ejection associated to it trigger large-amplitude oscillations that decay exponentially in time. The periods of the kink oscillations in both regimes (about 240 s) are similar. An empirical model of the phenomenon in terms of a damped linear oscillator excited by a continuous low-amplitude harmonic driver and by an impulsive high-amplitude driver is found to be consistent with the observations.