mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 12:29:11 +00:00
Theme Support
1) Broke out the UI elements of the major Activites into stylable attributes. 2) Created a 'light' and 'dark' theme for the newly stylable attrs. 3) Touched up some of the UI spacing. 4) Implemented dynamic theme switching support.
This commit is contained in:
@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
@@ -45,19 +46,24 @@ public class ImageDivet extends ImageView {
|
||||
}
|
||||
|
||||
private void setDrawable() {
|
||||
Resources r = getContext().getResources();
|
||||
int attributes[] = new int[] {R.attr.conversation_avatar_divet_left,
|
||||
R.attr.conversation_avatar_divet_right};
|
||||
|
||||
TypedArray drawables = getContext().obtainStyledAttributes(attributes);
|
||||
|
||||
switch (position) {
|
||||
case 0:
|
||||
drawable = r.getDrawable(R.drawable.divet_right);
|
||||
drawable = drawables.getDrawable(1);
|
||||
break;
|
||||
case 1:
|
||||
drawable = r.getDrawable(R.drawable.divet_left);
|
||||
drawable = drawables.getDrawable(0);
|
||||
break;
|
||||
}
|
||||
|
||||
drawableIntrinsicWidth = drawable.getIntrinsicWidth();
|
||||
drawableIntrinsicHeight = drawable.getIntrinsicHeight();
|
||||
|
||||
drawables.recycle();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user