安卓仿qq状态获取

public void changMyFriendStatus(String userID, UserStatus status) {
    for (GGUser ou : this.MyFriendUserInfo) {
        if (ou.getUserID().equals(userID)) {
            ou.setUserStatus(status);

            synchronized (friendStatusChangeds) {
                for (FriendStatusChangedListener listener : friendStatusChangeds) {
                    listener.FriendStatusChanged(userID, status);
                }
            }
            break;
        }
    }
}
  • android Imageview中图片变成灰色的方法
  • public class AndroidUI {
        /**
         *
         *  // 将ImageView变成灰色
         * @param imageView
         */
        public static void ToGrayImage(ImageView imageView) {
    
            ColorMatrix matrix = new ColorMatrix();
            matrix.setSaturation(0);//饱和度 0灰色 100过度彩色,50正常
            ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
            imageView.setColorFilter(filter);
        }
    }

使用ImageButton,设置的时候不要使用BACKGROUPRESOURCE,否则变灰不能生效,同样跟IMAGEVIEW一样是使用

setImageResource,效果OK
<ImageButton 
    android:id="@+id/ct_photo"
    android:layout_height="52dip"
    android:layout_width="52dip"
    android:layout_margin="5dip"
    />

猜你喜欢

转载自blog.csdn.net/jasonhongcn/article/details/85006484