mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-02 02:32:37 +00:00
contact selection reeemix
1) RecyclerView-based, with better long scroller and more material-inspired look. 2) Add badge for Signal users to contact selection list. // FREEBIE
This commit is contained in:
committed by
Moxie Marlinspike
parent
7bec5efe1a
commit
fb8d6cb538
@@ -24,6 +24,7 @@ import android.support.annotation.IdRes;
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.view.animation.FastOutSlowInInterpolator;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextUtils.TruncateAt;
|
||||
@@ -33,6 +34,7 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.view.animation.Animation;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class ViewUtil {
|
||||
@@ -45,6 +47,42 @@ public class ViewUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void setY(final @NonNull View v, final int y) {
|
||||
if (VERSION.SDK_INT >= 11) {
|
||||
ViewCompat.setY(v, y);
|
||||
} else {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)v.getLayoutParams();
|
||||
params.topMargin = y;
|
||||
v.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
public static float getY(final @NonNull View v) {
|
||||
if (VERSION.SDK_INT >= 11) {
|
||||
return ViewCompat.getY(v);
|
||||
} else {
|
||||
return ((ViewGroup.MarginLayoutParams)v.getLayoutParams()).topMargin;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setX(final @NonNull View v, final int x) {
|
||||
if (VERSION.SDK_INT >= 11) {
|
||||
ViewCompat.setX(v, x);
|
||||
} else {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)v.getLayoutParams();
|
||||
params.leftMargin = x;
|
||||
v.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
public static float getX(final @NonNull View v) {
|
||||
if (VERSION.SDK_INT >= 11) {
|
||||
return ViewCompat.getX(v);
|
||||
} else {
|
||||
return ((LayoutParams)v.getLayoutParams()).leftMargin;
|
||||
}
|
||||
}
|
||||
|
||||
public static void swapChildInPlace(ViewGroup parent, View toRemove, View toAdd, int defaultIndex) {
|
||||
int childIndex = parent.indexOfChild(toRemove);
|
||||
if (childIndex > -1) parent.removeView(toRemove);
|
||||
|
||||
Reference in New Issue
Block a user