1

음악을 잠금 화면에서 재생하는 중에 Android 뮤직 플레이어를 사용하고 있습니다.이 스크린 샷처럼 Buttom에 애니메이션이 표시됩니다. 내가 잠금 화면에서 같은 안드로이드 누가와 같은 장치에서 내 자신의 앱 Media Player를 사용하는 경우Android Nougat Media Player는 어떻게 음악을 잠금 화면에 넣을까요?

enter image description here

는하지만 애니메이션을 표시 해달라고.

enter image description here

질문 : 어떻게 내가 내 미디어 플레이어 앱에서 애니메이션을 추가 할 수 있습니까? 애니메이션은 음악의 리듬으로 움직이기 때문에 그것은 gif 이미지가 아닙니다.

** 무언가를 놓치고 있거나 다른 것을 추가해야하는 경우 이것은 ** 알림 방법 **입니다.

ublic void Custom_Notificacion(){ 

    Notification notification = new Notification(R.drawable.logobubble, null, System.currentTimeMillis()); 

    notificationView = new RemoteViews(getPackageName(), R.layout.layout_notificacion_personalizada); 

    notificationView.setImageViewBitmap(R.id.id_FotoAlbumNotif,FotoNotif); 
    notificationView.setTextViewText(R.id.id_NombreMp3Notif,NommbreArtista); 
    notificationView.setTextViewText(R.id.id_NombreCancionNotif,NombreCancion); 

    notification.contentView = notificationView; 
    notification.flags |= Notification.FLAG_NO_CLEAR; 

    startForeground(constantes.NOTIFICATION_ID.FOREGROUND_SERVICE,notification); 

} 

답변

1

나는이에 대한 기사를 읽은는 가능한 솔루션은 사용자 정의 잠금 화면 페이지이며, 당신이 LOCK_SCREEN 방송하고 시작을 듣고 서비스를 필요로이를 달성하기 위해, 그 안에 애니메이션보기를 표시 LockScreenActivity, 시스템 잠금 화면을 동시에 교체하십시오. 방법

private BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() { 
@SuppressWarnings("deprecation") 
@Override 
public void onReceive(Context context, Intent intent) { 
    if (intent.getAction().equals(NOTIFY_SCREEN_OFF)) { 
     Intent mLockIntent = new Intent(context, LockScreenActivity.class); 
     mLockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK 
       | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); 
     startActivity(mLockIntent); 
    } 
} 

해제 잠금 화면

KeyguardManager mKeyguardManager = (KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE); 
KeyguardManager.KeyguardLock mKeyguardLock = mKeyguardManager.newKeyguardLock("CustomLockScreen"); 
mKeyguardLock.disableKeyguard(); 

희망이를받을

IntentFilter mScreenOffFilter = new IntentFilter(); 
mScreenOffFilter.addAction(Intent.ACTION_SCREEN_OFF); 
registerReceiver(mScreenOffReceiver, mScreenOffFilter); 

//에 등록 방송 수신기 : 여기 몇 가지 코드 세그먼트는 도움이 될 수있다 약간의 도움이 될 수있다

+0

나는 이것을 시험해 볼 것이다, 당신의 anwser에게 감사한다. –