自定义View之仿支付宝芝麻信用分仪表盘效果,喜欢的话,请给个star,谢谢.
使用添加项目依赖
Add it i your root build.gradle at the ed of repositories: allprojects { repositories { ... mave { url "https://jitpack.io" } } } Add the depedecy depedecies { compile 'com.github.HotBitmapGG:CreditSesameRigView:V1.0.2' }新版芝麻信用分使用
// The gradiet color ca defie your ow private fial it[] mColors = ew it[]{ 0xFFFF80AB, 0xFFFF4081, 0xFFFF5177, 0xFFFF7997 }; // Set up the eed to score mLayout = (RelativeLayout) view.fidViewById(R.id.layout); mButto = (Butto) view.fidViewById(R.id.bt); ewCreditSesameView = (NewCreditSesameView) view.fidViewById(R.id.sesame_view); mLayout.setBackgroudColor(mColors[0]); mButto.setOClickListeer(ew View.OClickListeer() { @Override public void oClick(View view) { ewCreditSesameView.setSesameValues(639); startColorChageAim(); } }); // The backgroud color gradiet aimatio Simply illustrates the effect Ca customize accordig to your eed public void startColorChageAim() { ObjectAimator aimator = ObjectAimator.ofIt(mLayout, "backgroudColor", mColors); aimator.setDuratio(3000); aimator.setEvaluator(ew ArgbEvaluator()); aimator.start(); }旧版芝麻信用分使用
// Set up the eed to score oldCreditSesameView = (OldCreditSesameView) view.fidViewById(R.id.sesame_view); mButto = (Butto) view.fidViewById(R.id.bt); mButto.setOClickListeer(ew View.OClickListeer() { @Override public void oClick(View view) { oldCreditSesameView.setSesameValues(639); } });









评论