Skip to content

Commit 8a7f203

Browse files
Merge pull request #4 from Omega-R/develop
Added annotation WindowFlags
2 parents a78a83d + a8f11f1 commit 8a7f203

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.omega_r.base.annotations
2+
3+
import androidx.annotation.StyleRes
4+
5+
/**
6+
* Created by Anton Knyazev on 10.04.19.
7+
*/
8+
@Target(AnnotationTarget.CLASS)
9+
@Retention(AnnotationRetention.RUNTIME)
10+
annotation class OmegaWindowFlags(val addFlags: Int = 0, val clearFlags: Int = 0)

lib/src/main/java/com/omega_r/base/components/OmegaActivity.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ open class OmegaActivity : MvpAppCompatActivity(), OmegaBindable, OmegaView, Ome
4242
override fun getContext(): Context = this
4343

4444
override fun onCreate(savedInstanceState: Bundle?) {
45+
this::class.findAnnotation<OmegaWindowFlags>()?.let {
46+
window?.apply {
47+
addFlags(it.addFlags)
48+
clearFlags(it.clearFlags)
49+
}
50+
}
51+
4552
super.onCreate(savedInstanceState)
4653

4754
this::class.findAnnotation<OmegaTheme>()?.let {
@@ -56,6 +63,7 @@ open class OmegaActivity : MvpAppCompatActivity(), OmegaBindable, OmegaView, Ome
5663
}
5764
}
5865

66+
5967
override fun onPostCreate(savedInstanceState: Bundle?) {
6068
super.onPostCreate(savedInstanceState)
6169
bindersManager.doAutoInit()

0 commit comments

Comments
 (0)