本文整理匯總了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");
}
}