Compare commits

...

2 Commits

5 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

Binary file not shown.

View File

@ -82,6 +82,7 @@ public class UsersListFragment extends Fragment {
private CompositeDisposable disposable = new CompositeDisposable();
private TutorsListAdapter mAdapter;
private List<User> tutorsList = new ArrayList<>();
private List<User> tutorsNewCordsList = new ArrayList<>();
private HashMap<String, String> tutorsTimeStamps = new HashMap<>();
private Collator plCollator = Collator.getInstance(Locale.forLanguageTag("pl-PL"));
@ -457,6 +458,8 @@ public class UsersListFragment extends Fragment {
tutorsTimeStamps.put(crd.getUserId(), getDate(ts));
}
}
mAdapter.notifyDataSetChanged();
}

View File

@ -8,6 +8,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.uam.wmi.findmytutor.R;
import com.uam.wmi.findmytutor.model.User;
@ -49,6 +50,8 @@ public class TutorsListAdapter extends RecyclerView.Adapter<TutorsListAdapter.My
if (tutor.isIsOnline()) {
image = context.getResources().getDrawable(R.drawable.user_list_online);
holder.lastSeen.setText(R.string.available_now);
holder.lastSeen.setVisibility(View.VISIBLE);
} else {
image = context.getResources().getDrawable(R.drawable.user_list_offline);
String ts = tutorsTimeStamps.get(tutor.getId());
@ -60,6 +63,7 @@ public class TutorsListAdapter extends RecyclerView.Adapter<TutorsListAdapter.My
if (!tutor.isIsActive()) {
image = context.getResources().getDrawable(R.drawable.user_list_off);
holder.lastSeen.setText("");
}
image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());