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