Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jinliu9508 committed Nov 28, 2023
1 parent a29b25b commit d63c3fd
Show file tree
Hide file tree
Showing 67 changed files with 208 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

public class EnumSelectionRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private Font font;
private LayoutInflater layoutInflater;
private final Font font;
private final LayoutInflater layoutInflater;

private Context context;
private Object[] enums;
private EnumSelectionCallback callback;
private final Context context;
private final Object[] enums;
private final EnumSelectionCallback callback;


public EnumSelectionRecyclerViewAdapter(Context context, Object[] enums, EnumSelectionCallback callback) {
Expand Down Expand Up @@ -60,8 +60,8 @@ public int getItemCount() {

public class EnumSelectionViewHolder extends RecyclerView.ViewHolder {

private RelativeLayout enumRelativeLayout;
private TextView enumTextView;
private final RelativeLayout enumRelativeLayout;
private final TextView enumTextView;

private String title;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

public class InAppMessageRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private Animate animate;
private LayoutInflater layoutInflater;
private Toaster toaster;
private final Animate animate;
private final LayoutInflater layoutInflater;
private final Toaster toaster;

private Context context;
private InAppMessage[] inAppMessages;
private final Context context;
private final InAppMessage[] inAppMessages;


public InAppMessageRecyclerViewAdapter(Context context, InAppMessage[] inAppMessages) {
Expand Down Expand Up @@ -67,10 +67,10 @@ public int getItemCount() {

public class InAppMessageViewHolder extends RecyclerView.ViewHolder {

private LinearLayout inAppMessageLinearLayout;
private ImageView inAppMessageImageView;
private ProgressBar inAppMessageProgressBar;
private TextView inAppMessageTextView;
private final LinearLayout inAppMessageLinearLayout;
private final ImageView inAppMessageImageView;
private final ProgressBar inAppMessageProgressBar;
private final TextView inAppMessageTextView;

private InAppMessage inAppMessage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

public class NotificationRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private Animate animate;
private LayoutInflater layoutInflater;
private final Animate animate;
private final LayoutInflater layoutInflater;

private Context context;
private Notification[] notifications;
private final Context context;
private final Notification[] notifications;


public NotificationRecyclerViewAdapter(Context context, Notification[] notifications) {
Expand Down Expand Up @@ -65,10 +65,10 @@ public int getItemCount() {

public class NotificationViewHolder extends RecyclerView.ViewHolder {

private LinearLayout notificationLinearLayout;
private ImageView notificationImageView;
private ProgressBar notificationProgressBar;
private TextView notificationTextView;
private final LinearLayout notificationLinearLayout;
private final ImageView notificationImageView;
private final ProgressBar notificationProgressBar;
private final TextView notificationTextView;

private Notification notification;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

public class PairRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private LayoutInflater layoutInflater;
private final LayoutInflater layoutInflater;

private Context context;
private final Context context;

private ArrayList<Map.Entry> tags;
private PairItemActionCallback callback;
private final ArrayList<Map.Entry> tags;
private final PairItemActionCallback callback;

public PairRecyclerViewAdapter(Context context, ArrayList<Map.Entry> tags, PairItemActionCallback callback) {
this.context = context;
Expand Down Expand Up @@ -54,9 +54,9 @@ public int getItemCount() {

public class PairViewHolder extends RecyclerView.ViewHolder {

private RelativeLayout pairRelativeLayout;
private TextView pairKeyTextView;
private TextView pairValueTextView;
private final RelativeLayout pairRelativeLayout;
private final TextView pairKeyTextView;
private final TextView pairValueTextView;

private Map.Entry pair;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

public class SingleRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private LayoutInflater layoutInflater;
private final LayoutInflater layoutInflater;

private Context context;
private final Context context;

private ArrayList<Object> values;
private SingleItemActionCallback callback;
private final ArrayList<Object> values;
private final SingleItemActionCallback callback;

public SingleRecyclerViewAdapter(Context context, ArrayList<Object> values, SingleItemActionCallback callback) {
this.context = context;
Expand Down Expand Up @@ -54,8 +54,8 @@ public int getItemCount() {

public class SingleViewHolder extends RecyclerView.ViewHolder {

private RelativeLayout singleRelativeLayout;
private TextView singleTextView;
private final RelativeLayout singleRelativeLayout;
private final TextView singleTextView;

private Object item;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

public class SubscriptionRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private LayoutInflater layoutInflater;
private final LayoutInflater layoutInflater;

private Context context;
private final Context context;

private ArrayList<ISubscription> subscriptions;
private SubscriptionItemActionCallback callback;
private final ArrayList<ISubscription> subscriptions;
private final SubscriptionItemActionCallback callback;

public SubscriptionRecyclerViewAdapter(Context context, ArrayList<ISubscription> subscriptions, SubscriptionItemActionCallback callback) {
this.context = context;
Expand Down Expand Up @@ -57,10 +57,10 @@ public int getItemCount() {

public class SubscriptionViewHolder extends RecyclerView.ViewHolder {

private LinearLayout singleLinearLayout;
private TextView idTextView;
private TextView addressTitleTextView;
private TextView addressTextView;
private final LinearLayout singleLinearLayout;
private final TextView idTextView;
private final TextView addressTitleTextView;
private final TextView addressTextView;

private ISubscription item;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,7 @@ public void run() {
aliasArrayList.clear();
aliasArrayList.addAll(aliasSet.entrySet());

if (aliasArrayList.size() > 0) {
animate.toggleAnimationView(false, View.GONE, aliasesRecyclerView, noAliasesTextView);
} else {
animate.toggleAnimationView(true, View.GONE, aliasesRecyclerView, noAliasesTextView);
}
animate.toggleAnimationView(aliasArrayList.size() <= 0, View.GONE, aliasesRecyclerView, noAliasesTextView);

aliasesRecyclerViewAdapter.notifyDataSetChanged();
}
Expand All @@ -510,16 +506,16 @@ public void onPushSubscriptionChange(@NonNull PushSubscriptionChangedState state
public void onUserStateChange(@NonNull UserChangedState state) {
UserState currentState = state.getCurrent();
UserState prevState = state.getPrevious();
Logging.debug("onUserStateChanged; previous onesignalId: " + String.valueOf(prevState.getOnesignalId())
+ ", previous externalId: " + String.valueOf(prevState.getExternalId())
+ ", current onesignalId: " + String.valueOf(currentState.getOnesignalId())
+ ", current externalId: " + String.valueOf(currentState.getExternalId()),
Logging.debug("onUserStateChanged; previous onesignalId: " + prevState.getOnesignalId()
+ ", previous externalId: " + prevState.getExternalId()
+ ", current onesignalId: " + currentState.getOnesignalId()
+ ", current externalId: " + currentState.getExternalId(),
null);
}

private class DummySubscription implements ISubscription {

private String _id;
private final String _id;
public DummySubscription(String id) {
_id = id;
}
Expand Down Expand Up @@ -626,11 +622,7 @@ public void run() {
tagArrayList.clear();
tagArrayList.addAll(tagSet.entrySet());

if (tagArrayList.size() > 0) {
animate.toggleAnimationView(false, View.GONE, tagsRecyclerView, noTagsTextView);
} else {
animate.toggleAnimationView(true, View.GONE, tagsRecyclerView, noTagsTextView);
}
animate.toggleAnimationView(tagArrayList.size() <= 0, View.GONE, tagsRecyclerView, noTagsTextView);

tagPairRecyclerViewAdapter.notifyDataSetChanged();
}
Expand All @@ -653,11 +645,7 @@ private void setupEmailRecyclerView() {

private void refreshEmailRecyclerView() {
getActivity().runOnUiThread(() -> {
if (emailArrayList.size() > 0) {
animate.toggleAnimationView(false, View.GONE, emailsRecyclerView, noEmailsTextView);
} else {
animate.toggleAnimationView(true, View.GONE, emailsRecyclerView, noEmailsTextView);
}
animate.toggleAnimationView(emailArrayList.size() <= 0, View.GONE, emailsRecyclerView, noEmailsTextView);

emailsRecyclerViewAdapter.notifyDataSetChanged();
});
Expand All @@ -679,11 +667,7 @@ private void setupSMSRecyclerView() {

private void refreshSMSRecyclerView() {
getActivity().runOnUiThread(() -> {
if (smsArrayList.size() > 0) {
animate.toggleAnimationView(false, View.GONE, smssRecyclerView, noSmssTextView);
} else {
animate.toggleAnimationView(true, View.GONE, smssRecyclerView, noSmssTextView);
}
animate.toggleAnimationView(smsArrayList.size() <= 0, View.GONE, smssRecyclerView, noSmssTextView);

smssRecyclerViewAdapter.notifyDataSetChanged();
});
Expand Down Expand Up @@ -769,11 +753,7 @@ public void run() {
triggerArrayList.clear();
triggerArrayList.addAll(triggerSet.entrySet());

if (triggerArrayList.size() > 0) {
animate.toggleAnimationView(false, View.GONE, triggersRecyclerView, noTriggersTextView);
} else {
animate.toggleAnimationView(true, View.GONE, triggersRecyclerView, noTriggersTextView);
}
animate.toggleAnimationView(triggerArrayList.size() <= 0, View.GONE, triggersRecyclerView, noTriggersTextView);

triggerPairRecyclerViewAdapter.notifyDataSetChanged();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SplashActivityViewModel implements ActivityViewModel {

private Context context;

private boolean[] tasks = {false, false, false};
private final boolean[] tasks = {false, false, false};

@Override
public Activity getActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public enum ToastType {
WARNING(R.drawable.ic_alert_white_48dp, R.color.colorToastWarning),
ERROR(R.drawable.ic_alert_octagon_white_48dp, R.color.colorToastError);

private int icon;
private int color;
private final int icon;
private final int color;

ToastType(int icon, int color) {
this.icon = icon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CustomAlertDialogBuilder extends AlertDialog.Builder {
private Button positiveButton;
private Button negativeButton;

private View view;
private final View view;
private Boolean mCancelOnTouchOutside = null;
private boolean isCancelable = true;

Expand Down Expand Up @@ -115,9 +115,8 @@ public AlertDialog show() {
alertDialogBuilder.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
return !isCancelable;
if (keyCode == KeyEvent.KEYCODE_BACK) {
return !isCancelable;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class RecyclerViewBuilder {

private Context context;
private final Context context;


public RecyclerViewBuilder(Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

public class Dialog {

private Font font;
private LayoutInflater layoutInflater;
private RecyclerViewBuilder recyclerViewBuilder;
private Toaster toaster;
private final Font font;
private final LayoutInflater layoutInflater;
private final RecyclerViewBuilder recyclerViewBuilder;
private final Toaster toaster;

private Context context;
private final Context context;

public Dialog(Context context) {
this.context = context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class IntentTo {

private Context context;
private final Context context;

public IntentTo(Context context) {
this.context = context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

public class Toaster {

private Context context;
private Font font;
private final Context context;
private final Font font;

public Toaster(Context context) {
this.context = context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kotlinx.coroutines.withContext
* A standard implementation that implements [ICallbackNotifier] and additional functionality to
* make callbacks less burdensome to the user.
*/
open class CallbackProducer<THandler>() : ICallbackNotifier<THandler> {
open class CallbackProducer<THandler> : ICallbackNotifier<THandler> {
private var callback: THandler? = null

override val hasCallback: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ open class Model(
data[name]
} else {
val defaultValue = create()
data[name] = defaultValue as Any?
data[name] = defaultValue
defaultValue
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ServiceProvider(
val listOfServices: MutableList<T> = mutableListOf()

if (serviceMap.containsKey(c)) {
for (serviceReg in serviceMap!![c]!!) {
for (serviceReg in serviceMap[c]!!) {
val service =
serviceReg.resolve(this) as T?
?: throw Exception("Could not instantiate service: $serviceReg")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import com.onesignal.core.internal.application.IApplicationService
import com.onesignal.debug.internal.logging.Logging
import java.lang.ref.WeakReference

class ApplicationService() : IApplicationService, ActivityLifecycleCallbacks, OnGlobalLayoutListener {
class ApplicationService : IApplicationService, ActivityLifecycleCallbacks, OnGlobalLayoutListener {
private val activityLifecycleNotifier = EventProducer<IActivityLifecycleHandler>()
private val applicationLifecycleNotifier = EventProducer<IApplicationLifecycleHandler>()
private val systemConditionNotifier = EventProducer<ISystemConditionHandler>()
Expand Down
Loading

0 comments on commit d63c3fd

Please sign in to comment.