Created
July 3, 2015 20:59
-
-
Save iammert/b0df5b6030b894187f19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Yazacağımız saatin genişliğini ve yüksekliğini alıyoruz ve saate ortalıyoruz. | |
Rect hourBound = new Rect(); | |
mPaintHourText.getTextBounds(mHour, 0, mHour.length(), hourBound); | |
canvas.drawText(mHour, mCenterX - (hourBound.width() / 2f), mCenterY + (hourBound.height() / 2f), mPaintHourText); | |
//Yazacağımız dakikanın genişliğini ve yüksekliğini hesaplayıp saatin yanına yazıyoruz. | |
Rect minuteBound = new Rect(); | |
mPaintMinuteText.getTextBounds(mMinute, 0, mMinute.length(), minuteBound); | |
canvas.drawText(mMinute, mCenterX + (mCenterX / 2f), mCenterY + (minuteBound.height() / 2f), mPaintMinuteText); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment