Add badgers

This commit is contained in:
Mieszko Wrzeszczyński 2018-10-26 21:52:19 +02:00
parent c7231bc70a
commit 49199ccc44
7 changed files with 67 additions and 28 deletions

View File

@ -176,7 +176,7 @@ public abstract class BaseActivity
//removeFragment(sharingFragment); //removeFragment(sharingFragment);
startActivity(new Intent(this, UsersListActivity.class)); startActivity(new Intent(this, UsersListActivity.class));
} }
//finish(); finish();
}, 300); }, 300);
return true; return true;

View File

@ -3,6 +3,7 @@ package com.uam.wmi.findmytutor.view;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.Html; import android.text.Html;
import android.util.Log; import android.util.Log;
@ -69,13 +70,22 @@ public class TutorsAdapter extends RecyclerView.Adapter<TutorsAdapter.MyViewHold
holder.firstName.setText(tutor.getFirstName()); holder.firstName.setText(tutor.getFirstName());
holder.lastName.setText(tutor.getLastName()); holder.lastName.setText(tutor.getLastName());
holder.isOnline.setText(Html.fromHtml("&#8226;"));
holder.isOnline.setTextColor(getRandomMaterialColor("400")); if(tutor.isIsOnline()) {
Drawable image = context.getResources().getDrawable(R.drawable.online_user);
if(!tutor.isIsActive()) image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
holder.isOnline.setTextColor(Color.BLACK); holder.isOnline.setCompoundDrawables(image, null, null, null);
} else {
Drawable image = context.getResources().getDrawable(R.drawable.not_online);
image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
holder.isOnline.setCompoundDrawables(image, null, null, null);
}
if(!tutor.isIsActive()){
Drawable image = context.getResources().getDrawable(R.drawable.not_active_user);
image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
holder.isOnline.setCompoundDrawables(image, null, null, null);
}
} }

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#252525"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#010101" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#BD120A"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#010101" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#0ABD48"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#010101" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#0ABD48"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#010101" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

View File

@ -1,39 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="100dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:foreground="?attr/selectableItemBackground"
android:paddingLeft="@dimen/activity_margin" android:paddingLeft="@dimen/activity_margin"
android:paddingTop="@dimen/dimen_10" android:paddingTop="@dimen/dimen_10"
android:paddingRight="@dimen/activity_margin" android:paddingRight="@dimen/activity_margin"
android:paddingBottom="@dimen/dimen_10"> android:paddingBottom="@dimen/dimen_10">
<TextView
android:id="@+id/isOnline"
android:layout_width="wrap_content"
android:layout_height="@dimen/dot_height"
android:layout_marginTop="@dimen/dimen_10"
android:layout_marginEnd="@dimen/dot_margin_right"
android:includeFontPadding="false"
android:lineSpacingExtra="10dp"
android:textSize="@dimen/dot_text_size" />
<TextView
android:id="@+id/lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/isOnline"
android:textColor="@color/note_list_text"
android:textSize="@dimen/note_list_text" />
<TextView <TextView
android:id="@+id/firstName" android:id="@+id/firstName"
android:layout_width="match_parent" android:layout_width="271dp"
android:layout_height="30dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="12dp"
android:layout_marginTop="10dp"
android:textColor="@color/note_list_text"
android:textSize="20sp" />
<TextView
android:id="@+id/lastName"
android:layout_width="269dp"
android:layout_height="30dp"
android:layout_below="@+id/firstName"
android:layout_alignEnd="@+id/firstName"
android:layout_marginTop="10dp"
android:layout_marginEnd="1dp"
android:textColor="@color/note_list_text"
android:textSize="20sp" />
<TextView
android:id="@+id/isOnline"
android:layout_width="25dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toEndOf="@id/isOnline" android:layout_below="@+id/lastName"
android:layout_alignParentEnd="true"
android:layout_marginTop="-42dp"
android:layout_marginEnd="33dp"
android:textColor="@color/note_list_text" android:textColor="@color/note_list_text"
android:textSize="@dimen/note_list_text" /> android:textSize="@dimen/note_list_text" />
</RelativeLayout>
</RelativeLayout>