{"id":360,"date":"2020-04-13T14:25:03","date_gmt":"2020-04-13T06:25:03","guid":{"rendered":"https:\/\/badgameshow.com\/fly\/?p=360"},"modified":"2021-02-26T16:21:47","modified_gmt":"2021-02-26T08:21:47","slug":"github-%e5%a5%bd%e7%94%a8%e5%88%86%e4%ba%abandroid-floatwindow","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/fly\/github-%e5%a5%bd%e7%94%a8%e5%88%86%e4%ba%abandroid-floatwindow\/","title":{"rendered":"Github \u597d\u7528\u5206\u4eabAndroid FloatWindow"},"content":{"rendered":"<h1>Github \u597d\u7528\u5206\u4eabAndroid FloatWindow<\/h1>\n<h4>1.\u5c0e\u5165Library<\/h4>\n<h5>build.gradle: Project<\/h5>\n<pre><code class=\"language-Gradle line-numbers\">allprojects {\n    repositories {\n        google()\n        jcenter()\n        maven { url 'https:\/\/jitpack.io' }\n    }\n}\n<\/code><\/pre>\n<h5>build.gradle: Module<\/h5>\n<pre><code class=\"language-Gradle line-numbers\">dependencies {\n    implementation 'com.github.yhaolpz:FloatWindow:1.0.9'\n}\n<\/code><\/pre>\n<h4>2.\u5275\u5efaMyApplication<\/h4>\n<pre><code class=\"language-Kotlin line-numbers\">class MyApplication : Application() {\n\n    override fun onCreate() {\n        super.onCreate()\n\n        val imageView = ImageView(this)\n        imageView.setImageResource(R.drawable.girl)\n\n        FloatWindow.with(this)\n            .setView(imageView)\n            .setWidth(Screen.width, 0.5f) \/\/\u8bbe\u7f6e\u60ac\u6d6e\u63a7\u4ef6\u5bbd\u9ad8\n            .setHeight(Screen.height, 0.5f)\n            .setX(Screen.width, 0.3f)\n            .setY(Screen.height, 0.3f)\n            .setMoveStyle(500, BounceInterpolator())\n            .setDesktopShow(true)\n            .build()\n    }\n}\n<\/code><\/pre>\n<h4>3.\u589e\u52a0\u6b0a\u9650 &amp; \u8a3b\u518aApplication name<\/h4>\n<pre><code class=\"language-Kotlin line-numbers\">&lt;uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" \/&gt;\n\n&lt;application\n    android:name=\".MyApplication\"\n    android:allowBackup=\"true\"\n    android:icon=\"@mipmap\/ic_launcher\"\n    android:label=\"@string\/app_name\"\n    android:supportsRtl=\"true\"\n    android:theme=\"@style\/Theme.GitTest\"&gt;\n    &lt;activity\n        android:name=\".MainActivity\"&gt;\n        &lt;intent-filter&gt;\n            &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\n\n            &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\n        &lt;\/intent-filter&gt;\n    &lt;\/activity&gt;\n&lt;\/application&gt;\n<\/code><\/pre>\n<h4>4.\u6548\u679c\u5c55\u793a<\/h4>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2020\/04\/20210226_161913.gif\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2020\/04\/20210226_161913-138x300.gif\" alt=\"\" \/><\/a><\/p>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Github \u597d\u7528\u5206\u4eabAndroid FloatWindow 1.\u5c0e\u5165Library build.gradle &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[57],"tags":[60,56,14],"class_list":["post-360","post","type-post","status-publish","format-standard","hentry","category-github","tag-floatwindow","tag-github","tag-java"],"_links":{"self":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":5,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":1186,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/360\/revisions\/1186"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/media?parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/categories?post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/tags?post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}