New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Settings #9
base: Pagination(spr4)
Are you sure you want to change the base?
Settings #9
Conversation
val name = "LatestChannel" | ||
val descriptionText = "FilmsSearch notification Channel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хорошо бы в константы
override fun onReceive(context: Context?, intent: Intent?) { | ||
if (intent == null) return | ||
when (intent.action) { | ||
Intent.ACTION_BATTERY_LOW -> Toast.makeText(context, "Батарея разряжена", Toast.LENGTH_SHORT).show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Текст для UI нужно хранить в R.string
class SettingsFragment : Fragment() { | ||
private lateinit var binding: FragmentSettingsBinding | ||
private val viewModel by lazy { | ||
ViewModelProvider.NewInstanceFactory().create(SettingsFragmentViewModel::class.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Таким образом нет связи с ЖЦ, так можно, но лучше использовать:
private val viewModel: ViewModelClass by lazy {
ViewModelProvider(this).get(ViewModelClass::class.java)
}
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
AnimationHelper.performFragmentCircularRevealAnimation(binding.settingsFragmentRoot, requireActivity(), 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic number🧙
val pendingIntent = | ||
PendingIntent.getActivity(context, 0, mIntent, PendingIntent.FLAG_UPDATE_CURRENT) | ||
|
||
val builder = NotificationCompat.Builder(context!!, NotificationConstants.CHANNEL_ID).apply { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
зачем !! ?
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fitsSystemWindows="true" | ||
android:minHeight="60dp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Размеры в R.dimen
No description provided.