当前位置: 首页>>代码示例>>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;未经允许,请勿转载。