Added @StringRes annotation when useful
This commit is contained in:
parent
3497708da5
commit
b4d11291f1
4 changed files with 14 additions and 8 deletions
|
@ -19,8 +19,10 @@
|
|||
*/
|
||||
package org.linphone.activities
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
|
||||
interface SnackBarActivity {
|
||||
fun showSnackBar(resourceId: Int)
|
||||
fun showSnackBar(resourceId: Int, action: Int, listener: () -> Unit)
|
||||
fun showSnackBar(@StringRes resourceId: Int)
|
||||
fun showSnackBar(@StringRes resourceId: Int, action: Int, listener: () -> Unit)
|
||||
fun showSnackBar(message: String)
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.linphone.activities.assistant
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
|
@ -45,11 +46,11 @@ class AssistantActivity : GenericActivity(), SnackBarActivity {
|
|||
corePreferences.firstStart = false
|
||||
}
|
||||
|
||||
override fun showSnackBar(resourceId: Int) {
|
||||
override fun showSnackBar(@StringRes resourceId: Int) {
|
||||
Snackbar.make(coordinator, resourceId, Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
override fun showSnackBar(resourceId: Int, action: Int, listener: () -> Unit) {
|
||||
override fun showSnackBar(@StringRes resourceId: Int, action: Int, listener: () -> Unit) {
|
||||
Snackbar
|
||||
.make(findViewById(R.id.coordinator), resourceId, Snackbar.LENGTH_LONG)
|
||||
.setAction(action) {
|
||||
|
|
|
@ -28,6 +28,7 @@ import android.os.Parcelable
|
|||
import android.view.Gravity
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
|
@ -109,7 +110,8 @@ class MainActivity : GenericActivity(), SnackBarActivity, NavController.OnDestin
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val splashScreen = installSplashScreen()
|
||||
// Must be done before the setContentView
|
||||
installSplashScreen()
|
||||
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.main_activity)
|
||||
binding.lifecycleOwner = this
|
||||
|
@ -175,11 +177,11 @@ class MainActivity : GenericActivity(), SnackBarActivity, NavController.OnDestin
|
|||
super.onPause()
|
||||
}
|
||||
|
||||
override fun showSnackBar(resourceId: Int) {
|
||||
override fun showSnackBar(@StringRes resourceId: Int) {
|
||||
Snackbar.make(findViewById(R.id.coordinator), resourceId, Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
override fun showSnackBar(resourceId: Int, action: Int, listener: () -> Unit) {
|
||||
override fun showSnackBar(@StringRes resourceId: Int, action: Int, listener: () -> Unit) {
|
||||
Snackbar
|
||||
.make(findViewById(R.id.coordinator), resourceId, Snackbar.LENGTH_LONG)
|
||||
.setAction(action) {
|
||||
|
|
|
@ -34,6 +34,7 @@ import android.os.Vibrator
|
|||
import android.view.WindowManager
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.RemoteViews
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.core.app.Person
|
||||
|
@ -228,7 +229,7 @@ class Api26Compatibility {
|
|||
channel: String,
|
||||
notificationsManager: NotificationsManager
|
||||
): Notification {
|
||||
val stringResourceId: Int
|
||||
@StringRes val stringResourceId: Int
|
||||
val iconResourceId: Int
|
||||
val roundPicture: Bitmap?
|
||||
val title: String
|
||||
|
|
Loading…
Reference in a new issue