CameraView cameraView = getActivity().findViewById(R.id.camera_view);
getActivity().setTitle("cSploit > " + mTarget); ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); theList = (ListView) getActivity().findViewById(R.id.android_list); mAvailable = System.getPluginsForTarget(); ActionsAdapter mActionsAdapter = new ActionsAdapter();
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); }
private void getExternalIp() { final TextView ip = (TextView) getActivity().findViewById(R.id.editText2); ip.setText("Please wait...");
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(); }
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!"); } }
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(); }
@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); }
/** * 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; }
private void setupListAdapter() { RecyclerView recyclerView = getActivity().findViewById(R.id.rv_movie_list); final DiscoverMoviesAdapter discoverMoviesAdapter = new DiscoverMoviesAdapter(viewModel);