Merge pull request #6189 from mhmdanas/fix-some-warnings

Fix some warnings
This commit is contained in:
Tobi 2021-05-04 18:54:17 +02:00 committed by GitHub
commit c7510c628f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 11 deletions

View File

@ -208,7 +208,8 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
if (data != null && data.data != null && resultCode == Activity.RESULT_OK) { if (data != null && data.data != null && resultCode == Activity.RESULT_OK) {
if (requestCode == REQUEST_EXPORT_CODE) { if (requestCode == REQUEST_EXPORT_CODE) {
val exportFile = Utils.getFileForUri(data.data!!) val exportFile = Utils.getFileForUri(data.data!!)
if (!exportFile.parentFile.canWrite() || !exportFile.parentFile.canRead()) { val parentFile = exportFile.parentFile!!
if (!parentFile.canWrite() || !parentFile.canRead()) {
Toast.makeText(activity, R.string.invalid_directory, Toast.LENGTH_SHORT).show() Toast.makeText(activity, R.string.invalid_directory, Toast.LENGTH_SHORT).show()
} else { } else {
activity.startService( activity.startService(

View File

@ -9,6 +9,7 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.Toast import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService import androidx.core.content.getSystemService
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.core.view.isGone import androidx.core.view.isGone
@ -127,7 +128,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) { if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
// KitKat doesn't apply container's theme to <include> content // KitKat doesn't apply container's theme to <include> content
val contrastColor = ColorStateList.valueOf(resources.getColor(R.color.contrastColor)) val contrastColor = ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.contrastColor))
searchLayoutBinding.toolbarSearchEditText.setTextColor(contrastColor) searchLayoutBinding.toolbarSearchEditText.setTextColor(contrastColor)
searchLayoutBinding.toolbarSearchEditText.setHintTextColor(contrastColor.withAlpha(128)) searchLayoutBinding.toolbarSearchEditText.setHintTextColor(contrastColor.withAlpha(128))
ImageViewCompat.setImageTintList(searchLayoutBinding.toolbarSearchClearIcon, contrastColor) ImageViewCompat.setImageTintList(searchLayoutBinding.toolbarSearchClearIcon, contrastColor)
@ -385,7 +386,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
private fun setupIconPicker() { private fun setupIconPicker() {
val groupAdapter = GroupAdapter<GroupieViewHolder>() val groupAdapter = GroupAdapter<GroupieViewHolder>()
groupAdapter.addAll(FeedGroupIcon.values().map { PickerIconItem(requireContext(), it) }) groupAdapter.addAll(FeedGroupIcon.values().map { PickerIconItem(it) })
feedGroupCreateBinding.iconSelector.apply { feedGroupCreateBinding.iconSelector.apply {
layoutManager = GridLayoutManager(requireContext(), 7, RecyclerView.VERTICAL, false) layoutManager = GridLayoutManager(requireContext(), 7, RecyclerView.VERTICAL, false)

View File

@ -1,6 +1,5 @@
package org.schabi.newpipe.local.subscription.item package org.schabi.newpipe.local.subscription.item
import android.content.Context
import android.view.View import android.view.View
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import com.xwray.groupie.viewbinding.BindableItem import com.xwray.groupie.viewbinding.BindableItem
@ -9,7 +8,6 @@ import org.schabi.newpipe.databinding.PickerIconItemBinding
import org.schabi.newpipe.local.subscription.FeedGroupIcon import org.schabi.newpipe.local.subscription.FeedGroupIcon
class PickerIconItem( class PickerIconItem(
context: Context,
val icon: FeedGroupIcon val icon: FeedGroupIcon
) : BindableItem<PickerIconItemBinding>() { ) : BindableItem<PickerIconItemBinding>() {
@DrawableRes @DrawableRes

View File

@ -200,7 +200,6 @@
<string name="title_activity_history">Dîrok</string> <string name="title_activity_history">Dîrok</string>
<string name="read_full_license">Destûrê bixwînin</string> <string name="read_full_license">Destûrê bixwînin</string>
<string name="app_license">NewPipe nermalava kopîleft libre ye: Hûn dikarin li gorî kêfa xwe bikar bînin, parve bikin û baştir bikin. Bi taybetî hûn dikarin wê di bin mercên Lîsansa Giştî ya GNU ya Giştî ya ku ji hêla Weqfa Nermalava Azad ve hatî weşandin de, an guhertoya 3 ya Lîsansê, an jî (li gorî vebijarka we) guhertoyek paşîn ji nû ve belav bikin û / an biguherînin.</string> <string name="app_license">NewPipe nermalava kopîleft libre ye: Hûn dikarin li gorî kêfa xwe bikar bînin, parve bikin û baştir bikin. Bi taybetî hûn dikarin wê di bin mercên Lîsansa Giştî ya GNU ya Giştî ya ku ji hêla Weqfa Nermalava Azad ve hatî weşandin de, an guhertoya 3 ya Lîsansê, an jî (li gorî vebijarka we) guhertoyek paşîn ji nû ve belav bikin û / an biguherînin.</string>
<string name="popup_resizing_indicator_title">Mezinahî kirin</string>
<string name="clear">Zelal</string> <string name="clear">Zelal</string>
<string name="refresh">Hênikkirin</string> <string name="refresh">Hênikkirin</string>
<string name="filter">Parzûn</string> <string name="filter">Parzûn</string>
@ -664,4 +663,4 @@
<string name="action_about">Derbar</string> <string name="action_about">Derbar</string>
<string name="action_settings">Mîhengên</string> <string name="action_settings">Mîhengên</string>
<string name="crash_the_app">Serlêdanê kilît bikin</string> <string name="crash_the_app">Serlêdanê kilît bikin</string>
</resources> </resources>

View File

@ -277,7 +277,6 @@
<string name="file_deleted">Fails izdzēsts</string> <string name="file_deleted">Fails izdzēsts</string>
<string name="undo">Atsaukt</string> <string name="undo">Atsaukt</string>
<string name="best_resolution">Labākā izšķirtspēja</string> <string name="best_resolution">Labākā izšķirtspēja</string>
<string name="popup_resizing_indicator_title">Maina izmēru</string>
<string name="clear">Notīrīt</string> <string name="clear">Notīrīt</string>
<string name="refresh">Atsvaidzināt</string> <string name="refresh">Atsvaidzināt</string>
<string name="filter">Filtrēt</string> <string name="filter">Filtrēt</string>
@ -690,4 +689,4 @@
<string name="restricted_video_no_stream">Šis video ir ierobežots ar vecumu. <string name="restricted_video_no_stream">Šis video ir ierobežots ar vecumu.
\nŅemot vērā jauno YouTube politiku ar vecuma ierobežotiem videoklipiem, Newpipe nevar piekļūt šim videoklipam.</string> \nŅemot vērā jauno YouTube politiku ar vecuma ierobežotiem videoklipiem, Newpipe nevar piekļūt šim videoklipam.</string>
<string name="night_theme_title">Nakts Motīvs</string> <string name="night_theme_title">Nakts Motīvs</string>
</resources> </resources>

View File

@ -489,7 +489,6 @@
<string name="drawer_header_description">Укључи / искључи услугу, која је тренутно изабрана:</string> <string name="drawer_header_description">Укључи / искључи услугу, која је тренутно изабрана:</string>
<string name="detail_drag_description">Превуците за преуређивање</string> <string name="detail_drag_description">Превуците за преуређивање</string>
<string name="description_tab_description">Опис</string> <string name="description_tab_description">Опис</string>
<string name="related_streams_tab_description">Повезани стримови</string>
<string name="comments_tab_description">Коментари</string> <string name="comments_tab_description">Коментари</string>
<string name="error_report_open_github_notice">Проверите да ли већ постоји проблем који говори о вашем паду апликације. Када правите дупликате карата, одузимате нам време које бисмо могли потрошити на исправљање стварне грешке.</string> <string name="error_report_open_github_notice">Проверите да ли већ постоји проблем који говори о вашем паду апликације. Када правите дупликате карата, одузимате нам време које бисмо могли потрошити на исправљање стварне грешке.</string>
<string name="error_report_open_issue_button_text">Пријави на GitHub-у</string> <string name="error_report_open_issue_button_text">Пријави на GitHub-у</string>
@ -690,4 +689,4 @@
</plurals> </plurals>
<string name="show_channel_details">Прикажи детаље о каналу</string> <string name="show_channel_details">Прикажи детаље о каналу</string>
<string name="related_items_tab_description">Повезани предмети</string> <string name="related_items_tab_description">Повезани предмети</string>
</resources> </resources>