本文整理汇总了Java中com.unnamed.b.atv.view.AndroidTreeView.setDefaultContainerStyle方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidTreeView.setDefaultContainerStyle方法的具体用法?Java AndroidTreeView.setDefaultContainerStyle怎么用?Java AndroidTreeView.setDefaultContainerStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.unnamed.b.atv.view.AndroidTreeView
的用法示例。
在下文中一共展示了AndroidTreeView.setDefaultContainerStyle方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showForums
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public void showForums(ForumItemTree forumRoot) {
tView = new AndroidTreeView(getContext());
root = TreeNode.root();
recourse(forumRoot, root);
tView.setRoot(root);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultViewHolder(DefaultForumHolder.class);
tView.setDefaultNodeClickListener(nodeClickListener);
tView.setDefaultNodeLongClickListener(nodeLongClickListener);
treeContainer.removeAllViews();
treeContainer.addView(tView.getView());
if (forumId != -1) {
scrollToForum(forumId);
forumId = -1;
}
}
示例2: GpxManager
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
GpxManager(Activity context) {
this.mContext = context;
managerView = (RelativeLayout) mContext.getLayoutInflater().inflate(R.layout.manager_gpx, null);
treeView = new AndroidTreeView(mContext, root);
treeView.setDefaultAnimation(true);
treeView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
treeView.setUse2dScroll(true);
treeView.setSelectionModeEnabled(true);
LinearLayout contentView = (LinearLayout) managerView.findViewById(R.id.gpx_content);
contentView.addView(treeView.getView());
}
示例3: onCreateView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_default, null, false);
final ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
rootView.findViewById(R.id.status_bar).setVisibility(View.GONE);
final TreeNode root = TreeNode.root();
TreeNode myProfile = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "My Profile")).setViewHolder(new ProfileHolder(getActivity()));
TreeNode bruce = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Bruce Wayne")).setViewHolder(new ProfileHolder(getActivity()));
TreeNode clark = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Clark Kent")).setViewHolder(new ProfileHolder(getActivity()));
TreeNode barry = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Barry Allen")).setViewHolder(new ProfileHolder(getActivity()));
addProfileData(myProfile);
addProfileData(clark);
addProfileData(bruce);
addProfileData(barry);
root.addChildren(myProfile, bruce, barry, clark);
tView = new AndroidTreeView(getActivity(), root);
tView.setDefaultAnimation(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleDivided, true);
containerView.addView(tView.getView());
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
示例4: onCreateView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_selectable_nodes, null, false);
rootView.findViewById(R.id.status).setVisibility(View.GONE);
ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
TreeNode root = TreeNode.root();
TreeNode s1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Folder with very long name ")).setViewHolder(new SelectableHeaderHolder(getActivity()));
TreeNode s2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Another folder with very long name")).setViewHolder(new SelectableHeaderHolder(getActivity()));
fillFolder(s1);
fillFolder(s2);
root.addChildren(s1, s2);
tView = new AndroidTreeView(getActivity(), root);
tView.setDefaultAnimation(true);
tView.setUse2dScroll(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
containerView.addView(tView.getView());
tView.expandAll();
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
示例5: onCreateView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_selectable_nodes, null, false);
rootView.findViewById(R.id.status).setVisibility(View.GONE);
ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
TreeNode root = TreeNode.root();
TreeNode s1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Folder with very long name ")).setViewHolder(
new ArrowExpandSelectableHeaderHolder(getActivity()));
TreeNode s2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Another folder with very long name")).setViewHolder(
new ArrowExpandSelectableHeaderHolder(getActivity()));
fillFolder(s1);
fillFolder(s2);
root.addChildren(s1, s2);
tView = new AndroidTreeView(getActivity(), root);
tView.setDefaultAnimation(true);
tView.setUse2dScroll(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultNodeClickListener(TwoDScrollingArrowExpandFragment.this);
tView.setDefaultViewHolder(ArrowExpandSelectableHeaderHolder.class);
containerView.addView(tView.getView());
tView.setUseAutoToggle(false);
tView.expandAll();
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
示例6: onCreate
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inventory_explorer);
callback = new PerformOperationCallback();
setUpBindings();
setUpToolbar();
ViewGroup containerView = (ViewGroup) findViewById(R.id.container);
root = TreeNode.root();
holder = root.getViewHolder();
tView = new AndroidTreeView(this, root);
tView.setDefaultAnimation(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultViewHolder(IconTreeItemHolder.class);
tView.setDefaultNodeClickListener(nodeClickListener);
tView.setDefaultNodeLongClickListener(nodeLongClickListener);
containerView.addView(tView.getView());
BackendClient.of(this).getFeeds(new FeedsCallback());
//String path = CanonicalPath.getByString("/t;hawkular/f;400e8e5737ca/mt;Runtime%20Availability~VM%20Availability").getMetricType();
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
}
示例7: onCreateView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_default, null, false);
final ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
rootView.findViewById(R.id.status_bar).setVisibility(View.GONE);
final TreeNode root = TreeNode.root();
TreeNode myProfile = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "My Profile")).setViewHolder(new ProfileHolder(getActivity()));
TreeNode bruce = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Bruce Wayne")).setViewHolder(new ProfileHolder(getActivity()));
TreeNode clark = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Clark Kent")).setViewHolder(new ProfileHolder(getActivity()));
TreeNode barry = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Barry Allen")).setViewHolder(new ProfileHolder(getActivity()));
addProfileData(myProfile);
addProfileData(clark);
addProfileData(bruce);
addProfileData(barry);
root.addChildren(myProfile, bruce, barry, clark);
tView = new AndroidTreeView(getActivity(), root);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleDivided, true);
containerView.addView(tView.getView());
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
示例8: showAccountsAndClusters
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public void showAccountsAndClusters(SortedMap<MovirtAccount, List<Cluster>> map) {
AccountsTreeItem.ActiveSelectionChangedListener changedListener = presenter::onActiveSelectionChanged;
AccountsTreeItem.LongClickListener longClickListener = presenter::onLongClickListener;
TreeNode anchor = TreeNode.root();
AccountsTreeItem rootData = new AccountsTreeItem(null, null, changedListener, longClickListener);
drawerRoot = new TreeNode(rootData)
.setViewHolder(new AccountsTreeHolder(this))
.setExpanded(true);
anchor.addChild(drawerRoot);
for (Map.Entry<MovirtAccount, List<Cluster>> entry : map.entrySet()) {
AccountsTreeItem accountData = new AccountsTreeItem(entry.getKey(), null, changedListener, longClickListener);
TreeNode accountNode = new TreeNode(accountData)
.setViewHolder(new AccountsTreeHolder(this))
.setExpanded(true);
drawerRoot.addChild(accountNode);
for (Cluster cluster : entry.getValue()) {
AccountsTreeItem clusterData = new AccountsTreeItem(entry.getKey(), cluster, changedListener, longClickListener);
TreeNode newClusterNode = new TreeNode(clusterData)
.setViewHolder(new AccountsTreeHolder(this))
.setExpanded(true);
accountNode.addChild(newClusterNode);
}
}
AndroidTreeView atv = new AndroidTreeView(this, anchor);
atv.setUseAutoToggle(false);
atv.setSelectionModeEnabled(true);
atv.setDefaultContainerStyle(R.style.LargePaddingTreeNode);
selectionDrawer.removeAllViews(); // remove previous tree
selectionDrawer.addView(atv.getView());
}
示例9: onCreateView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_default, null, false);
ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
statusBar = (TextView) rootView.findViewById(R.id.status_bar);
TreeNode root = TreeNode.root();
TreeNode computerRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_laptop, "My Computer"));
TreeNode myDocuments = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "My Documents"));
TreeNode downloads = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Downloads"));
TreeNode file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 1"));
TreeNode file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 2"));
TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 3"));
TreeNode file4 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 4"));
fillDownloadsFolder(downloads);
downloads.addChildren(file1, file2, file3, file4);
TreeNode myMedia = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo_library, "Photos"));
TreeNode photo1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Folder 1"));
TreeNode photo2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Folder 2"));
TreeNode photo3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Folder 3"));
myMedia.addChildren(photo1, photo2, photo3);
myDocuments.addChild(downloads);
computerRoot.addChildren(myDocuments, myMedia);
root.addChildren(computerRoot);
tView = new AndroidTreeView(getActivity(), root);
tView.setDefaultAnimation(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultViewHolder(IconTreeItemHolder.class);
tView.setDefaultNodeClickListener(nodeClickListener);
tView.setDefaultNodeLongClickListener(nodeLongClickListener);
containerView.addView(tView.getView());
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
示例10: onCreate
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mindmapLayout = (RelativeLayout) findViewById(R.id.mindmapLayout);
mindmapLayout.setX(mindmapLayout.getX() - (1920 - 1080));
input = (EditText) findViewById(R.id.input);
TreeNode root = TreeNode.root();
TreeNode computerRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_cloud, "Happiness"));
first_root = computerRoot;
current_root = first_root;
TreeNode myDocuments = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Money"));
TreeNode downloads = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "luxury"));
TreeNode file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "gold"));
TreeNode file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "sliver"));
TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "gem"));
TreeNode file4 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "ivory"));
downloads.addChildren(file1, file2, file3, file4);
TreeNode myMedia = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo_library, "life"));
TreeNode photo1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "health"));
TreeNode photo2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "love"));
TreeNode photo3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "stability"));
myMedia.addChildren(photo1, photo2, photo3);
myDocuments.addChild(downloads);
computerRoot.addChildren(myDocuments, myMedia);
root.addChildren(computerRoot);
/////////////////////////////////////////////////////////////////
tView = new AndroidTreeView(this, root);
tView.setDefaultAnimation(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultViewHolder(IconTreeItemHolder.class);
tView.setDefaultNodeClickListener(nodeClickListener);
tView.setDefaultNodeLongClickListener(nodeLongClickListener);
RelativeLayout containerView = (RelativeLayout) findViewById(R.id.item);
tView_result = tView.getView();
containerView.addView(tView_result);
////////////////////////////////////////////////////////////////////////////////////////
setMView(first_root);
}
示例11: initializeCategoryTree
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
private void initializeCategoryTree()
{
List<Category> roots = mViewModel.getAllCategories();
HashMap<Long, Category> children = mViewModel.getChildrenCategories();
TreeNode root = TreeNode.root();
if(!roots.isEmpty())
{
currentCategory = roots.get(0).getName();
statusBarTextView.setText(currentCategory);
}
currentIndex = 0;
boolean skipEverythingButAllProducts = true;
while(currentIndex < roots.size())
{
Category c = roots.get(currentIndex++);
if(c.getParent_category_id() == 0) {
TreeNode node = new TreeNode(new TreeItemHolder.TreeItem(c));
depthSearchBuilder(node, c.getCategoryId(), roots);
root.addChild(node);
if(skipEverythingButAllProducts && currentIndex > 0) break;
}
}
mTreeView = new AndroidTreeView(getActivity(), root);
mTreeView.setDefaultViewHolder(TreeItemHolder.class);
mTreeView.setDefaultAnimation(false);
mTreeView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
mTreeView.setDefaultNodeClickListener(new TreeNode.TreeNodeClickListener() {
@Override
public void onClick(TreeNode treeNode, Object o) {
currentCategory = treeNode.getValue().toString();
TreeItemHolder treeNodeViewHolder = (TreeItemHolder) treeNode.getViewHolder();
treeNodeViewHolder.setActive(true);
if (lastSelectedNode != null && lastSelectedNode != treeNodeViewHolder) {
lastSelectedNode.setActive(false);
}
lastSelectedNode = treeNodeViewHolder;
statusBarTextView.setText(currentCategory);
}
});
treeViewContainer.addView(mTreeView.getView());
/* Delete, if root is not 'all products' */
mTreeView.expandLevel(1);
}
示例12: onCreateView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_default, null, false);
ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
statusBar = (TextView) rootView.findViewById(R.id.status_bar);
TreeNode root = TreeNode.root();
TreeNode computerRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_laptop, "My Computer"));
TreeNode myDocuments = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "My Documents"));
TreeNode downloads = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Downloads"));
TreeNode file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 1"));
TreeNode file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 2"));
TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 3"));
TreeNode file4 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 4"));
fillDownloadsFolder(downloads);
downloads.addChildren(file1, file2, file3, file4);
TreeNode myMedia = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo_library, "Photos"));
TreeNode photo1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Photo 1"));
TreeNode photo2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Photo 2"));
TreeNode photo3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Photo 3"));
myMedia.addChildren(photo1, photo2, photo3);
myDocuments.addChild(downloads);
computerRoot.addChildren(myDocuments, myMedia);
root.addChildren(computerRoot);
tView = new AndroidTreeView(getActivity(), root);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultViewHolder(IconTreeItemHolder.class);
tView.setDefaultNodeClickListener(nodeClickListener);
containerView.addView(tView.getView());
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
示例13: createTreeView
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
View createTreeView(PackageInfoX info){
AndroidTreeView v = new AndroidTreeView(this, TreeNodeFactory.crateTreeNode(info));
v.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
return v.getView();
}
示例14: showCerts
import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public void showCerts(Cert[] certs) {
LinearLayout container = certTreeContainer;
if (certs == null || certs.length == 0) {
certTreeContainer.removeAllViews(); // remove previous tree
return;
}
TreeNode root = TreeNode.root();
TreeNode intermediateLeaf = root;
CertTreeHolder leafHolder = null;
int visibleCertificates;
if (certs.length > MAX_VISIBLE_CERTIFICATES) {
visibleCertificates = MAX_VISIBLE_CERTIFICATES;
} else {
visibleCertificates = certs.length;
}
CertTreeItem.CertificateSelectedListener listener = (certificate, location) -> {
txtCertDetails.setText(certificate.toString());
txtCertUrl.setText(location);
};
for (int i = visibleCertificates - 1; i >= 0; i--) { // create tree hierarchy
CertTreeItem data = new CertTreeItem(certs[i], listener);
leafHolder = new CertTreeHolder(this);
TreeNode newNode = new TreeNode(data).setViewHolder(leafHolder);
intermediateLeaf.addChild(newNode);
intermediateLeaf.setExpanded(true);
intermediateLeaf = newNode;
}
AndroidTreeView atv = new AndroidTreeView(this, root);
atv.setUseAutoToggle(false);
atv.setSelectionModeEnabled(true);
atv.setDefaultContainerStyle(R.style.SmallPaddingTreeNode);
container.addView(atv.getView());
if (leafHolder != null) {
leafHolder.selectNode(); // select Api certificate
}
}