package com.pop;
import android.app.Activity;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
public class PopWin {
public View view;
Activity mpthis;
PopupWindow mPopupWindow;
int mheight;
public PopWin(Activity pthis) {
mpthis = pthis;
mPopupWindow = null;
}
public void setY(int y) {
mheight = y;
Log.d("PopWin", "setY:" + mheight);
}
public void dismiss() {
Log.d("PopWin", "dismiss");
if (mPopupWindow != null) {
mPopupWindow.dismiss();
mPopupWindow = null;
Log.d("PopWin", "dismiss ok");
}
}
TextView tv_showText = null;
ImageView in1 = null;
ImageView in2 = null;
TextView tv = null;
TextView tv1 = null;
public void ShowWin(OnClickListener oc) {
dismiss();
View foot_popunwindwow = null;
LayoutInflater LayoutInflater = (LayoutInflater) mpthis
.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
foot_popunwindwow = LayoutInflater
.inflate(R.layout.foot_map_view, null);
mPopupWindow = new PopupWindow(foot_popunwindwow,
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
Log.d("PopWin", "" + mheight);
mPopupWindow.showAtLocation(mpthis.findViewById(R.id.layout),
Gravity.LEFT | Gravity.TOP, 100, 200);
mPopupWindow.update();
in1 = (ImageView) foot_popunwindwow.findViewById(R.id.in1);
in2 = (ImageView) foot_popunwindwow.findViewById(R.id.in2);
tv = (TextView) foot_popunwindwow.findViewById(R.id.text1);
tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(mpthis, "text1", Toast.LENGTH_SHORT).show();
}
});
in1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(mpthis, "in1", Toast.LENGTH_SHORT).show();
}
});
in2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(mpthis, "in2", Toast.LENGTH_SHORT).show();
}
});
}
}
小程序 仿百度地图气泡程序源码.rar
版权申诉
107 浏览量
2023-02-03
11:44:36
上传
评论
收藏 308KB RAR 举报
大富大贵7
- 粉丝: 303
- 资源: 8869
最新资源
- 嵌入式基础学习资料0000
- content_1714465331721.xls
- HM3401-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- Chainbase+Web3+APi+Data warehouse
- HM3401D-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- GEE案例-1990-2023年计算某个区域的NDVI时序变化轨迹(以徐州市为例)含全部代码.pdf
- HM3401C-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 沈丘盛世龙门图纸符合规范化
- 基于51单片机带LCD1602显示+温度补偿的超声波测距仪设计软硬设计+仿真+文档资料.zip
- 一、K210是什么? K210全称为堪智K210,是嘉楠科技自主研发的一款采用RISC-V处理器架构,具备视听一体、自主IP内核
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