Messaging: Nullability
Change-Id: I8bcde2a868a9c8989971d056be24ff4986e4f8f3
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,6 +18,8 @@ package com.android.messaging.ui.conversationlist;
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -71,7 +74,7 @@ public class ArchivedConversationListActivity extends AbstractConversationListAc
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem menuItem) {
|
||||
switch(menuItem.getItemId()) {
|
||||
case R.id.action_debug_options:
|
||||
onActionBarDebug();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,6 +19,8 @@ package com.android.messaging.ui.conversationlist;
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -83,7 +86,7 @@ public class ConversationListActivity extends AbstractConversationListActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(final MenuItem menuItem) {
|
||||
public boolean onOptionsItemSelected(@NonNull final MenuItem menuItem) {
|
||||
switch(menuItem.getItemId()) {
|
||||
case R.id.action_start_new_conversation:
|
||||
onActionBarStartNewConversation();
|
||||
|
||||
@@ -24,6 +24,8 @@ import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.ViewGroupCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -195,7 +197,8 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
||||
int mCurrentState = AbsListView.OnScrollListener.SCROLL_STATE_IDLE;
|
||||
|
||||
@Override
|
||||
public void onScrolled(final RecyclerView recyclerView, final int dx, final int dy) {
|
||||
public void onScrolled(@NonNull final RecyclerView recyclerView, final int dx,
|
||||
final int dy) {
|
||||
if (mCurrentState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL
|
||||
|| mCurrentState == AbsListView.OnScrollListener.SCROLL_STATE_FLING) {
|
||||
ImeUtil.get().hideImeKeyboard(getActivity(), mRecyclerView);
|
||||
@@ -209,7 +212,8 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(final RecyclerView recyclerView, final int newState) {
|
||||
public void onScrollStateChanged(@NonNull final RecyclerView recyclerView,
|
||||
final int newState) {
|
||||
mCurrentState = newState;
|
||||
}
|
||||
});
|
||||
@@ -326,7 +330,8 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
|
||||
public void onCreateOptionsMenu(@NonNull final Menu menu,
|
||||
@NonNull final MenuInflater inflater) {
|
||||
if (!isAdded()) {
|
||||
// Guard against being called before we're added to the activity
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +22,8 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.RecyclerView.OnItemTouchListener;
|
||||
@@ -81,7 +84,8 @@ public class ConversationListSwipeHelper implements OnItemTouchListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(final RecyclerView recyclerView, final MotionEvent event) {
|
||||
public boolean onInterceptTouchEvent(@NonNull final RecyclerView recyclerView,
|
||||
final MotionEvent event) {
|
||||
if (event.getPointerCount() > 1) {
|
||||
// Ignore subsequent pointers.
|
||||
return false;
|
||||
@@ -169,7 +173,8 @@ public class ConversationListSwipeHelper implements OnItemTouchListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchEvent(final RecyclerView recyclerView, final MotionEvent event) {
|
||||
public void onTouchEvent(@NonNull final RecyclerView recyclerView,
|
||||
@NonNull final MotionEvent event) {
|
||||
// We should only be here if we intercepted the touch due to swipe.
|
||||
Assert.isTrue(mIsSwiping);
|
||||
|
||||
@@ -459,4 +464,4 @@ public class ConversationListSwipeHelper implements OnItemTouchListener {
|
||||
private float getLastComputedXVelocity() {
|
||||
return mVelocityTracker.getXVelocity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user