編輯:關於Android編程
private boolean mHasInit = false;
private boolean mHasKeyboard = false;
private int mHeight;
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
// TODO Auto-generated method stub
super.onLayout(changed, l, t, r, b);
if(!mHasInit) {
mHasInit = true;
mHeight = b;
System.out.println("mHeight= "+b);
} else {
mHeight = mHeight < b ? b : mHeight;
}
if(mHasInit && mHeight > b) { //mHeight代表鍵盤的真實高度 ,b代表在窗口中的高度 mHeight>b
mHasKeyboard = true;
Xlog.e(TAG, "bottomBar---------------->出來了");
}
if(mHasInit && mHasKeyboard && mHeight == b) { // mHeight = b
mHasKeyboard = false;
cancelBottomBarAnimation();
this.setVisibility(View.VISIBLE);
mShowing = false;
Xlog.e(TAG, "bottomBar---------------->隱藏了");
}
}
Android Otto框架淺析
今天要介紹的是一個Android中使用得比較多的android 事件總線 EventBus模式的一個框架Otto。Otto 官網:http://square.github
Android基礎之四大組件---BroadcastReceiver
學習Android一段時間,來總結下BroadcastReceiver的使用方法。一、什麼是廣播,廣播接受者廣播:廣泛運用在應用程序之間傳輸信息的機制。 廣播接受者(Br
Android之日期及時間選擇對話框用法實例分析
本文實例講述了Android之日期及時間選擇對話框用法。分享給大家供大家參考。具體如下:清單文件:<?xml version=1.0 encoding=ut
msm8909+android5.1.1--打開調試(debug)串口
msm8909+android5.1.1--打開調試(debug)串口1.共同修改的地方(1)kernel\arch\arm\configs\msm8909-1gb-CB