fix an uninitialized issue

This commit is contained in:
houzh 2022-02-26 08:54:58 +00:00
parent 564681de11
commit 2a06ed2100
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,10 @@
namespace cdroid{
AdapterView::AdapterView(int w,int h):ViewGroup(w,h){
initAdapterView();
}
AdapterView::initAdapterView(){
mFirstPosition=0;
mOldItemCount= mItemCount =0;
mSelectedPosition=INVALID_POSITION;
@ -34,6 +38,7 @@ AdapterView::AdapterView(int w,int h):ViewGroup(w,h){
AdapterView::AdapterView(Context*ctx,const AttributeSet&atts)
:ViewGroup(ctx,atts){
initAdapterView();
}
AdapterView::~AdapterView(){

View File

@ -35,6 +35,7 @@ private:
Runnable mSelectionNotifier;
Runnable mPendingSelectionNotifier;
bool mDesiredFocusableInTouchModeState;
void initAdapterView();
void updateEmptyStatus(bool empty);
void dispatchOnItemSelected();
void fireOnSelected();