Java 类com.facebook.react.R 实例源码

项目:RNLearn_Project1    文件:RedBoxDialog.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (position == 0) {
    TextView title = convertView != null
        ? (TextView) convertView
        : (TextView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.redbox_item_title, parent, false);
    title.setText(mTitle);
    return title;
  } else {
    if (convertView == null) {
      convertView = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.redbox_item_frame, parent, false);
      convertView.setTag(new FrameViewHolder(convertView));
    }
    StackFrame frame = mStack[position - 1];
    FrameViewHolder holder = (FrameViewHolder) convertView.getTag();
    holder.mMethodView.setText(frame.getMethod());
    holder.mFileView.setText(StackTraceHelper.formatFrameSource(frame));
    return convertView;
  }
}
项目:RNLearn_Project1    文件:DevSupportManagerImpl.java   
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
    final SimpleSettableFuture<Boolean> future) {
  return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {
    @Override
    public void onSuccess() {
      future.set(true);
      mDevLoadingViewController.hide();
      mDevLoadingViewVisible = false;
    }

    @Override
    public void onFailure(final Throwable cause) {
      mDevLoadingViewController.hide();
      mDevLoadingViewVisible = false;
      FLog.e(ReactConstants.TAG, "Unable to connect to remote debugger", cause);
      future.setException(
          new IOException(
              mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));
    }
  };
}
项目:RNLearn_Project1    文件:RedBoxDialog.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (position == 0) {
    TextView title = convertView != null
        ? (TextView) convertView
        : (TextView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.redbox_item_title, parent, false);
    title.setText(mTitle);
    return title;
  } else {
    if (convertView == null) {
      convertView = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.redbox_item_frame, parent, false);
      convertView.setTag(new FrameViewHolder(convertView));
    }
    StackFrame frame = mStack[position - 1];
    FrameViewHolder holder = (FrameViewHolder) convertView.getTag();
    holder.mMethodView.setText(frame.getMethod());
    holder.mFileView.setText(StackTraceHelper.formatFrameSource(frame));
    return convertView;
  }
}
项目:RNLearn_Project1    文件:ReactToolbarManager.java   
private static int[] getDefaultColors(Context context) {
  Resources.Theme theme = context.getTheme();
  TypedArray toolbarStyle = null;
  TypedArray textAppearances = null;
  TypedArray titleTextAppearance = null;
  TypedArray subtitleTextAppearance = null;

  try {
    toolbarStyle = theme
        .obtainStyledAttributes(new int[]{R.attr.toolbarStyle});
    int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
    textAppearances = theme.obtainStyledAttributes(
        toolbarStyleResId, new int[]{
            R.attr.titleTextAppearance,
            R.attr.subtitleTextAppearance,
        });
    int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
    int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

    titleTextAppearance = theme
        .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});
    subtitleTextAppearance = theme
        .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});

    int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
    int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

    return new int[] {titleTextColor, subtitleTextColor};
  } finally {
    recycleQuietly(toolbarStyle);
    recycleQuietly(textAppearances);
    recycleQuietly(titleTextAppearance);
    recycleQuietly(subtitleTextAppearance);
  }
}
项目:RNLearn_Project1    文件:DevSupportManagerImpl.java   
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
    final SimpleSettableFuture<Boolean> future) {
  return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {
    @Override
    public void onSuccess() {
      future.set(true);
      mDevLoadingViewController.hide();
      mDevLoadingViewVisible = false;
    }

    @Override
    public void onFailure(final Throwable cause) {
      mDevLoadingViewController.hide();
      mDevLoadingViewVisible = false;
      FLog.e(ReactConstants.TAG, "Unable to connect to remote debugger", cause);
      future.setException(
          new IOException(
              mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));
    }
  };
}
项目:ReactNativeSignatureExample    文件:DevSupportManagerImpl.java   
@Override
public void handleReloadJS() {
  UiThreadUtil.assertOnUiThread();

  // dismiss redbox if exists
  if (mRedBoxDialog != null) {
    mRedBoxDialog.dismiss();
  }

  ProgressDialog progressDialog = new ProgressDialog(mApplicationContext);
  progressDialog.setTitle(R.string.catalyst_jsload_title);
  progressDialog.setMessage(mApplicationContext.getString(
      mIsUsingJSProxy ? R.string.catalyst_remotedbg_message : R.string.catalyst_jsload_message));
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
  progressDialog.show();

  if (mIsUsingJSProxy) {
    reloadJSInProxyMode(progressDialog);
  } else {
    reloadJSFromServer(progressDialog);
  }
}
项目:ReactNativeSignatureExample    文件:DevSupportManagerImpl.java   
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
    final ProgressDialog progressDialog,
    final SimpleSettableFuture<Boolean> future) {
  return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {
    @Override
    public void onSuccess() {
      future.set(true);
      progressDialog.dismiss();
    }

    @Override
    public void onFailure(final Throwable cause) {
      progressDialog.dismiss();
      FLog.e(ReactConstants.TAG, "Unable to connect to remote debugger", cause);
      future.setException(
          new IOException(
              mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));
    }
  };
}
项目:ReactNativeSignatureExample    文件:RedBoxDialog.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (position == 0) {
    TextView title = convertView != null
        ? (TextView) convertView
        : (TextView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.redbox_item_title, parent, false);
    title.setText(mTitle);
    return title;
  } else {
    if (convertView == null) {
      convertView = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.redbox_item_frame, parent, false);
      convertView.setTag(new FrameViewHolder(convertView));
    }
    StackFrame frame = mStack[position - 1];
    FrameViewHolder holder = (FrameViewHolder) convertView.getTag();
    holder.mMethodView.setText(frame.getMethod());
    holder.mFileView.setText(frame.getFileName() + ":" + frame.getLine());
    return convertView;
  }
}
项目:ReactNativeSignatureExample    文件:RedBoxDialog.java   
protected RedBoxDialog(Context context, DevSupportManager devSupportManager) {
  super(context, R.style.Theme_Catalyst_RedBox);

  requestWindowFeature(Window.FEATURE_NO_TITLE);

  setContentView(R.layout.redbox_view);

  mDevSupportManager = devSupportManager;

  mStackView = (ListView) findViewById(R.id.rn_redbox_stack);
  mStackView.setOnItemClickListener(this);
  mReloadJs = (Button) findViewById(R.id.rn_redbox_reloadjs);
  mReloadJs.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      mDevSupportManager.handleReloadJS();
    }
  });
}
项目:react-native-ibeacon-android    文件:DevSupportManagerImpl.java   
@Override
public void handleReloadJS() {
  UiThreadUtil.assertOnUiThread();

  // dismiss redbox if exists
  if (mRedBoxDialog != null) {
    mRedBoxDialog.dismiss();
  }

  ProgressDialog progressDialog = new ProgressDialog(mApplicationContext);
  progressDialog.setTitle(R.string.catalyst_jsload_title);
  progressDialog.setMessage(mApplicationContext.getString(
      mIsUsingJSProxy ? R.string.catalyst_remotedbg_message : R.string.catalyst_jsload_message));
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
  progressDialog.show();

  if (mIsUsingJSProxy) {
    reloadJSInProxyMode(progressDialog);
  } else {
    reloadJSFromServer(progressDialog);
  }
}
项目:react-native-ibeacon-android    文件:DevSupportManagerImpl.java   
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
    final ProgressDialog progressDialog,
    final SimpleSettableFuture<Boolean> future) {
  return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {
    @Override
    public void onSuccess() {
      future.set(true);
      progressDialog.dismiss();
    }

    @Override
    public void onFailure(final Throwable cause) {
      progressDialog.dismiss();
      FLog.e(ReactConstants.TAG, "Unable to connect to remote debugger", cause);
      future.setException(
          new IOException(
              mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));
    }
  };
}
项目:react-native-ibeacon-android    文件:RedBoxDialog.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (position == 0) {
    TextView title = convertView != null
        ? (TextView) convertView
        : (TextView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.redbox_item_title, parent, false);
    title.setText(mTitle);
    return title;
  } else {
    if (convertView == null) {
      convertView = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.redbox_item_frame, parent, false);
      convertView.setTag(new FrameViewHolder(convertView));
    }
    StackFrame frame = mStack[position - 1];
    FrameViewHolder holder = (FrameViewHolder) convertView.getTag();
    holder.mMethodView.setText(frame.getMethod());
    holder.mFileView.setText(frame.getFileName() + ":" + frame.getLine());
    return convertView;
  }
}
项目:react-native-ibeacon-android    文件:RedBoxDialog.java   
protected RedBoxDialog(Context context, DevSupportManager devSupportManager) {
  super(context, R.style.Theme_Catalyst_RedBox);

  requestWindowFeature(Window.FEATURE_NO_TITLE);

  setContentView(R.layout.redbox_view);

  mDevSupportManager = devSupportManager;

  mStackView = (ListView) findViewById(R.id.rn_redbox_stack);
  mStackView.setOnItemClickListener(this);
  mReloadJs = (Button) findViewById(R.id.rn_redbox_reloadjs);
  mReloadJs.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      mDevSupportManager.handleReloadJS();
    }
  });
}
项目:react-native-box-loaders    文件:DevSupportManagerImpl.java   
@Override
public void handleReloadJS() {
  UiThreadUtil.assertOnUiThread();

  // dismiss redbox if exists
  if (mRedBoxDialog != null) {
    mRedBoxDialog.dismiss();
  }

  ProgressDialog progressDialog = new ProgressDialog(mApplicationContext);
  progressDialog.setTitle(R.string.catalyst_jsload_title);
  progressDialog.setMessage(mApplicationContext.getString(
      mIsUsingJSProxy ? R.string.catalyst_remotedbg_message : R.string.catalyst_jsload_message));
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
  progressDialog.show();

  if (mIsUsingJSProxy) {
    reloadJSInProxyMode(progressDialog);
  } else {
    reloadJSFromServer(progressDialog);
  }
}
项目:react-native-box-loaders    文件:DevSupportManagerImpl.java   
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
    final ProgressDialog progressDialog,
    final SimpleSettableFuture<Boolean> future) {
  return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {
    @Override
    public void onSuccess() {
      future.set(true);
      progressDialog.dismiss();
    }

    @Override
    public void onFailure(final Throwable cause) {
      progressDialog.dismiss();
      FLog.e(ReactConstants.TAG, "Unable to connect to remote debugger", cause);
      future.setException(
          new IOException(
              mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));
    }
  };
}
项目:react-native-box-loaders    文件:RedBoxDialog.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (position == 0) {
    TextView title = convertView != null
        ? (TextView) convertView
        : (TextView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.redbox_item_title, parent, false);
    title.setText(mTitle);
    return title;
  } else {
    if (convertView == null) {
      convertView = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.redbox_item_frame, parent, false);
      convertView.setTag(new FrameViewHolder(convertView));
    }
    StackFrame frame = mStack[position - 1];
    FrameViewHolder holder = (FrameViewHolder) convertView.getTag();
    holder.mMethodView.setText(frame.getMethod());
    final int column = frame.getColumn();
    final String columnString = column < 0 ? "" : ":" + column;
    holder.mFileView.setText(frame.getFileName() + ":" + frame.getLine() + columnString);
    return convertView;
  }
}
项目:react-native-box-loaders    文件:RedBoxDialog.java   
protected RedBoxDialog(Context context, DevSupportManager devSupportManager) {
  super(context, R.style.Theme_Catalyst_RedBox);

  requestWindowFeature(Window.FEATURE_NO_TITLE);

  setContentView(R.layout.redbox_view);

  mDevSupportManager = devSupportManager;

  mStackView = (ListView) findViewById(R.id.rn_redbox_stack);
  mStackView.setOnItemClickListener(this);
  mReloadJs = (Button) findViewById(R.id.rn_redbox_reloadjs);
  mReloadJs.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      mDevSupportManager.handleReloadJS();
    }
  });
}
项目:Ironman    文件:DevSupportManagerImpl.java   
@Override
public void handleReloadJS() {
  UiThreadUtil.assertOnUiThread();

  // dismiss redbox if exists
  if (mRedBoxDialog != null) {
    mRedBoxDialog.dismiss();
  }

  AlertDialog dialog = new AlertDialog.Builder(mApplicationContext)
    .setTitle(R.string.catalyst_jsload_title)
    .setMessage(mApplicationContext.getString(
        mDevSettings.isRemoteJSDebugEnabled() ? R.string.catalyst_remotedbg_message : R.string.catalyst_jsload_message))
    .create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
  dialog.show();

  if (mDevSettings.isRemoteJSDebugEnabled()) {
    reloadJSInProxyMode(dialog);
  } else {
    reloadJSFromServer(dialog);
  }
}
项目:Ironman    文件:DevSupportManagerImpl.java   
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
    final AlertDialog progressDialog,
    final SimpleSettableFuture<Boolean> future) {
  return new WebsocketJavaScriptExecutor.JSExecutorConnectCallback() {
    @Override
    public void onSuccess() {
      future.set(true);
      progressDialog.dismiss();
    }

    @Override
    public void onFailure(final Throwable cause) {
      progressDialog.dismiss();
      FLog.e(ReactConstants.TAG, "Unable to connect to remote debugger", cause);
      future.setException(
          new IOException(
              mApplicationContext.getString(R.string.catalyst_remotedbg_error), cause));
    }
  };
}
项目:Ironman    文件:RedBoxDialog.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (position == 0) {
    TextView title = convertView != null
        ? (TextView) convertView
        : (TextView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.redbox_item_title, parent, false);
    title.setText(mTitle);
    return title;
  } else {
    if (convertView == null) {
      convertView = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.redbox_item_frame, parent, false);
      convertView.setTag(new FrameViewHolder(convertView));
    }
    StackFrame frame = mStack[position - 1];
    FrameViewHolder holder = (FrameViewHolder) convertView.getTag();
    holder.mMethodView.setText(frame.getMethod());
    holder.mFileView.setText(StackTraceHelper.formatFrameSource(frame));
    return convertView;
  }
}
项目:RNLearn_Project1    文件:ReactSliderManager.java   
@ReactProp(name = "minimumTrackTintColor", customType = "Color")
public void setMinimumTrackTintColor(ReactSlider view, Integer color) {
  LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();
  Drawable background = drawable.findDrawableByLayerId(android.R.id.background);
  if (color == null) {
    background.clearColorFilter();
  } else {
    background.setColorFilter(color, PorterDuff.Mode.SRC_IN);
  }
}
项目:RNLearn_Project1    文件:ReactSliderManager.java   
@ReactProp(name = "maximumTrackTintColor", customType = "Color")
public void setMaximumTrackTintColor(ReactSlider view, Integer color) {
  LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();
  Drawable progress = drawable.findDrawableByLayerId(android.R.id.progress);
  if (color == null) {
    progress.clearColorFilter();
  } else {
    progress.setColorFilter(color, PorterDuff.Mode.SRC_IN);
  }
}
项目:RNLearn_Project1    文件:ReactToolbarManager.java   
private static int[] getDefaultColors(Context context) {
  Resources.Theme theme = context.getTheme();
  TypedArray toolbarStyle = null;
  TypedArray textAppearances = null;
  TypedArray titleTextAppearance = null;
  TypedArray subtitleTextAppearance = null;

  try {
    toolbarStyle = theme
        .obtainStyledAttributes(new int[]{R.attr.toolbarStyle});
    int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
    textAppearances = theme.obtainStyledAttributes(
        toolbarStyleResId, new int[]{
            R.attr.titleTextAppearance,
            R.attr.subtitleTextAppearance,
        });
    int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
    int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

    titleTextAppearance = theme
        .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});
    subtitleTextAppearance = theme
        .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});

    int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
    int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

    return new int[] {titleTextColor, subtitleTextColor};
  } finally {
    recycleQuietly(toolbarStyle);
    recycleQuietly(textAppearances);
    recycleQuietly(titleTextAppearance);
    recycleQuietly(subtitleTextAppearance);
  }
}
项目:RNLearn_Project1    文件:FpsView.java   
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(ChoreographerCompat.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
项目:RNLearn_Project1    文件:BaseViewManager.java   
@ReactProp(name = PROP_TEST_ID)
public void setTestId(T view, String testId) {
  view.setTag(R.id.react_test_id, testId);

  // temporarily set the tag and keyed tags to avoid end to end test regressions
  view.setTag(testId);
}
项目:RNLearn_Project1    文件:ReactSliderManager.java   
@ReactProp(name = "minimumTrackTintColor", customType = "Color")
public void setMinimumTrackTintColor(ReactSlider view, Integer color) {
  LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();
  Drawable background = drawable.findDrawableByLayerId(android.R.id.background);
  if (color == null) {
    background.clearColorFilter();
  } else {
    background.setColorFilter(color, PorterDuff.Mode.SRC_IN);
  }
}
项目:RNLearn_Project1    文件:ReactSliderManager.java   
@ReactProp(name = "maximumTrackTintColor", customType = "Color")
public void setMaximumTrackTintColor(ReactSlider view, Integer color) {
  LayerDrawable drawable = (LayerDrawable) view.getProgressDrawable().getCurrent();
  Drawable progress = drawable.findDrawableByLayerId(android.R.id.progress);
  if (color == null) {
    progress.clearColorFilter();
  } else {
    progress.setColorFilter(color, PorterDuff.Mode.SRC_IN);
  }
}
项目:RNLearn_Project1    文件:FpsView.java   
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(ChoreographerCompat.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
项目:ReactNativeSignatureExample    文件:ReactToolbarManager.java   
private static int[] getDefaultColors(Context context) {
  Resources.Theme theme = context.getTheme();
  TypedArray toolbarStyle = null;
  TypedArray textAppearances = null;
  TypedArray titleTextAppearance = null;
  TypedArray subtitleTextAppearance = null;

  try {
    toolbarStyle = theme
        .obtainStyledAttributes(new int[]{R.attr.toolbarStyle});
    int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
    textAppearances = theme.obtainStyledAttributes(
        toolbarStyleResId, new int[]{
            R.attr.titleTextAppearance,
            R.attr.subtitleTextAppearance,
        });
    int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
    int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

    titleTextAppearance = theme
        .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});
    subtitleTextAppearance = theme
        .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});

    int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
    int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

    return new int[] {titleTextColor, subtitleTextColor};
  } finally {
    recycleQuietly(toolbarStyle);
    recycleQuietly(textAppearances);
    recycleQuietly(titleTextAppearance);
    recycleQuietly(subtitleTextAppearance);
  }
}
项目:ReactNativeSignatureExample    文件:FpsView.java   
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(Choreographer.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
项目:react-native-ibeacon-android    文件:ReactToolbarManager.java   
private static int[] getDefaultColors(Context context) {
  Resources.Theme theme = context.getTheme();
  TypedArray toolbarStyle = null;
  TypedArray textAppearances = null;
  TypedArray titleTextAppearance = null;
  TypedArray subtitleTextAppearance = null;

  try {
    toolbarStyle = theme
        .obtainStyledAttributes(new int[]{R.attr.toolbarStyle});
    int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
    textAppearances = theme.obtainStyledAttributes(
        toolbarStyleResId, new int[]{
            R.attr.titleTextAppearance,
            R.attr.subtitleTextAppearance,
        });
    int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
    int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

    titleTextAppearance = theme
        .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});
    subtitleTextAppearance = theme
        .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});

    int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
    int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

    return new int[] {titleTextColor, subtitleTextColor};
  } finally {
    recycleQuietly(toolbarStyle);
    recycleQuietly(textAppearances);
    recycleQuietly(titleTextAppearance);
    recycleQuietly(subtitleTextAppearance);
  }
}
项目:react-native-ibeacon-android    文件:FpsView.java   
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(Choreographer.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
项目:react-native-box-loaders    文件:ReactToolbarManager.java   
private static int[] getDefaultColors(Context context) {
  Resources.Theme theme = context.getTheme();
  TypedArray toolbarStyle = null;
  TypedArray textAppearances = null;
  TypedArray titleTextAppearance = null;
  TypedArray subtitleTextAppearance = null;

  try {
    toolbarStyle = theme
        .obtainStyledAttributes(new int[]{R.attr.toolbarStyle});
    int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
    textAppearances = theme.obtainStyledAttributes(
        toolbarStyleResId, new int[]{
            R.attr.titleTextAppearance,
            R.attr.subtitleTextAppearance,
        });
    int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
    int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

    titleTextAppearance = theme
        .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});
    subtitleTextAppearance = theme
        .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});

    int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
    int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

    return new int[] {titleTextColor, subtitleTextColor};
  } finally {
    recycleQuietly(toolbarStyle);
    recycleQuietly(textAppearances);
    recycleQuietly(titleTextAppearance);
    recycleQuietly(subtitleTextAppearance);
  }
}
项目:react-native-box-loaders    文件:FpsView.java   
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(Choreographer.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
项目:Ironman    文件:ReactToolbarManager.java   
private static int[] getDefaultColors(Context context) {
  Resources.Theme theme = context.getTheme();
  TypedArray toolbarStyle = null;
  TypedArray textAppearances = null;
  TypedArray titleTextAppearance = null;
  TypedArray subtitleTextAppearance = null;

  try {
    toolbarStyle = theme
        .obtainStyledAttributes(new int[]{R.attr.toolbarStyle});
    int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
    textAppearances = theme.obtainStyledAttributes(
        toolbarStyleResId, new int[]{
            R.attr.titleTextAppearance,
            R.attr.subtitleTextAppearance,
        });
    int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
    int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

    titleTextAppearance = theme
        .obtainStyledAttributes(titleTextAppearanceResId, new int[]{android.R.attr.textColor});
    subtitleTextAppearance = theme
        .obtainStyledAttributes(subtitleTextAppearanceResId, new int[]{android.R.attr.textColor});

    int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
    int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

    return new int[] {titleTextColor, subtitleTextColor};
  } finally {
    recycleQuietly(toolbarStyle);
    recycleQuietly(textAppearances);
    recycleQuietly(titleTextAppearance);
    recycleQuietly(subtitleTextAppearance);
  }
}
项目:Ironman    文件:FpsView.java   
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(Choreographer.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
项目:RNLearn_Project1    文件:DevSupportManagerImpl.java   
public void reloadJSFromServer(final String bundleURL) {
  mDevLoadingViewController.showForUrl(bundleURL);
  mDevLoadingViewVisible = true;

  mDevServerHelper.downloadBundleFromURL(
      new DevServerHelper.BundleDownloadCallback() {
        @Override
        public void onSuccess() {
          mDevLoadingViewController.hide();
          mDevLoadingViewVisible = false;
          UiThreadUtil.runOnUiThread(
              new Runnable() {
                @Override
                public void run() {
                  mReactInstanceCommandsHandler.onJSBundleLoadedFromServer();
                }
              });
        }

        @Override
        public void onProgress(@Nullable final String status, @Nullable final Integer done, @Nullable final Integer total) {
          mDevLoadingViewController.updateProgress(status, done, total);
        }

        @Override
        public void onFailure(final Exception cause) {
          mDevLoadingViewController.hide();
          mDevLoadingViewVisible = false;
          FLog.e(ReactConstants.TAG, "Unable to download JS bundle", cause);
          UiThreadUtil.runOnUiThread(
              new Runnable() {
                @Override
                public void run() {
                  if (cause instanceof DebugServerException) {
                    DebugServerException debugServerException = (DebugServerException) cause;
                    showNewJavaError(debugServerException.getMessage(), cause);
                  } else {
                    showNewJavaError(
                        mApplicationContext.getString(R.string.catalyst_jsload_error),
                        cause);
                  }
                }
              });
        }
      },
      mJSBundleTempFile,
      bundleURL);
}
项目:RNLearn_Project1    文件:RedBoxDialog.java   
private FrameViewHolder(View v) {
  mMethodView = (TextView) v.findViewById(R.id.rn_frame_method);
  mFileView = (TextView) v.findViewById(R.id.rn_frame_file);
}
项目:RNLearn_Project1    文件:DevSettingsActivity.java   
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setTitle(R.string.catalyst_settings_title);
  addPreferencesFromResource(R.xml.preferences);
}
项目:RNLearn_Project1    文件:DevLoadingViewController.java   
public DevLoadingViewController(Context context) {
  mContext = context;
  mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
  LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mDevLoadingView = (TextView) inflater.inflate(R.layout.dev_loading_view, null);
}