mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 13:17:43 +00:00
Make linter happy: keep nullable/nonnull annotations
This commit is contained in:
parent
00f3fc43d0
commit
cef68db2a6
@ -19,6 +19,7 @@ import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.AnyThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.WorkerThread;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
@ -112,6 +113,7 @@ public class Device implements BaseLink.PacketReceiver {
|
||||
return Computer; //Default
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case Tablet:
|
||||
|
@ -10,6 +10,7 @@ import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
|
||||
@ -24,7 +25,7 @@ public class LongSummaryPreferenceCategory extends PreferenceCategory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
TextView summary = (TextView) holder.findViewById(android.R.id.summary);
|
||||
summary.setMaxLines(3);
|
||||
|
@ -420,6 +420,7 @@ public class TelephonyHelper {
|
||||
this.subscriptionID = subscriptionID;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return number;
|
||||
|
@ -128,8 +128,9 @@ public class SftpSettingsFragment
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
|
||||
protected RecyclerView.Adapter onCreateAdapter(@NonNull PreferenceScreen preferenceScreen) {
|
||||
if (savedActionModeState != null) {
|
||||
getListView().post(this::restoreActionMode);
|
||||
}
|
||||
@ -162,7 +163,7 @@ public class SftpSettingsFragment
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog(Preference preference) {
|
||||
public void onDisplayPreferenceDialog(@NonNull Preference preference) {
|
||||
if (preference instanceof StoragePreference) {
|
||||
StoragePreferenceDialogFragment fragment = StoragePreferenceDialogFragment.newInstance(preference.getKey());
|
||||
fragment.setTargetFragment(this, 0);
|
||||
@ -174,7 +175,7 @@ public class SftpSettingsFragment
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
try {
|
||||
@ -340,7 +341,7 @@ public class SftpSettingsFragment
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
|
||||
SftpPlugin.StorageInfo newStorageInfo = (SftpPlugin.StorageInfo) newValue;
|
||||
|
||||
ListIterator<SftpPlugin.StorageInfo> it = storageInfoList.listIterator();
|
||||
|
@ -96,7 +96,7 @@ public class StoragePreference extends DialogPreference {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
|
||||
checkbox = (CheckBox) holder.itemView.findViewById(R.id.checkbox);
|
||||
|
@ -104,7 +104,7 @@ public class StoragePreferenceDialogFragment extends PreferenceDialogFragmentCom
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
protected void onBindDialogView(@NonNull View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
binding = FragmentStoragePreferenceDialogBinding.bind(view);
|
||||
|
@ -100,7 +100,7 @@ public class AlertDialogFragment extends DialogFragment implements DialogInterfa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
public void onCancel(@NonNull DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
|
||||
if (callback != null) {
|
||||
@ -109,7 +109,7 @@ public class AlertDialogFragment extends DialogFragment implements DialogInterfa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
|
||||
if (callback != null) {
|
||||
|
@ -368,7 +368,7 @@ public class MainActivity extends AppCompatActivity implements SharedPreferences
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putString(STATE_SELECTED_DEVICE, mCurrentDevice);
|
||||
outState.putInt(STATE_SELECTED_MENU_ENTRY, mCurrentMenuEntry);
|
||||
|
@ -130,7 +130,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
mActivity = ((MainActivity) getActivity());
|
||||
}
|
||||
@ -286,7 +286,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.pairing, menu);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ setIcon(android.R.color.transparent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
|
||||
View.OnClickListener toggleListener = v -> {
|
||||
|
@ -93,8 +93,9 @@ public class PluginSettingsListFragment extends PreferenceFragmentCompat {
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
|
||||
protected RecyclerView.Adapter onCreateAdapter(@NonNull PreferenceScreen preferenceScreen) {
|
||||
RecyclerView.Adapter adapter = super.onCreateAdapter(preferenceScreen);
|
||||
|
||||
/*
|
||||
@ -144,7 +145,7 @@ public class PluginSettingsListFragment extends PreferenceFragmentCompat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
Parcelable layoutManagerState = recyclerViewLayoutManagerState;
|
||||
|
@ -32,6 +32,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
||||
|
||||
private EditTextPreference renameDevice;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
if (getActivity() != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user