private void initialisePaint() {
// Calculate radiuses i n px from dp based on screen density
float density = getResources().getDisplayMetrics().density;
mCircleRadius = CIRCLE_RADIUS_DP * density;
//we want to know the screen width to make the white text remain in the screen
Configuration configuration = getContext().getResources().getConfiguration();
mScreenWidth = configuration.smallestScreenWidthDp * (int) density ;
//mCircleHistoricalRadius = CIRCLE_HISTORICAL_RADIUS_DP * density;
// Setup text paint for circle label
mTextPaint.setTextSize(30f*density);
mStrokePaint.setTextSize(30f*density);
mTextPaint.setColor(Color.WHITE);
mStrokePaint.setColor(Color.WHITE);
mTransStrokePaint.setColor(Color.WHITE);
mTextPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
mStrokePaint.setStyle(Paint.Style.STROKE);
mStrokePaint.setStrokeWidth(6f* density);
mTransStrokePaint.setStyle(Paint.Style.STROKE);
mTransStrokePaint.setStrokeWidth(6f* density);
}
TouchDisplayView.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:OneTwo
作者:
评论列表
文章目录