This works for an ideal capacitor, i.e. if you can ignore ESR
Let \$I\$ = magnitude of the current through the circuit, \$U_C\$ = magnitude of the voltage across a capacitor, and \$X_C\$ = the reactance of a capacitor (all are the positive real numbers).
As the first step, you can find \$X_C\$:
$$X_C = \frac{U_C}{I}$$
Then, using the following relation for the total impedance (as a complex number)
$$Z = R - jX_C$$
where \$j\$ is the imaginary unit, you can find the phase angle for the voltage across a capacitor
$$\varphi = -\arctan\left(\frac{X_C}{R}\right)$$
As for \$I\$ and \$U_C\$, you can find these magnitudes by averaging ADC samples over whole number of periods and scaling by \$\frac{\pi}{2}\$:
$$I = \frac{\pi}{2N}\sum_{i=1}^N |I_i|$$
$$U = \frac{\pi}{2N}\sum_{i=1}^N |U_i|$$
The \$\frac{\pi}{2}\$ factor arises from the proportion between the magnitude and the average of the absolute value for a sine wave. By the way, you can just ignore this factor, since it will be cancelled out in \$X_C = \frac{U_C}{I}\$.
If you can not ignore ESR
Then you can compute the phase shift using linear algebra. For vectors \$\mathbf{v}\$ and \$\mathbf{w}\$
$$\cos(\varphi) = \frac{\mathbf{v}\cdot \mathbf{w}}{\|\mathbf{v}\|\|\mathbf{w}\|}$$
and you can treat the sampled signals as multidimentional vectors, using
$$\mathbf{v}\cdot \mathbf{w} = \sum_{i=1}^N v_i w_i$$
$$\|\mathbf{v}\| = \sqrt{\sum_{i=1}^N v_i^2}$$
(sampling over a whole number of periods)
Substitute \$v_i = U_i\$ and \$w_i = I_i\$ for the final formula
$$\varphi = \arccos\left(\frac{\mathbf{U}\cdot \mathbf{I}}{\|\mathbf{U}\|\|\mathbf{I}\|}\right)$$
where \$U_i\$ is the sampled voltage across a capacitor and \$I_i\$ is the sampled current through the circuit.
EDIT:
In MATLAB or Octave you can try the following:
>> t = linspace(0, 2*pi*10, 100);
>> x = sin(t);
>> y = sin(t + 0.123);
>> phase_shift = acos(dot(x, y)/(norm(x)*norm(y)))
phase_shift = 0.12422
There is some error (0.12422 vs 0.123) due to relatively small number of samples (100).
By the way, \$\cos(-x) = \cos(x)\$ (even function), so you can not determine the sign. This is not a problem, since for a capacitor the sign is always the same.
When there are two dots (A and B) separated by an angle (say 60 degree) on the circumference of a rotating wheel, you may say... 1. A leads B by 60 degrees, or 2. B lags A by 60 degrees, or 3. A lags B by 300 degrees, or 4. B leads A by 300 degrees.
So the point is what have you choosed as your reference.
In parallel circuit what is common for both components is the voltage, thus voltage can be used as the reference. Current in the capacitor, by common convention, is said as leads the voltage by 90 degrees. But you can also put it as the current lag behind the voltage by 270 degrees. Mathematically it doesn't matter at all as long as you mark the vectors accordingly.
The current in the resistor is in phase with the voltage and the degree of separation between them is zero.
When you solve the resultant supply current vector of the capacitor and the resistor currents, the vector will fall between the two, thus the resultant current still leads the supply voltage by theta. Or you can also write this as the supply current lags behind the voltage by 360 minus theta.
Mathematically you will be right in either convention. But normally we practice to put phasors in small angle definition. So current leads the voltage is the common convention.
Best Answer
Absolutely. What is leading or lagging is up for interpretation/definition. Personally, the only definition that would make sense to me would be that any lag by more than 180° is actually a lead. Maybe that book defines it otherwise, or it's plain inconsistent/underdefined there.
Re: your angle: Well, no matter what happens, the result needs to have a "last digit" of 5°, so we can directly conclude that the book's solution must be incorrect.
Let me try your calculation: \$-\sin(x)=\cos(x+90°)\implies i_1=-\sin(337t+50°)=\cos(377t +140°)\$, and \$140 - (-65) = 205\$, so I'd agree with you.
By the way, you say you've been fighting a lot of mistakes in this book. Note them down as errata (even in rough form, just scans/readable photos of paper or similar), and post them in your year's forum (or however you and your coursemates communicate).
You will a) earn eternal gratitude of peers through little extra work, b) if you did actually do something wrong but the book got it right, you get free corrections, and c) at the end of the whole circus, you drop an email to your prof and tell her or him that hey, you went through a bit of effort, whether they might be willing to share these errata which the course looked through with next semester's students. That might lead to you being asked to type them out for money, or to the professor more intensely reviewing course material.