web-dev-qa-db-ja.com

Oreo(API 26)-drawOverlay +ドローオーバーステータスバー

Android oreoでは、WindowManager.LayoutParams.TYPE_SYSTEM_ERRORを使用できなくなり、代わりにWindowManager.LayoutParams.TYPE_APPLICATION_OVERLAYを使用する必要があります。欠点は、このモードではステータスバーが描画されないことです。

古い動作を実現し、ステータスバーも描画できるようにする方法はありますか?私はサイドバーアプリを持っていて、これまで、ユーザーが画面の上部にもトリガー領域を持つことを許可していましたが、ステータスバーが上部のタッチ可能な領域と重なっているため、これは機能しなくなりました...

たとえばルート化されたデバイスなど、一部のデバイスのみを対象としている場合でも、任意のソリューションに興味があります... Androidシステムはそうではないため、この問題の通常のソリューションはないと思いますドキュメントに記載されているように、これをもう許可します( https://developer.Android.com/about/versions/oreo/Android-8.0-changes.html#o-apps )。それでも、これは許可されません。必要なことは、代替の解決策がないことを意味します。

16
prom85

ドキュメントによると、このフラグはシステム以外のアプリでは非推奨です。アプリをシステムアプリにしてみましたか?

この定数は、APIレベル26で非推奨になりました。非システムアプリ

ESファイルエクスプローラーの使用方法は次のとおりです。

Configure ES File Explorer by doing the following steps:
    Launch ES File Explorer.
    Select Menu and choose Settings.
    Under Settings, enable the options for Up to root and Root Explorer. A message will appear, requiring you to confirm your action. You will also need to confirm Superuser access.
    Enable Mount File System.
    Go back to the app’s main menu.
Get a copy of the APK (Android Package) of the app that you want to save as a system file by doing the following steps (skip to step 3 if you already have the app’s APK file):
    Install an app from the Google Play Store. For this guide, we will be using the app BioRhythms as an example.
    Launch ES File Explorer and navigate to /data/app.
    Locate the APK file that you want to install as a system app. If you don’t know the APK’s filename, simply go to the Google Play Store link of your chosen app. View the link and take note of the words after “?id=”. This will be your APK’s filename. For instance, the BioRhythms app link is https://play.google.com/store/apps/details?id=app.biorhythms. The BioRhythms’ APK is app.biorhythms-1.apk.
Create a backup of the chosen APK by copying it to the phone’s SD Card.
After creating a backup, long tap on the APK file and a menu will appear. Choose Cut. A blue arrow will appear at the bottom of the screen.
Go back to the main menu and navigate to /system/app/.
Drag the little arrow at the bottom of the screen. It will bring up the icon of the APK file.
Tap the APK file and it will be transferred to /system/app/.
Find the APK file in /system/app/. Press and hold it and a menu will appear.
Select Properties on the menu. The dialog properties will show up.
Tap Change and it will show the permissions dialog box.
Check the boxes for the following permissions in the dialog box:
    User: Read and Write
    Group: Read
    Other: Read
Select OK once the required settings have been made.
Reboot your device.
2
sfratini

残念ながら、これはもはや不可能です...

この機能を利用する開発者は、Android’s Issue Tracker (#260787 and #36574245)に関するbugレポートを開いて、変更に抗議し、代替のAPIを要求しましたが、Google社員はtrackerについてコメントしました。次のステートメントで:

ステータス:修正されない(意図された動作)

製品およびエンジニアリングチームにフォローアップし、開発者がSHOW_WHEN_LOCKEDアクティビティを使用してデバイスがロックされていることを示すことができるという提案を受けましたが、ロック画面/通知シェードの上に表示することは意図的にできなくなりました

これに対する解決策は、ターゲットsdkを25に設定することだけです。

2

Android oreoでは、Googleが日付まで通知線を描画するためのサポートを停止したため、それを行うことはできません。将来的には、多くの開発者が抗議しているため、実装を検討する可能性がありますそれ。

詳細については、以下のリンクをご覧ください。

https://www.androidauthority.com/Android-o-draw-over-system-763178/

https://www.reddit.com/r/Android/comments/64ffk1/Android_o_is_breaking_apps_that_overlay_on_top_of/