本文整理汇总了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());
}
}
示例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);
}
}
示例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());
}
}
示例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();
}
}