當前位置: 首頁>>代碼示例>>Java>>正文


Java DataSetObserver類代碼示例

本文整理匯總了Java中android.database.DataSetObserver的典型用法代碼示例。如果您正苦於以下問題:Java DataSetObserver類的具體用法?Java DataSetObserver怎麽用?Java DataSetObserver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataSetObserver類屬於android.database包,在下文中一共展示了DataSetObserver類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setAdapter

import android.database.DataSetObserver; //導入依賴的package包/類
public void setAdapter(MyScheduleAdapter adapter) {
    if (mAdapter != null && mObserver != null) {
        mAdapter.unregisterDataSetObserver(mObserver);
        mObserver = null;
    }
    mAdapter = adapter;
    rebuild();
    if (mAdapter != null) {
        mAdapter.registerDataSetObserver(new DataSetObserver() {
            @Override
            public void onChanged() {
                rebuild();
            }

            @Override
            public void onInvalidated() {
                setAdapter(null);
            }
        });
    }
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:22,代碼來源:MyScheduleView.java

示例2: init

import android.database.DataSetObserver; //導入依賴的package包/類
private void init() {
    mDataSetObserver = new DataSetObserver() {
        @Override
        public void onChanged() {
            removeAllViews();
            for (int i = 0; i < mRadioAdapter.getCount(); i++) {
                RadioButton radioButton = mRadioAdapter.getRadioButton(i);
                addView(radioButton);
            }
            setCurrentItem(0);
        }

        @Override
        public void onInvalidated() {
            super.onInvalidated();
        }
    };

    mRadioAdapter = new MyRadioAdapter(null);
    mRadioAdapter.setViewPagerObserver(mDataSetObserver);
}
 
開發者ID:auv1107,項目名稱:TextEmoji,代碼行數:22,代碼來源:AdaptableRadioGroup.java

示例3: setAdapter

import android.database.DataSetObserver; //導入依賴的package包/類
/**
 * @see ListView#setAdapter(ListAdapter)
 */
@Override
public void setAdapter(ListAdapter adapter) {
    super.setAdapter(adapter);
    if (isDropDownStyle) {
        setSecondPositionVisible();
    }
    touchListener.resetItems();
    adapter.registerDataSetObserver(new DataSetObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
            onListChanged();
            touchListener.resetItems();
        }
    });
}
 
開發者ID:Louis19910615,項目名稱:youkes_browser,代碼行數:20,代碼來源:SwipeListView.java

示例4: initView

import android.database.DataSetObserver; //導入依賴的package包/類
private void initView() {
    gridView = findViewById(R.id.grid);
    mToolbar = findViewById(R.id.topbar);
    setSupportActionBar(mToolbar);
    mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
    setTitle(getIntent().getStringExtra(MediaSetUtils.SET_NAME));
    mAdapter = new TimeLineAdapter(this);
    mAdapter.setDecodeSize(decodeBitmapWidth);
    mAdapter.registerDataSetObserver(new DataSetObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
        }
    });

    gridView.setAdapter(mAdapter);
    gridView.setOnItemClickListener(this);
}
 
開發者ID:YuntaoWei,項目名稱:PictureShow,代碼行數:24,代碼來源:AlbumPage.java

示例5: registerDataSetObserver

import android.database.DataSetObserver; //導入依賴的package包/類
@Override
public void registerDataSetObserver(DataSetObserver observer) {
    if (datasetObservers == null) {
        datasetObservers = new LinkedList<DataSetObserver>();
    }
    datasetObservers.add(observer);
}
 
開發者ID:ArtifexSoftware,項目名稱:mupdf-android-viewer-nui,代碼行數:8,代碼來源:AbstractWheelAdapter.java

示例6: onRestoreInstanceState

import android.database.DataSetObserver; //導入依賴的package包/類
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    myCalendar = (Calendar) savedInstanceState.getSerializable("calendar");
    hasReminder = savedInstanceState.getBoolean("hasReminder");
    items = (ArrayList<ListItem>) savedInstanceState.getSerializable("items");
    adapter = new ListItemArrayAdapter(this, items);
    add_list_values.setAdapter(adapter);

    adapter.registerDataSetObserver(new DataSetObserver() {
        @Override
        public void onChanged() {
            super.onChanged();

            int totalHeight = 0;
            for (int i = 0; i < adapter.getCount(); i++) {
                View listItem = adapter.getView(i, null, add_list_values);
                listItem.measure(0, 0);
                totalHeight += listItem.getMeasuredHeight();
            }

            ViewGroup.LayoutParams params = add_list_values.getLayoutParams();
            params.height = totalHeight + (add_list_values.getDividerHeight() * (adapter.getCount() - 1));
            add_list_values.setLayoutParams(params);
            add_list_values.requestLayout();
        }
    });
    adapter.notifyDataSetChanged();
}
 
