当前位置: 首页>>代码示例>>Java>>正文


Java View.toString方法代码示例

本文整理汇总了Java中android.view.View.toString方法的典型用法代码示例。如果您正苦于以下问题:Java View.toString方法的具体用法?Java View.toString怎么用?Java View.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.toString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
    if (view.getId() != R.id.file_browser_list_item_button) {
        throw new IllegalStateException("Unhandled view in onClick: " + view.toString());
    }

    RelativeLayout parent = (RelativeLayout) view.getParent();
    ViewHolder holder = (ViewHolder) parent.getTag();
    ListItem listItem = getItem(holder.position);
    if (mListener != null && listItem != null) {
        mListener.playItems(listItem.getMediaItems());
    }
}
 
开发者ID:stephenmcgruer,项目名称:simple-upnp,代码行数:14,代码来源:FileBrowserAdapter.java

示例2: fillHomeViews

import android.view.View; //导入方法依赖的package包/类
private void fillHomeViews(View... views) {
    String key;
    for (View view : views) {
        key = view.toString();
        homeViews.put(key, view);
    }
}
 
开发者ID:Existentio,项目名称:OddLauncher,代码行数:8,代码来源:HomeActivity.java

示例3: createLayoutParams

import android.view.View; //导入方法依赖的package包/类
public static ViewGroup.LayoutParams createLayoutParams(View parent, LayoutParamsCreator
        creator) {
    if (parent instanceof HNDivLayout) {
        return creator.toHNDivLayoutParams();
    } else if (parent instanceof HNRootView) {
        return creator.toMarginLayoutParams();
    } else if (parent instanceof FlexboxLayout) {
        return creator.toFlexLayoutParams();
    } else {
        throw new IllegalArgumentException("can't create related layoutParams, unknown " +
                "view type " + parent.toString());
    }
}
 
开发者ID:hsllany,项目名称:HtmlNative,代码行数:14,代码来源:LayoutParamsCreator.java

示例4: evaluateMatrices

import android.view.View; //导入方法依赖的package包/类
String evaluateMatrices(AdvancedDisplay display) throws SyntaxException {
    try {
        SimpleMatrix matrix = null;
        boolean add = false;
        boolean multiply = false;
        for(int i = 0; i < display.getChildCount(); i++) {
            View child = display.getChildAt(i);
            if(child instanceof MatrixView) {
                if(!add && !multiply) {
                    matrix = ((MatrixView) child).getSimpleMatrix();
                }
                else if(add) {
                    add = false;
                    if(matrix == null) throw new SyntaxException();
                    matrix = matrix.plus(((MatrixView) child).getSimpleMatrix());
                }
                else if(multiply) {
                    multiply = false;
                    if(matrix == null) throw new SyntaxException();
                    matrix = matrix.mult(((MatrixView) child).getSimpleMatrix());
                }
            }
            else if(child instanceof MatrixTransposeView) {
                if(matrix == null) throw new SyntaxException();
                matrix = matrix.transpose();
            }
            else if(child instanceof MatrixInverseView) {
                if(matrix == null) throw new SyntaxException();
                matrix = matrix.invert();
            }
            else {
                String text = child.toString();
                if(text.length() > 1) throw new SyntaxException();
                else if(text.length() == 0) continue;
                if(text.startsWith(String.valueOf(Logic.MUL))) multiply = true;
                else if(text.startsWith(String.valueOf(Logic.PLUS))) add = true;
                else throw new SyntaxException();
            }
        }
        return logic.mBaseModule.updateTextToNewMode(MatrixView.matrixToString(matrix, logic), Mode.DECIMAL, logic.mBaseModule.getMode());
    }
    catch(Exception e) {
        throw new SyntaxException();
    }
}
 
开发者ID:gigabytedevelopers,项目名称:CalcMate,代码行数:46,代码来源:MatrixModule.java


注:本文中的android.view.View.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。