當前位置: 首頁>>代碼示例>>Java>>正文


Java View.isInEditMode方法代碼示例

本文整理匯總了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;
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:26,代碼來源:ViewGroupMvpViewStateDelegateImpl.java

示例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;
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:ViewGroupMvpDelegateImpl.java

示例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;
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:ViewGroupMviDelegateImpl.java

示例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);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:26,代碼來源:CallTypeIconsView.java

示例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;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:19,代碼來源:ViewUtil.java

示例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;
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:22,代碼來源:UiUtil.java

示例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;
}
 
開發者ID:nickyangjun,項目名稱:EasyEmoji,代碼行數:28,代碼來源:ViewUtil.java

示例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);
}
 
開發者ID:wangzailfm,項目名稱:ImitateButterKnife,代碼行數:13,代碼來源:Utils.java

示例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;
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:29,代碼來源:ViewUtil.java

示例10: WindowDecorActionBar

import android.view.View; //導入方法依賴的package包/類
public WindowDecorActionBar(View layout) {
    if ($assertionsDisabled || layout.isInEditMode()) {
        init(layout);
        return;
    }
    throw new AssertionError();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:8,代碼來源:WindowDecorActionBar.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:Utils.java

示例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");
    }
}
 
開發者ID:roshakorost,項目名稱:Phial,代碼行數:6,代碼來源:Precondition.java


注:本文中的android.view.View.isInEditMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。