androidx.fragment.app.FragmentActivity.findViewById()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中androidx.fragment.app.FragmentActivity.findViewById()方法的一些代码示例,展示了FragmentActivity.findViewById()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FragmentActivity.findViewById()方法的具体详情如下:
包路径:androidx.fragment.app.FragmentActivity
类名称:FragmentActivity
方法名:findViewById

FragmentActivity.findViewById介绍

暂无

代码示例

代码示例来源:origin: guardianproject/haven

CameraView cameraView = getActivity().findViewById(R.id.camera_view);

代码示例来源:origin: cSploit/android

getActivity().setTitle("cSploit > " + mTarget);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
theList = (ListView) getActivity().findViewById(R.id.android_list);
mAvailable = System.getPluginsForTarget();
ActionsAdapter mActionsAdapter = new ActionsAdapter();

代码示例来源:origin: westnordost/StreetComplete

private void updateCloseButtonVisibility()
{
  // this is called asynchronously. It may happen that the activity is already gone when this
  // method is finally called
  if(getActivity() == null) return;
  int toolbarHeight = getActivity().findViewById(R.id.toolbar).getHeight();
  float speechBubbleTopMargin = getResources().getDimension(R.dimen.quest_form_speech_bubble_top_margin);
  boolean coversToolbar = bottomSheet.getTop() < speechBubbleTopMargin + toolbarHeight;
  closeButton.setVisibility(coversToolbar ? View.VISIBLE : View.INVISIBLE);
}

代码示例来源:origin: offensive-security/nethunter-app

private void getExternalIp() {
  final TextView ip = (TextView) getActivity().findViewById(R.id.editText2);
  ip.setText("Please wait...");

代码示例来源:origin: sschueller/peertube-android

void updateVideoRating() {
  Button thumbsUpButton = getActivity().findViewById(R.id.video_thumbs_up);
  Button thumbsDownButton = getActivity().findViewById(R.id.video_thumbs_down);
  TypedValue typedValue = new TypedValue();
  TypedArray a = getContext().obtainStyledAttributes(typedValue.data, new int[]{R.attr.colorPrimary});
  int accentColor = a.getColor(0, 0);
  if (videoRating.getRating().equals(getString(R.string.video_rating_none))) {
    thumbsUpButton.setTextColor(defaultTextColor);
    thumbsDownButton.setTextColor(defaultTextColor);
    //Log.v(TAG, getString(R.string.video_rating_none));
  } else if (videoRating.getRating().equals(getString(R.string.video_rating_like))) {
    thumbsUpButton.setTextColor(accentColor);
    thumbsDownButton.setTextColor(defaultTextColor);
    //Log.v(TAG, getString(R.string.video_rating_like));
  } else if (videoRating.getRating().equals(getString(R.string.video_rating_dislike))) {
    thumbsUpButton.setTextColor(defaultTextColor);
    thumbsDownButton.setTextColor(accentColor);
    //Log.v(TAG, getString(R.string.video_rating_dislike));
  }
  a.recycle();
}

代码示例来源:origin: offensive-security/nethunter-app

private void updateOptions() {
  String sourceFile = exe.ReadFile_SYNC(sourcePath);
  EditText ifc = (EditText) getActivity().findViewById(R.id.ifc);
  sourceFile = sourceFile.replaceAll("(?m)^INTERFACE=(.*)$", "INTERFACE=" + ifc.getText().toString());
  Boolean r = exe.SaveFileContents(sourceFile, sourcePath);// 1st arg contents, 2nd arg filepath
  if (r) {
    nh.showMessage("Options updated!");
  } else {
    nh.showMessage("Options not updated!");
  }
}

代码示例来源:origin: sschueller/peertube-android

public void setIsFullscreen(Boolean fullscreen) {
  isFullscreen = fullscreen;
  TextView fullscreenButton = getActivity().findViewById(R.id.exo_fullscreen);
  if (fullscreen) {
    fullscreenButton.setText(R.string.video_compress_icon);
  } else {
    fullscreenButton.setText(R.string.video_expand_icon);
  }
  new Iconics.IconicsBuilder().ctx(getContext()).on(fullscreenButton).build();
}

代码示例来源:origin: pranavpandey/dynamic-support

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  ((DynamicActivity) getActivity()).addHeader(R.layout.ads_tabs, true);
  mTabLayout = getActivity().findViewById(R.id.ads_tab_layout);
  mViewPager.setAdapter(mAdapter);
  mTabLayout.setupWithViewPager(mViewPager);
}

代码示例来源:origin: michael-rapp/AndroidMaterialDialog

/**
 * Creates and returns the rectangular reveal animation, which should be used to show or hide
 * dialogs.
 *
 * @param preference
 *         The preference, which is used to show the dialog, as an instance of the class {@link
 *         Preference}
 * @return The animation, which has been created, as an instance of the type {@link
 * DialogAnimation}
 */
private DialogAnimation createRectangularRevealAnimation(@NonNull final Preference preference) {
  if (shouldUseAnimations()) {
    RecyclerView recyclerView = getListView();
    View view = recyclerView.getChildAt(preference.getOrder() + 1);
    int[] viewLocation = new int[2];
    view.getLocationOnScreen(viewLocation);
    View rootView = getActivity().findViewById(android.R.id.content);
    int[] rootViewLocation = new int[2];
    rootView.getLocationOnScreen(rootViewLocation);
    ActionBar toolbar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    int y = viewLocation[1];
    if (!shouldUseFullscreen()) {
      y -= (rootViewLocation[1] - (toolbar != null ? toolbar.getHeight() : 0));
    }
    return new RectangleRevealAnimation.Builder(getActivity()).setWidth(view.getWidth())
        .setHeight(view.getHeight()).setX(viewLocation[0]).setY(y).create();
  }
  return null;
}

代码示例来源:origin: YassinAJDI/PopularMovies

private void setupListAdapter() {
  RecyclerView recyclerView = getActivity().findViewById(R.id.rv_movie_list);
  final DiscoverMoviesAdapter discoverMoviesAdapter =
      new DiscoverMoviesAdapter(viewModel);

相关文章

微信公众号

最新文章

更多