本文整理汇总了Java中android.view.View.isInEditMode方法的典型用法代码示例。如果您正苦于以下问题:Java View.isInEditMode方法的具体用法?Java View.isInEditMode怎么用?Java View.isInEditMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.isInEditMode方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ViewGroupMvpViewStateDelegateImpl
import android.view.View; //导入方法依赖的package包/类
/**
* Creates a new instance
*
* @param delegateCallback the callback
* @param keepPresenter true, if you want to keep the presenter and view state during screen
* orientation changes etc.
*/
public ViewGroupMvpViewStateDelegateImpl(@NonNull View view,
@NonNull ViewGroupMvpViewStateDelegateCallback<V, P, VS> delegateCallback,
boolean keepPresenter) {
if (view == null) {
throw new NullPointerException("View is null!");
}
if (delegateCallback == null) {
throw new NullPointerException("MvpDelegateCallback is null!");
}
this.delegateCallback = delegateCallback;
this.keepPresenter = keepPresenter;
this.isInEditMode = view.isInEditMode();
if (!isInEditMode) {
this.activity = PresenterManager.getActivity(delegateCallback.getContext());
} else {
this.activity = null;
}
}
示例2: ViewGroupMvpDelegateImpl
import android.view.View; //导入方法依赖的package包/类
public ViewGroupMvpDelegateImpl(@NonNull View view,
@NonNull ViewGroupDelegateCallback<V, P> delegateCallback,
boolean keepPresenterDuringScreenOrientationChange) {
if (view == null) {
throw new NullPointerException("View is null!");
}
if (delegateCallback == null) {
throw new NullPointerException("MvpDelegateCallback is null!");
}
this.delegateCallback = delegateCallback;
this.keepPresenterDuringScreenOrientationChange = keepPresenterDuringScreenOrientationChange;
isInEditMode = view.isInEditMode();
if (!isInEditMode) {
this.activity = PresenterManager.getActivity(delegateCallback.getContext());
} else {
this.activity = null;
}
}
示例3: ViewGroupMviDelegateImpl
import android.view.View; //导入方法依赖的package包/类
public ViewGroupMviDelegateImpl(@NonNull View view,
@NonNull ViewGroupMviDelegateCallback<V, P> delegateCallback,
boolean keepPresenterDuringScreenOrientationChange) {
if (view == null) {
throw new NullPointerException("View is null!");
}
if (delegateCallback == null) {
throw new NullPointerException("MvpDelegateCallback is null!");
}
this.delegateCallback = delegateCallback;
this.keepPresenterDuringScreenOrientationChange = keepPresenterDuringScreenOrientationChange;
this.isInEditMode = view.isInEditMode();
if (!isInEditMode) {
this.activity = PresenterManager.getActivity(delegateCallback.getContext());
} else {
this.activity = null;
}
}
示例4: Resources
import android.view.View; //导入方法依赖的package包/类
public Resources(Context context, View v) {
final android.content.res.Resources r = context.getResources();
Theme t = null;
if(!v.isInEditMode()) {
t = Theme.getCurrentTheme(context);
}
if(t != null) {
incoming = t.getDrawableResource("ic_call_incoming");
outgoing = t.getDrawableResource("ic_call_outgoing");
missed = t.getDrawableResource("ic_call_missed");
iconMargin = t.getDimension("call_log_icon_margin");
}
if(incoming == null) {
incoming = r.getDrawable(R.drawable.ic_call_incoming_holo_dark);
}
if(outgoing == null) {
outgoing = r.getDrawable(R.drawable.ic_call_outgoing_holo_dark);
}
if(missed == null) {
missed = r.getDrawable(R.drawable.ic_call_missed_holo_dark);
}
if(iconMargin == null) {
iconMargin = r.getDimensionPixelSize(R.dimen.call_log_icon_margin);
}
}
示例5: refreshHeight
import android.view.View; //导入方法依赖的package包/类
public static boolean refreshHeight(View view, int aimHeight) {
if (view.isInEditMode()) {
return false;
}
Log.d(TAG, String.format("refresh Height %d %d", new Object[]{Integer.valueOf(view.getHeight()), Integer.valueOf(aimHeight)}));
if (view.getHeight() == aimHeight || Math.abs(view.getHeight() - aimHeight) == StatusBarHeightUtil.getStatusBarHeight(view.getContext())) {
return false;
}
int validPanelHeight = KeyboardUtil.getValidPanelHeight(view.getContext());
LayoutParams layoutParams = view.getLayoutParams();
if (layoutParams == null) {
view.setLayoutParams(new LayoutParams(-1, validPanelHeight));
} else {
layoutParams.height = validPanelHeight;
view.requestLayout();
}
return true;
}
示例6: changeViewHeight
import android.view.View; //导入方法依赖的package包/类
public static boolean changeViewHeight(final View view, final int aimHeight) {
if (view.isInEditMode()) {
return false;
}
if (view.getHeight() == aimHeight) {
return false;
}
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
if (layoutParams == null) {
layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
aimHeight);
view.setLayoutParams(layoutParams);
} else {
layoutParams.height = aimHeight;
view.requestLayout();
}
return true;
}
示例7: refreshHeight
import android.view.View; //导入方法依赖的package包/类
public static boolean refreshHeight(final View view, final int aimHeight) {
if (view.isInEditMode()) {
return false;
}
if (view.getHeight() == aimHeight) {
return false;
}
if (Math.abs(view.getHeight() - aimHeight) ==
StatusBarHeightUtil.getStatusBarHeight(view.getContext())) {
return false;
}
final int validPanelHeight = KeyboardManagerImpl.getValidPanelHeight(view.getContext());
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
if (layoutParams == null) {
layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
validPanelHeight);
view.setLayoutParams(layoutParams);
} else {
layoutParams.height = validPanelHeight;
view.requestLayout();
}
return true;
}
示例8: getResourceEntryName
import android.view.View; //导入方法依赖的package包/类
/**
* getResourceEntryName
* @param view
* @param id
* @return
*/
private static String getResourceEntryName(View view, @IdRes int id) {
if (view.isInEditMode()) {
return "<unavailable while editing>";
}
return view.getContext().getResources().getResourceEntryName(id);
}
示例9: refreshHeight
import android.view.View; //导入方法依赖的package包/类
public static boolean refreshHeight(final View view, final int aimHeight) {
if (view.isInEditMode()) {
return false;
}
Log.d(TAG, String.format("refresh Height %d %d", view.getHeight(), aimHeight));
if (view.getHeight() == aimHeight) {
return false;
}
if (Math.abs(view.getHeight() - aimHeight) ==
StatusBarHeightUtil.getStatusBarHeight(view.getContext())) {
return false;
}
final int validPanelHeight = KeyboardUtil.getValidPanelHeight(view.getContext());
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
if (layoutParams == null) {
layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
validPanelHeight);
view.setLayoutParams(layoutParams);
} else {
layoutParams.height = validPanelHeight;
view.requestLayout();
}
return true;
}
示例10: WindowDecorActionBar
import android.view.View; //导入方法依赖的package包/类
public WindowDecorActionBar(View layout) {
if ($assertionsDisabled || layout.isInEditMode()) {
init(layout);
return;
}
throw new AssertionError();
}
示例11: getResourceEntryName
import android.view.View; //导入方法依赖的package包/类
private static String getResourceEntryName(View view, @IdRes int id) {
if (view.isInEditMode()) {
return "<unavailable while editing>";
}
return view.getContext().getResources().getResourceEntryName(id);
}
示例12: calledFromTools
import android.view.View; //导入方法依赖的package包/类
public static void calledFromTools(View view) {
if (!view.isInEditMode()) {
throw new IllegalArgumentException("should be called only from AndroidStudioTools");
}
}