复制360于Launcher浮动窗口的屏幕显示内存使用情况(基本版)
MainActivity如下面:
package cc.cc; import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
/**
* Demo描写叙述:
* 仿360在Launcher画面显示内存使用率的浮窗.
* 当然这里仅仅是简单地仿O(∩_∩)O
*
* 思路整理:
* 1 涉及到大小两个浮窗.而且两个浮窗之间有逻辑联系.比方:
* 显示小浮窗时不显示大浮窗.所以利用DriftingWindowManager
* 来管理这两个浮窗
* 2 各用一个类来封装和实现两个浮窗的操作
* 3 以上两个类均继承自Layout
*
* 总的来讲该演示样例还是比較简单的
*
* 学习资料:
* 1 http://blog.csdn.net/guolin_blog/article/details/8689140
* 2 http://blog.csdn.net/feng88724/article/details/6362710
* 3 http://blog.csdn.net/hudashi/article/details/6901118
* 4 http://blog.csdn.net/hudashi/article/details/7060882
* 5 http://blog.csdn.net/hudashi/article/details/7061240
* Thank you very much
*
*/
public class MainActivity extends Activity {
private Context mContext;
private Button mStartButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
init();
} private void init(){
mContext=this;
mStartButton=(Button) findViewById(R.id.button);
mStartButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent();
intent.setAction("dws");
mContext.startService(intent);
finish();
}
});
} }
DriftingBigWindow例如以下:
package cc.cc; import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
/**
*大浮窗
*
*大浮窗继承自LinearLayout
*该大浮窗主要实现的功能
*1 关闭大浮窗显示小浮窗
*2 关闭全部浮窗且停止对于内存使用率的监控
*
*注意方法:
*LayoutInflater.inflate(int resource, ViewGroup root)的第二參数
*若设置了root,那么会把新生成的View连接到root,该方法的返回为root.
*否未设置root,则返回的是新生成的View
*/
public class DriftingBigWindow extends LinearLayout {
//整个大浮窗的宽和高
public static int width=0;
public static int height=0;
private Context mContext;
public DriftingBigWindow(Context context) {
super(context);
mContext=context;
LayoutInflater layoutInflater=LayoutInflater.from(mContext);
View bigWindowView=layoutInflater.inflate(R.layout.drifting_window_big, this);
View driftingBigWindowRootView=bigWindowView.findViewById(R.id.driftingBigWindowRootView);
//获取大浮窗整个布局的宽和高
width=driftingBigWindowRootView.getLayoutParams().width;
height=driftingBigWindowRootView.getLayoutParams().height;
//停止服务且移除浮窗
Button closeButton=(Button) bigWindowView.findViewById(R.id.closeButton);
closeButton.setOnClickListener(new ClickListenerImpl());
//显示小浮窗
Button backButton=(Button) bigWindowView.findViewById(R.id.backButton);
backButton.setOnClickListener(new ClickListenerImpl());
} private class ClickListenerImpl implements OnClickListener{
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.closeButton:
Intent intent=new Intent();
intent.setAction("dws");
mContext.stopService(intent);
DriftingWindowManager.removeDriftingSmallWindow(mContext);
DriftingWindowManager.removeDriftingBiglWindow(mContext);
break;
case R.id.backButton:
DriftingWindowManager.showDriftingSmallWindow(mContext);
DriftingWindowManager.removeDriftingBiglWindow(mContext);
break;
default:
break;
} } } }
DriftingSmallWindow例如以下:
package cc.cc; import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
/**
*小浮窗
*
*小浮窗继承自LinearLayout
*该小浮窗主要实现的功能:
*1 显示手机的内存使用率
*2 在Home界面被任意移动位置
* 所以重点是实现TouchListener,在Touch监听中
* 不断调用mWindowManager.updateViewLayout()
* 改动小浮窗在屏幕上的LayoutParams
*
*注意方法:
*LayoutInflater.inflate(int resource, ViewGroup root)的第二參数
*若设置了root,那么会把新生成的View连接到root,该方法的返回为root.
*否未设置root,则返回的是新生成的View
*/
public class DriftingSmallWindow extends LinearLayout {
//整个小浮窗的宽和高
public static int width=0;
public static int height=0;
private float XInScreen_Down = 0;
private float YInScreen_Down = 0;
private float XInScreen_Move = 0;
private float YInScreen_Move = 0;
private float XInScreen_Up = 0;
private float YInScreen_Up = 0;
private float XInView_Down=0;
private float YInView_Down=0;
private Context mContext;
private WindowManager mWindowManager;
private static WindowManager.LayoutParams mWindowManagerLayoutParams; public DriftingSmallWindow(Context context) {
super(context);
mContext=context;
mWindowManager=(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
LayoutInflater layoutInflater = LayoutInflater.from(context);
View smallWindowView=layoutInflater.inflate(R.layout.drifting_window_small, this);
View driftingSmallWindowRootView=smallWindowView.findViewById(R.id.driftingSmallWindowRootView);
TextView percentTextView=(TextView) smallWindowView.findViewById(R.id.percentTextView);
//获取小浮窗整个布局的宽和高
width=driftingSmallWindowRootView.getLayoutParams().width;
height=driftingSmallWindowRootView.getLayoutParams().height;
percentTextView.setText(Utils.getAvailMemoryPercent(context)); this.setOnTouchListener(new TouchListenerImpl());
//this.setOnClickListener(new ClickListenerImpl());
} /**
* 利用该方式监听点击事件不靠谱
* 所以在MotionEvent.ACTION_UP中处理点击事件
*/
private class ClickListenerImpl implements OnClickListener{
@Override
public void onClick(View view) { } } /**
* 对于小浮窗Touch事件的监听
* 注意在MotionEvent.ACTION_UP中处理点击事件
*/
private class TouchListenerImpl implements OnTouchListener{
@Override
public boolean onTouch(View view, MotionEvent event) {
int statusBarHeight=Utils.getStatusBarHeight(mContext);
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
XInScreen_Down=event.getRawX();
YInScreen_Down=event.getRawY()-statusBarHeight;
XInView_Down=event.getX();
YInView_Down=event.getY();
break;
case MotionEvent.ACTION_MOVE:
XInScreen_Move=event.getRawX();
YInScreen_Move=event.getRawY()-statusBarHeight; updateWindowManagerLayoutParams(); break;
case MotionEvent.ACTION_UP:
XInScreen_Up=event.getRawX();
YInScreen_Up=event.getRawY()-statusBarHeight;
if (XInScreen_Down==XInScreen_Up&&YInScreen_Down==YInScreen_Up) {
showDriftingBigWindow();
}
break; default:
break;
} return true;
} }; /**
* 保存小浮窗在Window中的布局參数
*/
public static void saveWindowManagerLayoutParams(WindowManager.LayoutParams layoutParams){
mWindowManagerLayoutParams=layoutParams;
} /**
* 更新小浮窗在Window中的布局參数
*
* 注意事项:
* X(Y)InScreen_Move表示触摸点离屏幕左上角的距离
* X(Y)InView_Down表示触摸点离DriftingSmallWindow(小浮窗)自身左上角的距离.
* 两者相减即得DriftingSmallWindow(小浮窗)左上角的坐标
*/
private void updateWindowManagerLayoutParams(){
mWindowManagerLayoutParams.x=(int) (XInScreen_Move-XInView_Down);
mWindowManagerLayoutParams.y=(int) (YInScreen_Move-YInView_Down);
mWindowManager.updateViewLayout(this, mWindowManagerLayoutParams);
} /**
* 显示大浮窗且关闭小浮窗
*/
private void showDriftingBigWindow(){
DriftingWindowManager.showDriftingBiglWindow(mContext);
DriftingWindowManager.removeDriftingSmallWindow(mContext);
} }
DriftingWindowManager例如以下:
package cc.cc; import android.content.Context;
import android.graphics.PixelFormat;
import android.view.Gravity;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.TextView; /**
* 管理大小浮动窗体
* 在该应用中主要包括了大小两个浮动窗体及其相应的操作
* 比方显示,更新和移除等,所以就写了个DriftingWindowManager
* 来实施这些操作.
* 至于大小浮窗各自要做的操作则是在DriftingSmallWindow和DriftingBigWindow
* 各个类中详细实施的.
* 这个和平时其它的代码原理是一样的:
* 比方在一个类A中使用了(相似于此处的浮窗显示,更新,移除)B和C的对象.
* 但B和C对象的方法是在各自的类中实现的.
*/
public class DriftingWindowManager {
private static WindowManager mWindowManager=null;
private static DriftingSmallWindow mDriftingSmallWindow=null;
private static DriftingBigWindow mDriftingBigWindow=null;
//注意该LayoutParams属于android.view.WindowManager.LayoutParams
private static LayoutParams mDriftingSmallWindowLayoutParams;
private static LayoutParams mDriftingBigWindowLayoutParams; /**
* 显示小浮窗
* 显示位置为屏幕中间右对齐
*/
public static void showDriftingSmallWindow(Context context) {
WindowManager windowManager = getWindowManager(context);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
//new了一个DriftingSmallWindow对象,在后面会用WindowManager将
//其加入到屏幕中
mDriftingSmallWindow = new DriftingSmallWindow(context);
if (mDriftingSmallWindowLayoutParams == null) {
mDriftingSmallWindowLayoutParams = new LayoutParams();
mDriftingSmallWindowLayoutParams.type = LayoutParams.TYPE_PHONE;
mDriftingSmallWindowLayoutParams.format = PixelFormat.RGBA_8888;
mDriftingSmallWindowLayoutParams.flags =
LayoutParams.FLAG_NOT_TOUCH_MODAL| LayoutParams.FLAG_NOT_FOCUSABLE;
mDriftingSmallWindowLayoutParams.gravity = Gravity.LEFT| Gravity.TOP;
mDriftingSmallWindowLayoutParams.width = DriftingSmallWindow.width;
mDriftingSmallWindowLayoutParams.height = DriftingSmallWindow.height;
//使小浮窗在屏幕上垂直居中,水平靠右的位置显示
mDriftingSmallWindowLayoutParams.x = screenWidth-DriftingSmallWindow.width;
mDriftingSmallWindowLayoutParams.y = screenHeight / 2;
System.out.println("DriftingSmallWindow.width="+DriftingSmallWindow.width);
System.out.println("mDriftingSmallWindowLayoutParams.x="+mDriftingSmallWindowLayoutParams.x);
System.out.println("mDriftingSmallWindowLayoutParams.y="+mDriftingSmallWindowLayoutParams.y);
}
//当显示小浮窗的时保存小浮窗的LayoutParams至该DriftingSmallWindow对象
//由于每次移动小浮窗的时候须要改动该LayoutParams的參数值X和Y
mDriftingSmallWindow.saveWindowManagerLayoutParams(mDriftingSmallWindowLayoutParams);
mWindowManager.addView(mDriftingSmallWindow,mDriftingSmallWindowLayoutParams);
} /**
* 更新小浮窗
*/
public static void updateDriftingSmallWindow(Context context){
if(mDriftingSmallWindow!=null){
TextView percentTextView=(TextView) mDriftingSmallWindow.findViewById(R.id.percentTextView);
percentTextView.setText(Utils.getAvailMemoryPercent(context));
}
} /**
* 移除小浮窗
*/
public static void removeDriftingSmallWindow(Context context){
mWindowManager=getWindowManager(context);
if(mWindowManager!=null&&mDriftingSmallWindow!=null){
mWindowManager.removeView(mDriftingSmallWindow);
mDriftingSmallWindow=null;
}
} /**
* 显示大浮窗
* 显示位置为屏幕中间
*
* 注意细节问题
* 例如以下写法,有偏差,显示效果并不好
* mDriftingBigWindowLayoutParams.x = screenWidth / 2;
* mDriftingBigWindowLayoutParams.y = screenHeight / 2;
* 给人的感觉是大浮窗并没有在屏幕中间位置.
* 由于这个mDriftingBigWindowLayoutParams.x(y)指的是大浮窗
* 在屏幕上显示的x(y)的開始坐标值,即从哪个坐标開始摆放大浮窗.
* 极端地说假设大浮窗就沙子那么大,那么这么做就没有问题,由于大浮窗
* 本身就没有什么宽和高.
* 但在实际中我们还要考虑到控件本身(此处的大浮窗)的长和宽,做到
* 真的居中显示
* 所以应该这么写:
* mDriftingBigWindowLayoutParams.x = screenWidth / 2- DriftingBigWindow.width / 2;
* mDriftingBigWindowLayoutParams.y = screenHeight / 2- DriftingBigWindow.height / 2;
* 相似的问题在小浮窗的拖动过程中也有
*/
public static void showDriftingBiglWindow(Context context) {
WindowManager windowManager = getWindowManager(context);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
mDriftingBigWindow = new DriftingBigWindow(context);
if (mDriftingBigWindowLayoutParams == null) {
mDriftingBigWindowLayoutParams = new LayoutParams();
mDriftingBigWindowLayoutParams.x = screenWidth / 2- DriftingBigWindow.width / 2;
mDriftingBigWindowLayoutParams.y = screenHeight / 2- DriftingBigWindow.height / 2;
mDriftingBigWindowLayoutParams.type = LayoutParams.TYPE_PHONE;
mDriftingBigWindowLayoutParams.format = PixelFormat.RGBA_8888;
mDriftingBigWindowLayoutParams.gravity = Gravity.LEFT | Gravity.TOP;
mDriftingBigWindowLayoutParams.width = DriftingBigWindow.width;
mDriftingBigWindowLayoutParams.height = DriftingBigWindow.height;
}
windowManager.addView(mDriftingBigWindow,mDriftingBigWindowLayoutParams);
} /**
* 移除大浮窗
*/
public static void removeDriftingBiglWindow(Context context){
mWindowManager=getWindowManager(context);
if(mWindowManager!=null&&mDriftingBigWindow!=null){
mWindowManager.removeView(mDriftingBigWindow);
mDriftingBigWindow=null;
}
} /**
* 是否有浮窗在Launcher上显示
*/
public static boolean isDriftingWindowShowing(){
if (mDriftingSmallWindow!=null||mDriftingBigWindow!=null) {
return true;
} else {
return false;
}
} /**
* 获取WindowManager
*/
private static WindowManager getWindowManager(Context context){
if (mWindowManager==null) {
mWindowManager=(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
}
return mWindowManager;
} }
DriftingWindowService例如以下:
package cc.cc; import java.util.Timer;
import java.util.TimerTask;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
/**
* 利用该服务进行定时任务
*
*/
public class DriftingWindowService extends Service {
private Timer mTimer;
private TimerTask mTimerTask;
private Context mContext;
private Handler mHandler;
@Override
public void onCreate() {
super.onCreate();
} @Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
mContext=this;
mHandler=new Handler();
mTimer=new Timer();
mTimerTask=new TimerTaskSubclass();
//开启定时的任务
mTimer.schedule(mTimerTask, 100, 500);
} @Override
public IBinder onBind(Intent arg0) {
return null;
} @Override
public void onDestroy() {
super.onDestroy();
if (mTimer!=null) {
mTimer.cancel();
}
} private class TimerTaskSubclass extends TimerTask{
@Override
public void run() {
//当前是Launcher,则显示小浮窗
if (Utils.currentIsLauncher(mContext)&&!DriftingWindowManager.isDriftingWindowShowing()) {
mHandler.post(new Runnable() {
@Override
public void run() {
DriftingWindowManager.showDriftingSmallWindow(mContext);
}
});
} //当前不是Launcher且有浮窗显示,则移除浮窗
if(!Utils.currentIsLauncher(mContext)&&DriftingWindowManager.isDriftingWindowShowing()){
mHandler.post(new Runnable() {
@Override
public void run() {
DriftingWindowManager.removeDriftingSmallWindow(mContext);
DriftingWindowManager.removeDriftingBiglWindow(mContext);
}
});
} //当前是Launcher,则更新内存使用率
if(Utils.currentIsLauncher(mContext)){
mHandler.post(new Runnable() {
@Override
public void run() {
DriftingWindowManager.updateDriftingSmallWindow(mContext);
}
});
}
} } }
Utils例如以下:
package cc.cc; import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.List;
import android.app.ActivityManager;
import android.app.ActivityManager.MemoryInfo;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.ComponentName;
import android.content.Context; public class Utils {
/**
* 获取设备状态栏高度
*/
public static int getStatusBarHeight(Context context) {
int statusBarHeight = 0;
try {
Class clazz = Class.forName("com.android.internal.R$dimen");
Object object = clazz.newInstance();
Field field = clazz.getField("status_bar_height");
// 反射出该对象中status_bar_height字段所相应的在R文件的id值
// 该id值由系统工具自己主动生成,文档描写叙述例如以下:
// The desired resource identifier, as generated by the aapt tool.
int id = Integer.parseInt(field.get(object).toString());
// 根据id值获取到状态栏的高度,单位为像素
statusBarHeight = context.getResources().getDimensionPixelSize(id);
} catch (Exception e) {
}
return statusBarHeight;
} /**
* 推断设备当前是否停留在Launcher
*/
public static boolean currentIsLauncher(Context context){
boolean isLauncher=false;
String topActivityName=getTopActivityName(context);
if (topActivityName!=null&&topActivityName.startsWith("HomeActivity")) {
isLauncher=true;
}
return isLauncher;
} /**
* 获取栈顶Activity名称
*/
public static String getTopActivityName(Context context) {
String topActivityName = null;
ActivityManager activityManager =
(ActivityManager)(context.getSystemService(android.content.Context.ACTIVITY_SERVICE));
List<RunningTaskInfo> runningTaskInfos = activityManager.getRunningTasks(1);
if (runningTaskInfos != null) {
ComponentName f = runningTaskInfos.get(0).topActivity;
String topActivityClassName = f.getClassName();
String temp[] = topActivityClassName.split("\\.");
// 栈顶Activity的名称
topActivityName = temp[temp.length - 1];
}
return topActivityName;
} /**
* 获取当前内存的可用率
*/
public static String getAvailMemoryPercent(Context context){
String info=null;
long availMemory=getAvailMemory(context);
long totalMemory=getTotalMemory();
float percent=(availMemory*100/totalMemory);
info=percent+"%";
return info;
} /**
* 获取内存总大小
*/
public static long getTotalMemory() {
// 系统的内存信息文件
String filePath = "/proc/meminfo";
String lineString;
String[] stringArray;
long totalMemory = 0;
try {
FileReader fileReader = new FileReader(filePath);
BufferedReader bufferedReader = new BufferedReader(fileReader,1024 * 8);
// 读取meminfo第一行,获取系统总内存大小
lineString = bufferedReader.readLine();
// 依照空格拆分
stringArray = lineString.split("\\s+");
// 获得系统总内存,单位KB
totalMemory = Integer.valueOf(stringArray[1]).intValue();
bufferedReader.close();
} catch (IOException e) {
}
return totalMemory / 1024;
} /**
* 获取可用内存大小
*/
public static long getAvailMemory(Context context) {
ActivityManager activityManager =
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
MemoryInfo memoryInfo = new MemoryInfo();
activityManager.getMemoryInfo(memoryInfo);
return memoryInfo.availMem / (1024 * 1024);
} }
main.xml例如以下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
> <Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开启浮动窗体"
android:layout_centerInParent="true"
/> </RelativeLayout>
drifting_window_big.xml例如以下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/driftingBigWindowRootView"
android:layout_width="130dip"
android:layout_height="130dip"
android:orientation="vertical" > <Button
android:id="@+id/closeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="关闭全部浮窗" /> <Button
android:id="@+id/backButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="返回到小浮窗" /> </LinearLayout>
drifting_window_small.xml例如以下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/driftingSmallWindowRootView"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="45dip"
android:layout_height="30dip"
android:background="#00cc00"
android:orientation="horizontal" > <TextView
android:id="@+id/percentTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#ff0000"
android:layout_gravity="center_vertical"
/> </LinearLayout>
AndroidManifest.xml例如以下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cc.cc"
android:versionCode="1"
android:versionName="1.0" > <uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10" /> <!-- 注意权限 -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.GET_TASKS"/> <application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="cc.cc.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> <!-- 注冊服务 -->
<service android:name="cc.cc.DriftingWindowService">
<intent-filter >
<action android:name="dws"/>
</intent-filter>
</service>
</application> </manifest>
版权声明:本文博客原创文章,博客,未经同意,不得转载。
复制360于Launcher浮动窗口的屏幕显示内存使用情况(基本版)的更多相关文章
- 抄360于Launcher浮动窗口的屏幕显示内存使用情况(改进版)
MainActivity例如下列: package cc.cc; import android.os.Bundle; import android.view.View; import android. ...
- Android浮动窗口的实现
1.浮动窗口的实现原理 看到上图的那个小Android图标了吧,它不会被其他组建遮挡,也可以响应用户的点击和拖动事件,它的显示和消失由WindowManager直接管理,它就是Android浮动窗口. ...
- (转)JS浮动窗口(随浏览器滚动而滚动)
原文:http://hi.baidu.com/aiyayaztt/item/4201c55a6b729dced2e10c79 JS浮动窗口(随浏览器滚动而滚动) 往往用于一些联系方式,互动平台模块,随 ...
- Jquery--仿制360右下角弹出窗口
原文:Jquery--仿制360右下角弹出窗口 先发浏览器效果图,给大家看. 要实现这样的效果,按照思路,第一步,写好CSS布局,将图片放到浏览器右下角的位置 CSS代码很灵活,我写的只是简单的一种而 ...
- Jquery 类似新浪微博,鼠标移到头像,用浮动窗口显示用户信息,已做成一个jquery插件
请注意!!!!! 该插件demo PHP 的 demo下载 C#.NET的demo下载 需要如下图, 1.鼠标移动到头像DIV时,Ajax获取数据,并让浮动DIV显示出来. 2.鼠标可以移动到上面浮 ...
- Delphi 悬浮窗口、浮动窗口的实现
源:Delphi 悬浮窗口.浮动窗口的实现 浮动窗体的实现 http://blog.tianya.cn/blogger/post_show.asp?BlogID=68097&PostID=80 ...
- Android 浮动窗口进阶——画中画,浮动视频(附Demo)
今天继续上一篇Android顶层窗口.浮动窗口的进阶应用.上一篇主要讲解了WindowManager服务和如何使用WindowManager编写一个顶层窗口.今天主要是讲讲如何在顶层窗口里面播放视频, ...
- Android 实现顶层窗口、浮动窗口(附Demo)
做过Window程序开发的朋友应该都知道,我们要把程序窗口置顶很简单,只要设置一些窗口属性即可.但是到了Android,你无法简单设置一个属性,就让Android的Activity置顶.因为只要有新的 ...
- 【js】右下角浮动窗口
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- IOCP模型与网络编程
IOCP模型与网络编程 一.前言: 在老师分配任务(“尝试利用IOCP模型写出服务端和客户端的代码”)给我时,脑子一片空白,并不知道什么是IOCP模型,会不会是像软件设计模式里面的工厂模 ...
- IOS7最新的系统漏洞
苹果近期就实用户发现了一个新iOS7系统漏洞,利用这个漏洞绕过password输入界面,在不知道password的情况下打开你近期使用的软件. 而这个过程仅仅需短短的5秒钟! 经測试,这个漏洞并没那么 ...
- 解决ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
在Mac和XAMPP环境,假设终端打字mysql,现这样的问题: ERROR 2002 (HY000): Can't connect to local MySQL server through soc ...
- 专注UI——有用技术:模糊搜索
在如今的项目中.须要做模糊搜索,在曾经技术的基础上非常快得完毕了第一版.大家先看看第一版的效果,我们一会做评论: 0基础: 我们可能部分源代码(附件中会有所有源代码) <span style=& ...
- Xcode 4.6.2 运行次数为偶数程序崩溃问题
如果你的MAC 系统升级到10.8.4 Xcode升级到4.6.2,在工程运行第二次.第四次.第六次 ... 的时候程序就会崩溃 无论是新建的模板工程也会这样,这个属于系统BUG,在stackove ...
- Linux 系统文件夹结构
登录后,在当前的命令窗口中输入命令: <span style="font-size:14px;">ls /</span> 你的终端上会出现例如以下的代码: ...
- VLine2.0——仿阿里巴巴VIPABC真人视频在线教育(基于Flash支持一对多多对多Web在线视频)
感兴趣的朋友可与我联系:acsebt@qq.com 一.登陆页 二.功能页
- Unix Domain Socket 域套接字实现
主要注意流程: STREAM SOCKET: Server : socket() ---> bind() ---> listen() ---> accept() Client: ...
- poj1679(最小生成树)
传送门:The Unique MST 题意:判断最小生成树是否唯一. 分析:先求出原图的最小生成树,然后枚举删掉最小生成树的边,重做kruskal,看新的值和原值是否一样,一样的话最小生成树不唯一. ...
- hdu5124(树状数组+离散化)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5124 题意:有n条线段,求被覆盖到次数最多的点的次数 分析: 1.可以转化成求前缀和最大的问题:将区间 ...