List of usage examples for android.graphics Paint ANTI_ALIAS_FLAG
int ANTI_ALIAS_FLAG
To view the source code for android.graphics Paint ANTI_ALIAS_FLAG.
Click Source Link
From source file:org.jraf.android.cinetoday.mobile.ui.CirclePageIndicator.java
private void init() { mCircleRadiusPx = getResources().getDimensionPixelSize(R.dimen.pageIndicator_circleRadius); mCircleMarginPx = getResources().getDimensionPixelSize(R.dimen.pageIndicator_circleMargin); mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mPaint.setStyle(Paint.Style.FILL); mPaint.setColor(ResourcesCompat.getColor(getResources(), R.color.pageIndicator_circle, null)); mAddBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_page_indicator_add); }
From source file:com.cssweb.android.base.QuoteGridActivity.java
public QuoteGridActivity() { Paint localPaint = new Paint(Paint.ANTI_ALIAS_FLAG); this.mPaint = localPaint; this.mPaint.setTextSize(this.mFontSize); textWeight = this.mPaint.measureText("?"); int[] arrayOfInt1 = new int[3]; this.residTitleScrollCol = arrayOfInt1; this.residTitleCol = 0; this.residCol = 0; int[] arrayOfInt2 = new int[3]; this.residScrollCol = arrayOfInt2; this.residSelColor = Color.DKGRAY; }
From source file:com.microsoft.mimickeralarm.mimics.CountDownTimerView.java
public CountDownTimerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); m25PercentPaint = new Paint(Paint.ANTI_ALIAS_FLAG); m25PercentPaint.setColor(ContextCompat.getColor(context, R.color.yellow4)); m50PercentPaint = new Paint(Paint.ANTI_ALIAS_FLAG); m50PercentPaint.setColor(ContextCompat.getColor(context, R.color.yellow3)); m75PercentPaint = new Paint(Paint.ANTI_ALIAS_FLAG); m75PercentPaint.setColor(ContextCompat.getColor(context, R.color.yellow2)); m100PercentPaint = new Paint(Paint.ANTI_ALIAS_FLAG); m100PercentPaint.setColor(ContextCompat.getColor(context, R.color.yellow1)); mWhitePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mWhitePaint.setColor(ContextCompat.getColor(context, R.color.white)); }
From source file:com.Duo.music.player.Dialogs.CautionEditAlbumsDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { parentActivity = getActivity();//w w w.ja v a 2 s .c om dialogFragment = this; album = this.getArguments().getString("ALBUM"); artist = this.getArguments().getString("ARTIST"); callingActivity = this.getArguments().getString("CALLING_FRAGMENT"); rootView = (View) parentActivity.getLayoutInflater().inflate(R.layout.fragment_caution_edit_albums, null); cautionText = (TextView) rootView.findViewById(R.id.caution_text); cautionText.setText(R.string.caution_albums_text); cautionText.setTypeface(TypefaceHelper.getTypeface(parentActivity, "RobotoCondensed-Light")); cautionText.setPaintFlags(cautionText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); sharedPreferences = getActivity().getSharedPreferences("com.jams.music.player", Context.MODE_PRIVATE); dontShowAgainText = (TextView) rootView.findViewById(R.id.dont_show_again_text); dontShowAgainText.setTypeface(TypefaceHelper.getTypeface(parentActivity, "RobotoCondensed-Light")); dontShowAgainText.setPaintFlags( dontShowAgainText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); dontShowAgainCheckbox = (CheckBox) rootView.findViewById(R.id.dont_show_again_checkbox); dontShowAgainCheckbox.setChecked(true); sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", false).commit(); dontShowAgainCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton arg0, boolean isChecked) { if (isChecked == true) { sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", false).commit(); } else { sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", true).commit(); } } }); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); //Set the dialog title. builder.setTitle(R.string.caution); builder.setView(rootView); builder.setNegativeButton(R.string.no, new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialogFragment.dismiss(); } }); builder.setPositiveButton(R.string.yes, new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialogFragment.dismiss(); FragmentTransaction ft = getFragmentManager().beginTransaction(); Bundle bundle = new Bundle(); bundle.putString("EDIT_TYPE", "ALBUM"); bundle.putString("ALBUM", album); bundle.putString("ARTIST", artist); bundle.putString("CALLING_FRAGMENT", callingActivity); ID3sAlbumEditorDialog dialog = new ID3sAlbumEditorDialog(); dialog.setArguments(bundle); dialog.show(ft, "id3EditorDialog"); } }); return builder.create(); }
From source file:me.test.zxing.ViewfinderView.java
public ViewfinderView(Context context, AttributeSet attrs) { super(context, attrs); // Initialize these once for performance rather than calling them every time in onDraw(). paint = new Paint(Paint.ANTI_ALIAS_FLAG); Resources resources = getResources(); maskColor = resources.getColor(R.color.viewfinder_mask); resultColor = resources.getColor(R.color.result_view); // laserColor = resources.getColor(R.color.viewfinder_laser); laserColor = ContextCompat.getColor(getContext(), android.R.color.holo_green_dark); resultPointColor = resources.getColor(R.color.possible_result_points); scannerAlpha = 0;/*from ww w . jav a2 s.c om*/ possibleResultPoints = new ArrayList<>(5); lastPossibleResultPoints = null; }
From source file:com.jelly.music.player.Dialogs.CautionEditAlbumsDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { parentActivity = getActivity();/*from w w w . j av a 2 s .c om*/ dialogFragment = this; album = this.getArguments().getString("ALBUM"); artist = this.getArguments().getString("ARTIST"); callingActivity = this.getArguments().getString("CALLING_FRAGMENT"); rootView = (View) parentActivity.getLayoutInflater().inflate(R.layout.fragment_caution_edit_albums, null); cautionText = (TextView) rootView.findViewById(R.id.caution_text); cautionText.setText(R.string.caution_albums_text); cautionText.setTypeface(TypefaceHelper.getTypeface(parentActivity, "RobotoCondensed-Light")); cautionText.setPaintFlags(cautionText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); sharedPreferences = getActivity().getSharedPreferences("com.jelly.music.player", Context.MODE_PRIVATE); dontShowAgainText = (TextView) rootView.findViewById(R.id.dont_show_again_text); dontShowAgainText.setTypeface(TypefaceHelper.getTypeface(parentActivity, "RobotoCondensed-Light")); dontShowAgainText.setPaintFlags( dontShowAgainText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); dontShowAgainCheckbox = (CheckBox) rootView.findViewById(R.id.dont_show_again_checkbox); dontShowAgainCheckbox.setChecked(true); sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", false).commit(); dontShowAgainCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton arg0, boolean isChecked) { if (isChecked == true) { sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", false).commit(); } else { sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", true).commit(); } } }); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); //Set the dialog title. builder.setTitle(R.string.caution); builder.setView(rootView); builder.setNegativeButton(R.string.no, new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialogFragment.dismiss(); } }); builder.setPositiveButton(R.string.yes, new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialogFragment.dismiss(); FragmentTransaction ft = getFragmentManager().beginTransaction(); Bundle bundle = new Bundle(); bundle.putString("EDIT_TYPE", "ALBUM"); bundle.putString("ALBUM", album); bundle.putString("ARTIST", artist); bundle.putString("CALLING_FRAGMENT", callingActivity); ID3sAlbumEditorDialog dialog = new ID3sAlbumEditorDialog(); dialog.setArguments(bundle); dialog.show(ft, "id3EditorDialog"); } }); return builder.create(); }
From source file:com.aniruddhc.acemusic.player.Dialogs.CautionEditAlbumsDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { parentActivity = getActivity();//from ww w. j a v a 2 s.co m dialogFragment = this; album = this.getArguments().getString("ALBUM"); artist = this.getArguments().getString("ARTIST"); callingActivity = this.getArguments().getString("CALLING_FRAGMENT"); rootView = (View) parentActivity.getLayoutInflater().inflate(R.layout.fragment_caution_edit_albums, null); cautionText = (TextView) rootView.findViewById(R.id.caution_text); cautionText.setText(R.string.caution_albums_text); cautionText.setTypeface(TypefaceHelper.getTypeface(parentActivity, "RobotoCondensed-Light")); cautionText.setPaintFlags(cautionText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); sharedPreferences = getActivity().getSharedPreferences("com.aniruddhc.acemusic.player", Context.MODE_PRIVATE); dontShowAgainText = (TextView) rootView.findViewById(R.id.dont_show_again_text); dontShowAgainText.setTypeface(TypefaceHelper.getTypeface(parentActivity, "RobotoCondensed-Light")); dontShowAgainText.setPaintFlags( dontShowAgainText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); dontShowAgainCheckbox = (CheckBox) rootView.findViewById(R.id.dont_show_again_checkbox); dontShowAgainCheckbox.setChecked(true); sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", false).commit(); dontShowAgainCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton arg0, boolean isChecked) { if (isChecked == true) { sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", false).commit(); } else { sharedPreferences.edit().putBoolean("SHOW_ALBUM_EDIT_CAUTION", true).commit(); } } }); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); //Set the dialog title. builder.setTitle(R.string.caution); builder.setView(rootView); builder.setNegativeButton(R.string.no, new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialogFragment.dismiss(); } }); builder.setPositiveButton(R.string.yes, new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialogFragment.dismiss(); FragmentTransaction ft = getFragmentManager().beginTransaction(); Bundle bundle = new Bundle(); bundle.putString("EDIT_TYPE", "ALBUM"); bundle.putString("ALBUM", album); bundle.putString("ARTIST", artist); bundle.putString("CALLING_FRAGMENT", callingActivity); ID3sAlbumEditorDialog dialog = new ID3sAlbumEditorDialog(); dialog.setArguments(bundle); dialog.show(ft, "id3EditorDialog"); } }); return builder.create(); }
From source file:com.shizhefei.view.coolrefreshview.header.JellyHeader.java
public JellyHeader(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); setWillNotDraw(false);//from w ww . j a v a2 s. c o m defaultMinHeight = Utils.dipToPix(context, 208); mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mPaint.setStyle(Paint.Style.FILL); mPath = new Path(); showLoadingAnimation = new AlphaAnimation(0, 1); showLoadingAnimation.setDuration(300); showLoadingAnimation.setInterpolator(new AccelerateInterpolator()); hideLoadingAnimation = new AlphaAnimation(1, 0); hideLoadingAnimation.setDuration(300); hideLoadingAnimation.setInterpolator(new DecelerateInterpolator()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mViewOutlineProvider = new ViewOutlineProvider() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(View view, Outline outline) { if (mPath.isConvex()) outline.setConvexPath(mPath); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) { outline.offset(0, totalDistance() - currentDistance); } } }; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { setElevation(Utils.dipToPix(context, 4)); } } }
From source file:com.aniruddhc.acemusic.player.MiscFragments.BuildingLibraryProgressFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mContext = getActivity().getApplicationContext(); mApp = (Common) mContext;// ww w . ja v a2 s .c o m mRootView = (View) getActivity().getLayoutInflater().inflate(R.layout.fragment_building_library_progress, null); mProgressElementsContainer = (RelativeLayout) mRootView.findViewById(R.id.progress_elements_container); mProgressElementsContainer.setVisibility(View.INVISIBLE); mCurrentTaskText = (TextView) mRootView.findViewById(R.id.building_library_task); mCurrentTaskText.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Light")); mCurrentTaskText .setPaintFlags(mCurrentTaskText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); mProgressBar = (ProgressBar) mRootView.findViewById(R.id.building_library_progress); mProgressBar.setMax(1000000); mFadeInAnimation = AnimationUtils.loadAnimation(mContext, R.anim.fade_in); mFadeInAnimation.setAnimationListener(fadeInListener); mFadeInAnimation.setDuration(700); return mRootView; }
From source file:com.example.lz.android_recycler_view_sample.DividerListItemDecoration.java
/** * /*from www .ja va2 s . co m*/ * * @param context * @param orientation ? * @param dividerHeight * @param dividerColor */ public DividerListItemDecoration(Context context, int orientation, int dividerHeight, @ColorInt int dividerColor) { setOrientation(orientation); mDividerHeight = dividerHeight; mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mPaint.setColor(dividerColor); mPaint.setStyle(Paint.Style.FILL); }