From 77dc03c679d2a213bff17078e08ece99b2410371 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 15 Jun 2023 08:02:06 -0400 Subject: [PATCH] Fixing rest of build warnings. (#641) Co-authored-by: Kevin Phoenix --- app/src/main/AndroidManifest.xml | 1 - app/src/main/java/com/jerboa/MainActivity.kt | 2 -- app/src/main/java/com/jerboa/Utils.kt | 2 -- .../main/java/com/jerboa/ui/components/common/Dialogs.kt | 2 +- .../jerboa/ui/components/community/list/CommunityList.kt | 8 ++++++-- .../java/com/jerboa/ui/components/post/PostActivity.kt | 2 -- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a1da29793..41d8c1593 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,7 +6,6 @@ - context.getString(R.string.sorttype_topall) SortType.MostComments -> context.getString(R.string.sorttype_mostcomments) SortType.NewComments -> context.getString(R.string.sorttype_newcomments) - else -> "Missing String Localization for Enum SortType" } return returnString } @@ -940,7 +939,6 @@ fun getLocalizedStringForUserTab(ctx: Context, tab: UserTab): String { UserTab.About -> ctx.getString(R.string.person_profile_activity_about) UserTab.Posts -> ctx.getString(R.string.person_profile_activity_posts) UserTab.Comments -> ctx.getString(R.string.person_profile_activity_comments) - else -> "Missing String Localization for Enum UserTab" } return returnString } diff --git a/app/src/main/java/com/jerboa/ui/components/common/Dialogs.kt b/app/src/main/java/com/jerboa/ui/components/common/Dialogs.kt index 87ab6c22c..2721e9986 100644 --- a/app/src/main/java/com/jerboa/ui/components/common/Dialogs.kt +++ b/app/src/main/java/com/jerboa/ui/components/common/Dialogs.kt @@ -368,7 +368,7 @@ fun ShowChangelog(appSettingsViewModel: AppSettingsViewModel) { val releasesUrl = "https://raw.githubusercontent.com/dessalines/jerboa/main/RELEASES.md".toHttpUrl() val req = Request.Builder().url(releasesUrl).build() val res = client.newCall(req).execute() - markdown.value = res.body?.string() ?: "" + markdown.value = res.body.string() } } } diff --git a/app/src/main/java/com/jerboa/ui/components/community/list/CommunityList.kt b/app/src/main/java/com/jerboa/ui/components/community/list/CommunityList.kt index 8fd478814..16490865d 100644 --- a/app/src/main/java/com/jerboa/ui/components/community/list/CommunityList.kt +++ b/app/src/main/java/com/jerboa/ui/components/community/list/CommunityList.kt @@ -173,11 +173,15 @@ fun CommunityTopBarSearchView( } }, singleLine = true, - colors = TextFieldDefaults.textFieldColors( - containerColor = Color.Transparent, + colors = TextFieldDefaults.colors( + focusedContainerColor = Color.Transparent, + unfocusedContainerColor = Color.Transparent, + disabledContainerColor = Color.Transparent, + errorContainerColor = Color.Transparent, focusedIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent, disabledIndicatorColor = Color.Transparent, + ), keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search), ) diff --git a/app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt b/app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt index 0b9c81245..a95a994aa 100644 --- a/app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt +++ b/app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt @@ -44,7 +44,6 @@ import com.jerboa.R import com.jerboa.VoteType import com.jerboa.datatypes.CommentSortType import com.jerboa.db.AccountViewModel -import com.jerboa.db.AppSettingsViewModel import com.jerboa.getCommentParentId import com.jerboa.getDepthFromComment import com.jerboa.isModerator @@ -86,7 +85,6 @@ fun PostActivity( commentReplyViewModel: CommentReplyViewModel, postEditViewModel: PostEditViewModel, navController: NavController, - appSettingsViewModel: AppSettingsViewModel, showCollapsedCommentContent: Boolean, showActionBarByDefault: Boolean, showVotingArrowsInListView: Boolean,