開發者ID:JeanBarriere,項目名稱:Note,代碼行數:30,代碼來源:AddListActivity.java

示例7: notifyDataInvalidatedEvent

import android.database.DataSetObserver; //導入依賴的package包/類
/**
 * Notifies observers about invalidating data
 */
protected void notifyDataInvalidatedEvent() {
    if (datasetObservers != null) {
        for (DataSetObserver observer : datasetObservers) {
            observer.onInvalidated();
        }
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:11,代碼來源:AbstractWheelAdapter.java

示例8: notifyDataInvalidatedEvent

import android.database.DataSetObserver; //導入依賴的package包/類
protected void notifyDataInvalidatedEvent() {
    if (this.datasetObservers != null) {
        for (DataSetObserver observer : this.datasetObservers) {
            observer.onInvalidated();
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:8,代碼來源:AbstractWheelAdapter.java

示例9: notifyDataChangedEvent

import android.database.DataSetObserver; //導入依賴的package包/類
/**
 * Notifies observers about data changing
 */
protected void notifyDataChangedEvent() {
    if (datasetObservers != null) {
        for (DataSetObserver observer : datasetObservers) {
            observer.onChanged();
        }
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:AbstractWheelAdapter.java

示例10: unregisterDataSetObserver

import android.database.DataSetObserver; //導入依賴的package包/類
@Override
public void unregisterDataSetObserver(DataSetObserver observer) {
    int length = mCursors.length;
    for (int i = 0 ; i < length ; i++) {
        if (mCursors[i] != null) {
            mCursors[i].unregisterDataSetObserver(observer);
        }
    }
}
 
開發者ID:YuntaoWei,項目名稱:PictureShow,代碼行數:10,代碼來源:MyMergeSortCursor.java

示例11: AdapterWrapper

import android.database.DataSetObserver; //導入依賴的package包/類
public AdapterWrapper(ListAdapter adapter) {
    super();
    mAdapter = adapter;
    
    mAdapter.registerDataSetObserver(new DataSetObserver() {
        public void onChanged() {
            notifyDataSetChanged();
        }

        public void onInvalidated() {
            notifyDataSetInvalidated();
        }
    });
}
 
開發者ID:ultrasonic,項目名稱:ultrasonic,代碼行數:15,代碼來源:DragSortListView.java

示例12: setViewPagerObserver

import android.database.DataSetObserver; //導入依賴的package包/類
@Override
public void setViewPagerObserver(DataSetObserver observer) {
    super.setViewPagerObserver(observer);
    if (observer == null) {
        wrapperViewPager(mViewPager, this);
    }
}
 
開發者ID:Brave-wan,項目名稱:SmartRefresh,代碼行數:8,代碼來源:RefreshContentWrapper.java

示例13: CBLoopPagerAdapterWrapper

import android.database.DataSetObserver; //導入依賴的package包/類
CBLoopPagerAdapterWrapper(PagerAdapter adapter) {
    this.mAdapter = adapter;
    adapter.registerDataSetObserver(new DataSetObserver(){
        public void onChanged(){
            notifyDataSetChanged();
        }
    });
}
 
開發者ID:AndroidBoySC,項目名稱:Mybilibili,代碼行數:9,代碼來源:CBLoopPagerAdapterWrapper.java

示例14: registerDataSetObserver

import android.database.DataSetObserver; //導入依賴的package包/類
@Override
public void registerDataSetObserver(DataSetObserver observer) {
	if (datasetObservers == null) {
		datasetObservers = new LinkedList<DataSetObserver>();
	}
	datasetObservers.add(observer);
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:8,代碼來源:AbstractWheelAdapter.java

示例15: notifyDataChangedEvent

import android.database.DataSetObserver; //導入依賴的package包/類
/**
 * Notifies observers about data changing
 */
protected void notifyDataChangedEvent() {
	if (datasetObservers != null) {
		for (DataSetObserver observer : datasetObservers) {
			observer.onChanged();
		}
	}
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:11,代碼來源:AbstractWheelAdapter.java


注:本文中的android.database.DataSetObserver類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。