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浮动窗口的屏幕显示内存使用情况(基本版)的更多相关文章

  1. 抄360于Launcher浮动窗口的屏幕显示内存使用情况(改进版)

    MainActivity例如下列: package cc.cc; import android.os.Bundle; import android.view.View; import android. ...

  2. Android浮动窗口的实现

    1.浮动窗口的实现原理 看到上图的那个小Android图标了吧,它不会被其他组建遮挡,也可以响应用户的点击和拖动事件,它的显示和消失由WindowManager直接管理,它就是Android浮动窗口. ...

  3. (转)JS浮动窗口(随浏览器滚动而滚动)

    原文:http://hi.baidu.com/aiyayaztt/item/4201c55a6b729dced2e10c79 JS浮动窗口(随浏览器滚动而滚动) 往往用于一些联系方式,互动平台模块,随 ...

  4. Jquery--仿制360右下角弹出窗口

    原文:Jquery--仿制360右下角弹出窗口 先发浏览器效果图,给大家看. 要实现这样的效果,按照思路,第一步,写好CSS布局,将图片放到浏览器右下角的位置 CSS代码很灵活,我写的只是简单的一种而 ...

  5. Jquery 类似新浪微博,鼠标移到头像,用浮动窗口显示用户信息,已做成一个jquery插件

    请注意!!!!! 该插件demo PHP 的 demo下载  C#.NET的demo下载 需要如下图, 1.鼠标移动到头像DIV时,Ajax获取数据,并让浮动DIV显示出来. 2.鼠标可以移动到上面浮 ...

  6. Delphi 悬浮窗口、浮动窗口的实现

    源:Delphi 悬浮窗口.浮动窗口的实现 浮动窗体的实现 http://blog.tianya.cn/blogger/post_show.asp?BlogID=68097&PostID=80 ...

  7. Android 浮动窗口进阶——画中画,浮动视频(附Demo)

    今天继续上一篇Android顶层窗口.浮动窗口的进阶应用.上一篇主要讲解了WindowManager服务和如何使用WindowManager编写一个顶层窗口.今天主要是讲讲如何在顶层窗口里面播放视频, ...

  8. Android 实现顶层窗口、浮动窗口(附Demo)

    做过Window程序开发的朋友应该都知道,我们要把程序窗口置顶很简单,只要设置一些窗口属性即可.但是到了Android,你无法简单设置一个属性,就让Android的Activity置顶.因为只要有新的 ...

  9. 【js】右下角浮动窗口

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. 求第i个小的元素 时间复杂度O(n)

    #include<iostream> //求第i个小的元素 时间复杂度O(n) #include<cstdlib> #include<ctime> using na ...

  2. 非对称加密RSA、Elgamal、背包算法、Rabin、D-H、ECC(椭圆曲线加密算法)等。使用最广泛的是RSA算法

          非对称加密算法需要两个密钥:公开密钥(publickey)和私有密钥(privatekey).公开密钥与私有密钥是一对,如果用公开密钥对数据进行加密,只有用对应的私有密钥才能解密:如果用私 ...

  3. Invalid embedded descriptor for ".proto".Dependencies passed (Protobufer)解决办法

    前言 之前开发的时候,发现居然出现了Dependencies passed to FileDescriptor.buildFrom() don't match those listed in the ...

  4. 别样JAVA学习(五)继承上(1.0)Object类equals()

    上一节继承下(一)我们进行抽象类.接口以及多态的学习. 接下来大家我们讲点特殊的东西就是object类, 我们一直在说继承,子继承了父,父还有没有父类呢, 为什么这么思考,大家想构造函数的第一行是不是 ...

  5. 京东商城招聘自动调价系统架构师 T4级别

    岗位级别:T4 岗位职责: 1.负责自动调价系统的架构设计 2.负责自动调价的预测.相关性算法设计 3.核心代码编写,代码review 任职要求: 1.熟悉数据挖掘.机器学习理论和算法 2.熟悉海量数 ...

  6. Matlab实现PCA

    在主成分分析(PCA)中,介绍了PCA的数学原理,其有用Matlab能够非常方便地对矩阵进行操作! 比方,用Matlab求多个样本的协方差矩阵.求矩阵的特征根和特征向量等. 以下介绍用Matlab实现 ...

  7. OpenStack及其构成简介1

    第一部分 OpenStack及其构成简介 一.云计算   云计算是一种计算模型,它将诸如运算能力.存储.网络和软件等资源抽象成为服务,以便让用户通过互联网远程享用,付费的形式也如同传统公共服务设施一样 ...

  8. Eclipse插件基础篇一

    名词翻译 有一些名词在翻译的过程中可能会出现歧义,在这里统一一下. アーキテクチャ=architecture=架构 プラットフォーム=platform=平台 コンポーネント=component=组件 ...

  9. A First Exploration Of SolrCloud

    A First Exploration Of SolrCloud Update: this article was published in August 2012, before the very ...

  10. Android Application plugin

          在网易云阅读App上看到了插件管理功能,刚好自己也需要以插件的模式来扩展已有的功能,于是研究了一下,下面是一张网易云阅读App提供的插件模式,只需下载相应的插件就扩展了相应的功能,非常方便 ...