Was pre-colonial Africa mostly farmers before Europeans came or were hunter-gatherers larger then it was today?
The answers to your questions are: possibly, no, yes, and yes.
In The Pygmies Were our Compass, Kairn Klieman engages with the theory that Batwa populations (sometimes called "pygmies") had Bantu agriculturalist ancestors that adapted to a forest-specialist lifestyle, including trade with neighboring farming peoples. Now, the general academic consensus seems to hold that Batwa represent the descendants of autochthonous hunter-gatherer populations that lost their ancestral language and adopted Bantu languages of their neighbors. And Klieman treats that as the most plausible answer, but she cautions that we can't blithely disregard the possibility of bantu ancestry. So, it's possible that agrarians might have changed to a forager lifestyle.
But, farming was widespread across the continent by AD 1500, and farmers would have outnumbered forager communities at that time.
At this point I want to also point out that you mention two categories, Farmers or foragers, when in reality there were also communities of fisherfolk and livestock holding pastoralists.
On top of that, sometimes different economic strategies could overlap or exist in concert with each-other. For instance, in the Great Lakes region (modern Uganda, Rwanda, Burundi, Tanzania, Zambia, Malawi), wealth was expressed in cattle. So, you would get societies where the peasant small-farmer would exist on the lower rungs of a society, but the wealthiest elites could have herds of thousands of head of cattle.
Further, you could have situations of what Chapurukha Kusimba calls "cultural mosaics". He gives the example of the Tsavo region of kenya from 1000-1400 where there were differentiated societies of farmers, pastoralists, foragers and traders who engaged in networks of food and resource exchange. This cooperation among neighboring peoples with different economic strategies gave better chances of survival in periods of crisis. for example, if crops failed there was still chance of procuring meat and dairy from herders. If plague decimated herds, hunting wild game could provide meat. And in times of plenty, cooperation provided a more varied diet for all.
Also, David Gordon talks in great depth about regimes of water-rights at lake Mweru on the DRC-Zambia border in colonial and precolonial times. One of his important points is that autochthonous (i.e. the earliest inhabitants) exerted claims to fishing rights on the lake, which later Lunda-Kazembe and Bemba farmer societies respected, creating a de-facto fisherfolk society.
Finally, while forager peoples were fewer than agriculturalists in 1500, it is still likely that there larger areas, more communities, and more individuals engaged in foraging than there are today. This is for a number of reasons, including targeted violence against forager communities, colonial and post-colonial land-use policies that encouraged agriculture and plantation projects, and the displacement of forager communities into urban spaces in the 20th century. Edit- after a little more research, it looks like san communities in Namibia and Botswana mostly remained in rural areas, but there were societal shifts away from foraging to informal farm labor and frequent joblessness. Sorry for the misleading characterization.