本文整理汇总了Java中pl.polidea.treeview.TreeViewList类的典型用法代码示例。如果您正苦于以下问题:Java TreeViewList类的具体用法?Java TreeViewList怎么用?Java TreeViewList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeViewList类属于pl.polidea.treeview包,在下文中一共展示了TreeViewList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import pl.polidea.treeview.TreeViewList; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TreeType newTreeType = null;
boolean newCollapsible;
if (savedInstanceState == null) {
manager = new InMemoryTreeStateManager<Long>();
final TreeBuilder<Long> treeBuilder = new TreeBuilder<Long>(manager);
for (int i = 0; i < DEMO_NODES.length; i++) {
treeBuilder.sequentiallyAddNextNode((long) i, DEMO_NODES[i]);
}
Log.d(TAG, manager.toString());
newTreeType = TreeType.SIMPLE;
newCollapsible = true;
} else {
manager = (TreeStateManager<Long>) savedInstanceState
.getSerializable("treeManager");
newTreeType = (TreeType) savedInstanceState
.getSerializable("treeType");
newCollapsible = savedInstanceState.getBoolean("collapsible");
}
setContentView(R.layout.main_demo);
treeView = (TreeViewList) findViewById(R.id.mainTreeView);
fancyAdapter = new FancyColouredVariousSizesAdapter(this, selected,
manager, LEVEL_NUMBER);
simpleAdapter = new SimpleStandardAdapter(this, selected, manager,
LEVEL_NUMBER);
setTreeAdapter(newTreeType);
setCollapsible(newCollapsible);
registerForContextMenu(treeView);
}
开发者ID:t-arn,项目名称:tomarn66-tree-view-list-android,代码行数:33,代码来源:TreeViewListDemo.java
示例2: onCreate
import pl.polidea.treeview.TreeViewList; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TreeType newTreeType = null;
boolean newCollapsible;
if (savedInstanceState == null) {
manager = new InMemoryTreeStateManager<Long>();
final TreeBuilder<Long> treeBuilder = new TreeBuilder<Long>(manager);
for (int i = 0; i < DEMO_NODES.length; i++) {
treeBuilder.sequentiallyAddNextNode((long) i, DEMO_NODES[i]);
}
Log.d(TAG, manager.toString());
newTreeType = TreeType.SIMPLE;
newCollapsible = true;
} else {
manager = (TreeStateManager<Long>) savedInstanceState
.getSerializable("treeManager");
if (manager == null) {
manager = new InMemoryTreeStateManager<Long>();
}
newTreeType = (TreeType) savedInstanceState
.getSerializable("treeType");
if (newTreeType == null) {
newTreeType = TreeType.SIMPLE;
}
newCollapsible = savedInstanceState.getBoolean("collapsible");
}
setContentView(R.layout.main_demo);
treeView = (TreeViewList) findViewById(R.id.mainTreeView);
fancyAdapter = new FancyColouredVariousSizesAdapter(this, selected,
manager, LEVEL_NUMBER);
simpleAdapter = new SimpleStandardAdapter(this, selected, manager,
LEVEL_NUMBER);
setTreeAdapter(newTreeType);
setCollapsible(newCollapsible);
registerForContextMenu(treeView);
}
开发者ID:rdeguzman,项目名称:treeview-list-android,代码行数:39,代码来源:TreeViewListDemo.java
示例3: onStart
import pl.polidea.treeview.TreeViewList; //导入依赖的package包/类
@Override
public void onStart (){
super.onStart();
treeViewList = (TreeViewList) getView().findViewById(R.id.packetTreeView);
}
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:7,代码来源:PacketDetailsFragment.java
示例4: onCreate
import pl.polidea.treeview.TreeViewList; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
Bundle state = savedInstanceState;
if (state == null)
state = this.getIntent().getBundleExtra(Const.KEY_SAVED_INSTANCE_STATE);
super.onCreate(state);
if (state != null) {
manager = (DownloadTreeStateManager) state.getSerializable(STATE_KEY_TREE_MANAGER);
}
if (manager == null)
manager = new DownloadTreeStateManager();
builder = new TreeBuilder<RemoteFile>(manager);
setContentView(R.layout.activity_map_download);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
downloadProgress = (ProgressBar) findViewById(R.id.downloadProgress);
downloadErrorLayout = (LinearLayout) findViewById(R.id.downloadErrorLayout);
downloadRetry = (Button) findViewById(R.id.downloadRetry);
treeView = (TreeViewList) findViewById(R.id.downloadList);
/*
* FIXME: Android wants the number of distinct layouts, which here is the same as the number of
* levels and in theory unlimited. Using more levels than specified here will cause exceptions which
* are beyond our control (only system functions in the call stack) and semi-random (creating more
* levels than specified will work initially but the code will barf sometime later, e.g. on scroll).
*
* The maximum number of levels is currently 4 (multilingual/continent/country/region.map),
* therefore 5 is safe even if another one level is added. However, if the layout on the server ever
* changes and goes beyond that, we'll get semi-random crashes.
*/
treeViewAdapter = new DownloadTreeViewAdapter(this, manager, 5);
treeView.setAdapter(treeViewAdapter);
treeView.setCollapsible(true);
treeView.setCollapsedDrawable(getResources().getDrawable(R.drawable.ic_expand_more));
treeView.setExpandedDrawable(getResources().getDrawable(R.drawable.ic_expand_less));
treeView.setIndentWidth(24);
downloadErrorLayout.setVisibility(View.GONE);
OnClickListener clis = new OnClickListener () {
@Override
public void onClick(View v) {
if (v == downloadRetry) {
treeView.setVisibility(View.GONE);
downloadErrorLayout.setVisibility(View.GONE);
downloadProgress.setVisibility(View.VISIBLE);
// get data from server
dirListTask = new RemoteDirListTask(MapDownloadActivity.this, null);
dirListTask.execute(MAP_DOWNLOAD_BASE_URL);
}
}
};
downloadRetry.setOnClickListener(clis);
List<RemoteFile> topItems = manager.getChildren(null);
if ((topItems == null) || (topItems.size() == 0)) {
treeView.setVisibility(View.GONE);
downloadProgress.setVisibility(View.VISIBLE);
// get data from server
dirListTask = new RemoteDirListTask(this, null);
dirListTask.execute(MAP_DOWNLOAD_BASE_URL);
}
treeViewAdapter.registerIntentReceiver();
}
开发者ID:mvglasow,项目名称:satstat,代码行数:71,代码来源:MapDownloadActivity.java
注:本文中的pl.polidea.treeview.TreeViewList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论