-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix copy popup menu not dismissing when clicking elsewhere (#172)
While on that also add missing copyright headers in test files --------- Signed-off-by: starry-shivam <[email protected]>
- Loading branch information
1 parent
edb0da2
commit 781f523
Showing
10 changed files
with
224 additions
and
102 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
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/starry/myne/ui/screens/reader/others/ReaderFont.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,56 @@ | ||
/** | ||
* Copyright (c) [2022 - Present] Stɑrry Shivɑm | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.starry.myne.ui.screens.reader.others | ||
|
||
import androidx.annotation.Keep | ||
import androidx.compose.ui.text.font.Font | ||
import androidx.compose.ui.text.font.FontFamily | ||
import com.starry.myne.R | ||
import com.starry.myne.ui.theme.figeronaFont | ||
|
||
@Keep | ||
sealed class ReaderFont(val id: String, val name: String, val fontFamily: FontFamily) { | ||
|
||
companion object { | ||
fun getAllFonts() = | ||
ReaderFont::class.sealedSubclasses.mapNotNull { it.objectInstance }.sortedBy { it.name } | ||
|
||
fun getFontByName(name: String) = getAllFonts().find { it.name == name }!! | ||
} | ||
|
||
@Keep | ||
data object System : ReaderFont("system", "System Default", FontFamily.Default) | ||
|
||
@Keep | ||
data object Serif : ReaderFont("serif", "Serif", FontFamily.Serif) | ||
|
||
@Keep | ||
data object Cursive : ReaderFont("cursive", "Cursive", FontFamily.Cursive) | ||
|
||
@Keep | ||
data object SansSerif : ReaderFont("sans-serif", "SansSerif", FontFamily.SansSerif) | ||
|
||
@Keep | ||
data object Inter : ReaderFont("inter", "Inter", FontFamily(Font(R.font.reader_inter_font))) | ||
|
||
@Keep | ||
data object Dyslexic : | ||
ReaderFont("dyslexic", "OpenDyslexic", FontFamily(Font(R.font.reader_inter_font))) | ||
|
||
@Keep | ||
data object Lora : ReaderFont("figerona", "Figerona", figeronaFont) | ||
} |
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.