diff --git a/app/src/main/java/com/example/tampopo_client/views/FriendIconView.java b/app/src/main/java/com/example/tampopo_client/views/FriendIconView.java
new file mode 100644
index 0000000..20a10e3
--- /dev/null
+++ b/app/src/main/java/com/example/tampopo_client/views/FriendIconView.java
@@ -0,0 +1,191 @@
+package com.example.tampopo_client.views;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.drawable.Drawable;
+import android.text.TextPaint;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.example.tampopo_client.R;
+
+/**
+ * TODO: document your custom view class.
+ */
+public class FriendIconView extends View {
+ private String mExampleString; // TODO: use a default from R.string...
+ private int mExampleColor = Color.RED; // TODO: use a default from R.color...
+ private float mExampleDimension = 0; // TODO: use a default from R.dimen...
+ private Drawable mExampleDrawable;
+
+ private TextPaint mTextPaint;
+ private float mTextWidth;
+ private float mTextHeight;
+
+ public FriendIconView(Context context) {
+ super(context);
+ init(null, 0);
+ }
+
+ public FriendIconView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init(attrs, 0);
+ }
+
+ public FriendIconView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init(attrs, defStyle);
+ }
+
+ private void init(AttributeSet attrs, int defStyle) {
+ // Load attributes
+ final TypedArray a = getContext().obtainStyledAttributes(
+ attrs, R.styleable.FriendIconView, defStyle, 0);
+
+ mExampleString = a.getString(
+ R.styleable.FriendIconView_exampleString);
+ mExampleColor = a.getColor(
+ R.styleable.FriendIconView_exampleColor,
+ mExampleColor);
+ // Use getDimensionPixelSize or getDimensionPixelOffset when dealing with
+ // values that should fall on pixel boundaries.
+ mExampleDimension = a.getDimension(
+ R.styleable.FriendIconView_exampleDimension,
+ mExampleDimension);
+
+ if (a.hasValue(R.styleable.FriendIconView_exampleDrawable)) {
+ mExampleDrawable = a.getDrawable(
+ R.styleable.FriendIconView_exampleDrawable);
+ mExampleDrawable.setCallback(this);
+ }
+
+ a.recycle();
+
+ // Set up a default TextPaint object
+ mTextPaint = new TextPaint();
+ mTextPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
+ mTextPaint.setTextAlign(Paint.Align.LEFT);
+
+ // Update TextPaint and text measurements from attributes
+ invalidateTextPaintAndMeasurements();
+ }
+
+ private void invalidateTextPaintAndMeasurements() {
+ mTextPaint.setTextSize(mExampleDimension);
+ mTextPaint.setColor(mExampleColor);
+ mTextWidth = mTextPaint.measureText(mExampleString);
+
+ Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();
+ mTextHeight = fontMetrics.bottom;
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ // TODO: consider storing these as member variables to reduce
+ // allocations per draw cycle.
+ int paddingLeft = getPaddingLeft();
+ int paddingTop = getPaddingTop();
+ int paddingRight = getPaddingRight();
+ int paddingBottom = getPaddingBottom();
+
+ int contentWidth = getWidth() - paddingLeft - paddingRight;
+ int contentHeight = getHeight() - paddingTop - paddingBottom;
+
+ // Draw the text.
+ canvas.drawText(mExampleString,
+ paddingLeft + (contentWidth - mTextWidth) / 2,
+ paddingTop + (contentHeight + mTextHeight) / 2,
+ mTextPaint);
+
+ // Draw the example drawable on top of the text.
+ if (mExampleDrawable != null) {
+ mExampleDrawable.setBounds(paddingLeft, paddingTop,
+ paddingLeft + contentWidth, paddingTop + contentHeight);
+ mExampleDrawable.draw(canvas);
+ }
+ }
+
+ /**
+ * Gets the example string attribute value.
+ *
+ * @return The example string attribute value.
+ */
+ public String getExampleString() {
+ return mExampleString;
+ }
+
+ /**
+ * Sets the view"s example string attribute value. In the example view, this string
+ * is the text to draw.
+ *
+ * @param exampleString The example string attribute value to use.
+ */
+ public void setExampleString(String exampleString) {
+ mExampleString = exampleString;
+ invalidateTextPaintAndMeasurements();
+ }
+
+ /**
+ * Gets the example color attribute value.
+ *
+ * @return The example color attribute value.
+ */
+ public int getExampleColor() {
+ return mExampleColor;
+ }
+
+ /**
+ * Sets the view"s example color attribute value. In the example view, this color
+ * is the font color.
+ *
+ * @param exampleColor The example color attribute value to use.
+ */
+ public void setExampleColor(int exampleColor) {
+ mExampleColor = exampleColor;
+ invalidateTextPaintAndMeasurements();
+ }
+
+ /**
+ * Gets the example dimension attribute value.
+ *
+ * @return The example dimension attribute value.
+ */
+ public float getExampleDimension() {
+ return mExampleDimension;
+ }
+
+ /**
+ * Sets the view"s example dimension attribute value. In the example view, this dimension
+ * is the font size.
+ *
+ * @param exampleDimension The example dimension attribute value to use.
+ */
+ public void setExampleDimension(float exampleDimension) {
+ mExampleDimension = exampleDimension;
+ invalidateTextPaintAndMeasurements();
+ }
+
+ /**
+ * Gets the example drawable attribute value.
+ *
+ * @return The example drawable attribute value.
+ */
+ public Drawable getExampleDrawable() {
+ return mExampleDrawable;
+ }
+
+ /**
+ * Sets the view"s example drawable attribute value. In the example view, this drawable is
+ * drawn above the text.
+ *
+ * @param exampleDrawable The example drawable attribute value to use.
+ */
+ public void setExampleDrawable(Drawable exampleDrawable) {
+ mExampleDrawable = exampleDrawable;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/sample_friend_icon_view.xml b/app/src/main/res/layout/sample_friend_icon_view.xml
new file mode 100644
index 0000000..d1e0fc3
--- /dev/null
+++ b/app/src/main/res/layout/sample_friend_icon_view.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..8ed710d
--- /dev/null
+++ b/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/attrs_friend_icon_view.xml b/app/src/main/res/values/attrs_friend_icon_view.xml
new file mode 100644
index 0000000..bdb9b4f
--- /dev/null
+++ b/app/src/main/res/values/attrs_friend_icon_view.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index c8524cd..e2337bb 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -2,4 +2,8 @@
#FF000000
#FFFFFFFF
+ #FF29B6F6
+ #FF039BE5
+ #FFBDBDBD
+ #FF757575
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..7e2e6c3
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 0afc5a0..b4bacf5 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -6,8 +6,4 @@
-
\ No newline at end of file