Update Simple-Commons and remove useless annotations

The reason they were needed was the linter couldn't understand
their usage when they aren't in the same project but with the
updated Simple-Commons it now can.
This commit is contained in:
Ebrahim Byagowi 2021-12-06 00:34:27 +03:30
parent 62cb24f5d6
commit 26294b1d54
5 changed files with 2 additions and 11 deletions

View File

@ -67,7 +67,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:307941253d' implementation 'com.github.SimpleMobileTools:Simple-Commons:eee4809d37'
implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2' implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'com.shawnlin:number-picker:2.4.6' implementation 'com.shawnlin:number-picker:2.4.6'

View File

@ -77,7 +77,7 @@ class ReminderActivity : SimpleActivity() {
} }
} }
@SuppressLint("NewApi") @SuppressLint("ClickableViewAccessibility")
private fun setupAlarmButtons() { private fun setupAlarmButtons() {
reminder_stop.beGone() reminder_stop.beGone()
reminder_draggable_background.startAnimation(AnimationUtils.loadAnimation(this, R.anim.pulsing_animation)) reminder_draggable_background.startAnimation(AnimationUtils.loadAnimation(this, R.anim.pulsing_animation))

View File

@ -1,6 +1,5 @@
package com.simplemobiletools.clock.extensions package com.simplemobiletools.clock.extensions
import android.annotation.SuppressLint
import android.app.* import android.app.*
import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetManager
import android.content.ComponentName import android.content.ComponentName
@ -182,7 +181,6 @@ fun Context.updateWidgets() {
} }
} }
@SuppressLint("NewApi")
fun Context.scheduleNextWidgetUpdate() { fun Context.scheduleNextWidgetUpdate() {
val widgetsCnt = val widgetsCnt =
AppWidgetManager.getInstance(applicationContext)?.getAppWidgetIds(ComponentName(applicationContext, MyWidgetDateTimeProvider::class.java)) ?: return AppWidgetManager.getInstance(applicationContext)?.getAppWidgetIds(ComponentName(applicationContext, MyWidgetDateTimeProvider::class.java)) ?: return
@ -267,7 +265,6 @@ fun Context.showAlarmNotification(alarm: Alarm) {
} }
} }
@SuppressLint("NewApi")
fun Context.getTimerNotification(timer: Timer, pendingIntent: PendingIntent, addDeleteIntent: Boolean): Notification { fun Context.getTimerNotification(timer: Timer, pendingIntent: PendingIntent, addDeleteIntent: Boolean): Notification {
var soundUri = timer.soundUri var soundUri = timer.soundUri
if (soundUri == SILENT) { if (soundUri == SILENT) {
@ -351,7 +348,6 @@ fun Context.getHideAlarmPendingIntent(alarm: Alarm): PendingIntent {
return PendingIntent.getBroadcast(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT) return PendingIntent.getBroadcast(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
} }
@SuppressLint("NewApi")
fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): Notification { fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): Notification {
val soundUri = alarm.soundUri val soundUri = alarm.soundUri
if (soundUri != SILENT) { if (soundUri != SILENT) {

View File

@ -1,6 +1,5 @@
package com.simplemobiletools.clock.receivers package com.simplemobiletools.clock.receivers
import android.annotation.SuppressLint
import android.app.NotificationChannel import android.app.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
import android.app.PendingIntent import android.app.PendingIntent
@ -21,7 +20,6 @@ import com.simplemobiletools.commons.helpers.isOreoPlus
class AlarmReceiver : BroadcastReceiver() { class AlarmReceiver : BroadcastReceiver() {
@SuppressLint("NewApi")
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
val id = intent.getIntExtra(ALARM_ID, -1) val id = intent.getIntExtra(ALARM_ID, -1)
val alarm = context.dbHelper.getAlarmWithId(id) ?: return val alarm = context.dbHelper.getAlarmWithId(id) ?: return

View File

@ -1,13 +1,11 @@
package com.simplemobiletools.clock.services package com.simplemobiletools.clock.services
import android.annotation.TargetApi
import android.app.Notification import android.app.Notification
import android.app.NotificationChannel import android.app.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
import android.app.Service import android.app.Service
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Build
import android.os.IBinder import android.os.IBinder
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
@ -86,7 +84,6 @@ class TimerService : Service() {
bus.unregister(this) bus.unregister(this)
} }
@TargetApi(Build.VERSION_CODES.O)
private fun notification(title: String, contentText: String, firstRunningTimerId: Int): Notification { private fun notification(title: String, contentText: String, firstRunningTimerId: Int): Notification {
val channelId = "simple_alarm_timer" val channelId = "simple_alarm_timer"
val label = getString(R.string.timer) val label = getString(R.string.timer)