-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
( #1 ) PSP Enhancement: Hide clock bar & show title-subtitle separator
Background color can now be adjusted (now only for main Vsh View)
- Loading branch information
1 parent
170b87f
commit 2146e47
Showing
7 changed files
with
198 additions
and
60 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
31 changes: 31 additions & 0 deletions
31
app/src/main/java/id/psw/vshlauncher/customtypes/HexInputFilter.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,31 @@ | ||
package id.psw.vshlauncher.customtypes | ||
|
||
import android.text.InputFilter | ||
import android.text.Spanned | ||
import java.util.* | ||
|
||
|
||
class HexInputFilter : InputFilter { | ||
companion object{ | ||
private val hexItems = "#0123456789ABCDEFabcdef" | ||
} | ||
|
||
override fun filter( | ||
source: CharSequence?, | ||
start: Int, | ||
end: Int, | ||
dest: Spanned?, | ||
dstart: Int, | ||
dend: Int | ||
): CharSequence { | ||
|
||
val sb = StringBuilder() | ||
|
||
for (i in start until end) { | ||
val chr = (source?.get(i) ?: ' ').toUpperCase() | ||
val validHex = hexItems.contains(chr) | ||
if(validHex) sb.append(chr) | ||
} | ||
return sb.toString().toUpperCase(Locale.ROOT) | ||
} | ||
} |
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.