蛋疼的各种仿照效果,UI一定要伺候好,不然一言不合就给你来一个很NB的效果
上代码!
1.资源图片
2.popupWindow入场动画
<style name="AnimationPreview"> <item name="android:windowEnterAnimation">@anim/fade_in</item> <item name="android:windowExitAnimation">@anim/fade_out</item> </style>
3.自定义popupWindow
package com.amistrong.beautifulstar.utils;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.amistrong.beautifulstar.chat.activity.GroupChatActivity;
import com.amistrong.beautifulstar.R;
import com.amistrong.beautifulstar.find.ui.activity.friend.MyFriendActivity;
import com.amistrong.beautifulstar.utils.scancodetool.decoding.Intents;
public class MorePopWindow extends PopupWindow {
private View conentView;
private String userId;
public MorePopWindow(final Activity context) {
final LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
conentView = inflater.inflate(R.layout.popup_window_chat, null);
int h = context.getWindowManager().getDefaultDisplay().getHeight();
int w = context.getWindowManager().getDefaultDisplay().getWidth();
this.setContentView(conentView);
this.setWidth(LayoutParams.WRAP_CONTENT);
this.setHeight(LayoutParams.WRAP_CONTENT);
//设置点击隐藏的属性
this.setFocusable(true);
this.setOutsideTouchable(true);
this.update();
ColorDrawable dw = new ColorDrawable(0000000000);
this.setBackgroundDrawable(dw);
thi