|
@ -34,8 +34,10 @@ import androidx.recyclerview.widget.RecyclerView; |
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton; |
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import android.widget.TextView; |
|
|
|
|
|
|
|
|
public class FragmentIdentities extends FragmentEx { |
|
|
public class FragmentIdentities extends FragmentEx { |
|
|
|
|
|
private TextView tvNoIdentities; |
|
|
private RecyclerView rvIdentity; |
|
|
private RecyclerView rvIdentity; |
|
|
private ProgressBar pbWait; |
|
|
private ProgressBar pbWait; |
|
|
private Group grpReady; |
|
|
private Group grpReady; |
|
@ -55,6 +57,7 @@ public class FragmentIdentities extends FragmentEx { |
|
|
|
|
|
|
|
|
// Get controls |
|
|
// Get controls |
|
|
rvIdentity = view.findViewById(R.id.rvIdentity); |
|
|
rvIdentity = view.findViewById(R.id.rvIdentity); |
|
|
|
|
|
tvNoIdentities = view.findViewById(R.id.tvNoIdentities); |
|
|
pbWait = view.findViewById(R.id.pbWait); |
|
|
pbWait = view.findViewById(R.id.pbWait); |
|
|
grpReady = view.findViewById(R.id.grpReady); |
|
|
grpReady = view.findViewById(R.id.grpReady); |
|
|
fab = view.findViewById(R.id.fab); |
|
|
fab = view.findViewById(R.id.fab); |
|
@ -85,6 +88,7 @@ public class FragmentIdentities extends FragmentEx { |
|
|
|
|
|
|
|
|
// Initialize |
|
|
// Initialize |
|
|
grpReady.setVisibility(View.GONE); |
|
|
grpReady.setVisibility(View.GONE); |
|
|
|
|
|
tvNoIdentities.setVisibility(View.GONE); |
|
|
pbWait.setVisibility(View.VISIBLE); |
|
|
pbWait.setVisibility(View.VISIBLE); |
|
|
|
|
|
|
|
|
return view; |
|
|
return view; |
|
@ -103,10 +107,13 @@ public class FragmentIdentities extends FragmentEx { |
|
|
new Observer<List<TupleIdentityEx>>() { |
|
|
new Observer<List<TupleIdentityEx>>() { |
|
|
@Override |
|
|
@Override |
|
|
public void onChanged(@Nullable List<TupleIdentityEx> identities) { |
|
|
public void onChanged(@Nullable List<TupleIdentityEx> identities) { |
|
|
adapter.set( |
|
|
|
|
|
identities == null |
|
|
|
|
|
? new ArrayList<TupleIdentityEx>() |
|
|
|
|
|
: identities); |
|
|
|
|
|
|
|
|
if (identities == null) { |
|
|
|
|
|
identities = new ArrayList<TupleIdentityEx>(); |
|
|
|
|
|
} else if (identities.size() == 0) { |
|
|
|
|
|
tvNoIdentities.setVisibility(View.VISIBLE); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
adapter.set(identities); |
|
|
|
|
|
|
|
|
pbWait.setVisibility(View.GONE); |
|
|
pbWait.setVisibility(View.GONE); |
|
|
grpReady.setVisibility(View.VISIBLE); |
|
|
grpReady.setVisibility(View.VISIBLE); |
|
|