提醒

一些Manager类整理

坚强是说给别人听的谎言 提交于 2020-12-06 05:29:57
电话TelephonyManager: <receiver android:name=".PhoneReceiver"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE"/> <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> </intent-filter> </receiver> <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission> public class PhoneReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, Intent intent) { if(intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL))

BadgeView 图标上显示提醒的小控件

时光总嘲笑我的痴心妄想 提交于 2019-12-09 21:25:07
BadgeView,是用于显示在图表上,起提示作用,如未读短信有几条等。 import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Typeface; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RoundRectShape; import android.util.AttributeSet; import android.util.TypedValue; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.animation.AccelerateInterpolator; import android.view.animation