Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Variable init in constucter made final (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
konishon committed Oct 15, 2019
1 parent 34d19f9 commit 3fae3be
Show file tree
Hide file tree
Showing 131 changed files with 249 additions and 760 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;

import com.google.android.material.textfield.TextInputLayout;

import org.fieldsight.collect.android.R;
import org.fieldsight.naxa.login.model.Site;
import org.odk.collect.android.application.Collect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
public class FilterDialogAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final int VIEW_TYPE_TEXT = 0, VIEW_TYPE_SPINNER = 1, VIEW_TYPE_BUTTON = 2, VIEW_TYPE_LIST = 3;
private final FilterDialogAdapter.RecyclerViewClickListener listener;
private final FilterType selectedSortingOrder;
private final RecyclerView recyclerView;
private final ThemeUtils themeUtils;
private final ArrayList<FilterOption> sortList;
Expand All @@ -48,7 +47,6 @@ public FilterDialogAdapter(Context context, RecyclerView recyclerView, ArrayList
themeUtils = new ThemeUtils(context);
this.recyclerView = recyclerView;
this.sortList = sortList;
this.selectedSortingOrder = selectedSortingOrder;
listener = recyclerViewClickListener;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public enum FilterType {
CONFIRM_BUTTON,
}

private FilterType type;
private String label;
private List<Pair> options;
private final FilterType type;
private final String label;
private final List<Pair> options;
private Pair selection;

public FilterOption(FilterType type, String label,List<Pair> site) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

public class GridItemDecoration extends RecyclerView.ItemDecoration {

private int mSizeGridSpacingPx;
private int mGridSize;
private final int mSizeGridSpacingPx;
private final int mGridSize;

private boolean mNeedLeftSpacing = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
public class PairSpinnerAdapter extends ArrayAdapter<Pair> {


private Context context;
private final Context context;

private List<Pair> values;
private final List<Pair> values;

public PairSpinnerAdapter(Context context, int textViewResourceId, List<Pair> values) {
super(context, textViewResourceId, values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ public class RecyclerViewEmptySupport extends RecyclerView {
private View emptyView;
private View progressView;

private long lastDispatch;


private AdapterDataObserver emptyObserver = new AdapterDataObserver() {
private final AdapterDataObserver emptyObserver = new AdapterDataObserver() {

@Override
public void onItemRangeChanged(int positionStart, int itemCount) {
Expand Down Expand Up @@ -119,7 +117,7 @@ public void setEmptyView(View emptyView, @Nullable String message, OnEmptyLayout
.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Collect.getInstance(), ContentDownloadActivity.class);
Intent intent = new Intent(Collect.getInstance(), ContentDownloadActivity.class);
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
Collect.getInstance().startActivity(intent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class RxDownloader {

private static final String DEFAULT_MIME_TYPE = "*/*";

private Context context;
private LongSparseArray<PublishSubject<String>> subjectMap = new LongSparseArray<>();
private final Context context;
private final LongSparseArray<PublishSubject<String>> subjectMap = new LongSparseArray<>();
private DownloadManager downloadManager;

public RxDownloader(@NonNull Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
public class SiteOverideLocalSource implements BaseLocalDataSource<SiteOveride> {

private static SiteOverideLocalSource INSTANCE = null;
private SiteOverideDAO dao;
private SiteDao siteDao;
private final SiteOverideDAO dao;
private final SiteDao siteDao;

private SiteOverideLocalSource() {
FieldSightConfigDatabase database = FieldSightConfigDatabase.getDatabase(Collect.getInstance());//todo inject context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
Expand All @@ -29,7 +28,7 @@

public class TouchImageView extends AppCompatImageView {

private static final String DEBUG = "DEBUG";


//
// SuperMin and SuperMax multipliers. Determine how much the image can be
Expand Down Expand Up @@ -1022,7 +1021,7 @@ private class PrivateOnTouchListener implements OnTouchListener {
//
// Remember last point position for dragging
//
private PointF last = new PointF();
private final PointF last = new PointF();

@Override
public boolean onTouch(View v, MotionEvent event) {
Expand Down Expand Up @@ -1171,9 +1170,9 @@ private class DoubleTapZoom implements Runnable {
private final float startZoom, targetZoom;
private final float bitmapX, bitmapY;
private final boolean stretchImageToSuper;
private AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
private PointF startTouch;
private PointF endTouch;
private final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
private final PointF startTouch;
private final PointF endTouch;

DoubleTapZoom(float targetZoom, float focusX, float focusY, boolean stretchImageToSuper) {
setState(State.ANIMATE_ZOOM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ public class ViewModelFactory extends ViewModelProvider.NewInstanceFactory {
private final ContactRepository contactRepository;


private final Application application;

public ViewModelFactory(Application application,
GeneralFormRepository repository,
ScheduledFormRepository scheduledFormRepository,
Expand All @@ -74,7 +72,7 @@ public ViewModelFactory(Application application,
FieldSightNotificationRepository notificationRepository,
ContactRepository contactRepository
) {
this.application = application;

this.generalFormRepository = repository;
this.scheduledFormRepository = scheduledFormRepository;
this.stageFormRepository = stageFormRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


public class FlipAnimator {
private static String TAG = FlipAnimator.class.getSimpleName();
private static AnimatorSet leftIn, rightOut, leftOut, rightIn;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ public class SiteOveride {
private String scheduleFormIds;
private String stagedFormIds;

@Ignore
private List<String> generalformIdList;

@Ignore
private List<String> scheduleFormIdList;

@Ignore
private List<String> stagedformIdList;


public SiteOveride() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

public class DataSyncEvent {

private String event;
private int uid;
private final String event;
private final int uid;
private DownloadProgress downloadProgress;


Expand All @@ -21,7 +21,6 @@ public DataSyncEvent(int uid, String event) {
}



public DataSyncEvent(int uid, DownloadProgress downloadProgress) {
this.event = EVENT_UPDATE;
this.uid = uid;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@

import android.net.Uri;

import com.google.gson.reflect.TypeToken;

import org.fieldsight.naxa.common.GSONInstance;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down
Loading

0 comments on commit 3fae3be

Please sign in to comment.