Java Code Examples for android.view.View.toString()

The following are Jave code examples for showing how to use toString() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: simple-upnp   File: FileBrowserAdapter.java   View Source Code Vote up 7 votes
@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());
    }
}
 
Example 2
Project: OddLauncher   File: HomeActivity.java   View Source Code Vote up 6 votes
private void fillHomeViews(View... views) {
    String key;
    for (View view : views) {
        key = view.toString();
        homeViews.put(key, view);
    }
}
 
Example 3
Project: HtmlNative   File: LayoutParamsCreator.java   View Source Code Vote up 6 votes
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());
    }
}
 
Example 4
Project: CalcMate   File: MatrixModule.java   View Source Code Vote up 5 votes
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();
    }
}