import android.widget.Switch;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.textfield.TextInputLayout;
import java.util.ArrayList;
import java.util.Objects;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentActivity;
-
import static net.ktnx.mobileledger.utils.Logger.debug;
/**
import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.constraintlayout.widget.ConstraintLayout;
+import androidx.lifecycle.MutableLiveData;
+import androidx.recyclerview.widget.ItemTouchHelper;
+import androidx.recyclerview.widget.RecyclerView;
+
import net.ktnx.mobileledger.R;
import net.ktnx.mobileledger.model.Data;
import net.ktnx.mobileledger.model.MobileLedgerProfile;
import java.util.Collections;
import java.util.Locale;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.lifecycle.MutableLiveData;
-import androidx.recyclerview.widget.ItemTouchHelper;
-import androidx.recyclerview.widget.RecyclerView;
-
import static net.ktnx.mobileledger.utils.Logger.debug;
public class ProfilesRecyclerViewAdapter
extends RecyclerView.Adapter<ProfilesRecyclerViewAdapter.ProfileListViewHolder> {
+ private static WeakReference<ProfilesRecyclerViewAdapter> instanceRef;
private final View.OnClickListener mOnClickListener = view -> {
MobileLedgerProfile profile = (MobileLedgerProfile) ((View) view.getParent()).getTag();
editProfile(view, profile);
};
public MutableLiveData<Boolean> editingProfiles = new MutableLiveData<>(false);
- private static WeakReference<ProfilesRecyclerViewAdapter> instanceRef;
private RecyclerView recyclerView;
private ItemTouchHelper rearrangeHelper;
private boolean animationsEnabled = true;
};
rearrangeHelper = new ItemTouchHelper(cb);
}
- public static @Nullable ProfilesRecyclerViewAdapter getInstance() {
+ public static @Nullable
+ ProfilesRecyclerViewAdapter getInstance() {
return instanceRef.get();
}
public void setAnimationsEnabled(boolean animationsEnabled) {
public void fromString() {
ParsedQuantity pq = new ParsedQuantity("-22");
assertEquals(0, pq.getDecimalPlaces());
- assertEquals( -22, pq.getDecimalMantissa());
+ assertEquals(-22, pq.getDecimalMantissa());
pq = new ParsedQuantity("-123.45");
- assertEquals( 2, pq.getDecimalPlaces());
- assertEquals( -12345, pq.getDecimalMantissa());
+ assertEquals(2, pq.getDecimalPlaces());
+ assertEquals(-12345, pq.getDecimalMantissa());
}
}
\ No newline at end of file