-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hope i finally fixed JNI crashes handling, also improved UI a little
- Loading branch information
F0x1d
committed
Nov 8, 2022
1 parent
04945e4
commit 071f0f3
Showing
45 changed files
with
366 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/f0x1d/logfox/extensions/ViewExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.f0x1d.logfox.extensions | ||
|
||
import android.view.View | ||
import com.google.android.material.snackbar.Snackbar | ||
|
||
fun View.snackbar(text: String) = Snackbar.make(this, text, Snackbar.LENGTH_SHORT).show() |
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/f0x1d/logfox/extensions/ViewInsetsExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.f0x1d.logfox.extensions | ||
|
||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.core.graphics.Insets | ||
import androidx.core.view.ViewCompat | ||
import androidx.core.view.WindowInsetsCompat | ||
import androidx.core.view.updateLayoutParams | ||
|
||
fun View.applyTopInsets(view: View) = applyInsets(view) { insets -> | ||
updateLayoutParams<ViewGroup.MarginLayoutParams> { | ||
topMargin = insets.top | ||
} | ||
} | ||
|
||
fun View.applyBottomInsets(view: View) = applyInsets(view) { insets -> | ||
updateLayoutParams<ViewGroup.MarginLayoutParams> { | ||
bottomMargin = insets.bottom | ||
} | ||
} | ||
|
||
fun View.applyInsets(view: View, block: View.(Insets) -> Unit) { | ||
ViewCompat.setOnApplyWindowInsetsListener(view) { _, windowInsets -> | ||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) | ||
|
||
block.invoke(this, insets) | ||
|
||
windowInsets | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.