Java Code Examples for android.widget.FrameLayout#findViewById()
The following examples show how to use
android.widget.FrameLayout#findViewById() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LiveTvGuideActivity.java From jellyfin-androidtv with GNU General Public License v2.0 | 6 votes |
private void showDatePicker() { FrameLayout scrollPane = (FrameLayout) getLayoutInflater().inflate(R.layout.horizontal_scroll_pane, null); LinearLayout scrollItems = scrollPane.findViewById(R.id.scrollItems); for (long increment = 0; increment < 15; increment++) { scrollItems.addView(new FriendlyDateButton(this, System.currentTimeMillis() + (increment * 86400000), datePickedListener)); } dateDialog = new AlertDialog.Builder(this) .setTitle(R.string.lbl_select_date) .setView(scrollPane) .setNegativeButton(R.string.btn_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }) .show(); }
Example 2
Source File: StopLossTakeProfitActivity.java From shinny-futures-android with GNU General Public License v3.0 | 6 votes |
@Override public boolean onPrepareOptionsMenu(Menu menu) { MenuItem menuItem = menu.findItem(R.id.right_navigation); FrameLayout rootView = (FrameLayout) menuItem.getActionView(); ImageView view = rootView.findViewById(R.id.view_menu); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(StopLossTakeProfitActivity.this, ManagerConditionOrderActivity.class); StopLossTakeProfitActivity.this.startActivity(intent); } }); mBadgeView = new QBadgeView(sContext).bindTarget(view) .setBadgeNumber(-1) .setBadgeBackgroundColor(sContext.getResources().getColor(R.color.launch)) .setBadgeGravity( Gravity.END | Gravity.TOP) .setBadgePadding(4, true) .setGravityOffset(8, 8, true) .setBadgeTextColor(sContext.getResources().getColor(R.color.white)); refreshCO(); return true; }
Example 3
Source File: CompassRenderer.java From PTVGlass with MIT License | 6 votes |
/** * Creates a new instance of the {@code CompassRenderer} with the specified context, * orientation manager, and landmark collection. */ public CompassRenderer(Context context, OrientationManager orientationManager, Landmarks landmarks) { LayoutInflater inflater = LayoutInflater.from(context); mLayout = (FrameLayout) inflater.inflate(R.layout.compass, null); mLayout.setWillNotDraw(false); mCompassView = (CompassView) mLayout.findViewById(R.id.compass); mTipsContainer = (RelativeLayout) mLayout.findViewById(R.id.tips_container); mTipsView = (TextView) mLayout.findViewById(R.id.tips_view); mOrientationManager = orientationManager; mLandmarks = landmarks; mCompassView.setOrientationManager(mOrientationManager); }
Example 4
Source File: MyReviewAdapter.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override public void initItem(FrameLayout frameLayout) { tvDelete = frameLayout.findViewById(R.id.tv_delete); llItem = frameLayout.findViewById(R.id.ll_item); tvTip = frameLayout.findViewById(R.id.tv_tip); tvContent = frameLayout.findViewById(R.id.tv_content); tagFlow = frameLayout.findViewById(R.id.tag_flow); ivCommentedContent = frameLayout.findViewById(R.id.iv_commented_content); tvCommentedContent = frameLayout.findViewById(R.id.tv_commented_content); tvCommentTime = frameLayout.findViewById(R.id.tv_comment_time); }
Example 5
Source File: OpenSourceLicenseFragment.java From DeviceConnect-Android with MIT License | 5 votes |
@Override public Dialog onCreateDialog(final Bundle savedInstanceState) { FrameLayout lframe = new FrameLayout(getActivity()); ListView lv = new ListView(getActivity()); lv.setId(android.R.id.list); lv.setDrawSelectorOnTop(false); lframe.addView(lv, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); lframe.setBackgroundColor(getResources().getColor(android.R.color.background_light)); ArrayAdapter<Parcelable> adapter = new SoftwareArrayAdapter(getActivity(), R.layout.item_open_source_licenses); if (getArguments() != null && getArguments().containsKey(EXTRA_OSS)) { adapter.addAll(getArguments().getParcelableArrayList(EXTRA_OSS)); } ListView listView = lframe.findViewById(android.R.id.list); listView.setAdapter(adapter); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.activity_settings_open_source_licenses); builder.setView(lframe); builder.setPositiveButton(R.string.activity_settings_close, (dialog, which) -> { dialog.dismiss(); }); return builder.create(); }
Example 6
Source File: ServiceBrowserFragment.java From BonjourBrowser with Apache License 2.0 | 5 votes |
@Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { FrameLayout rootView = (FrameLayout) inflater.inflate(R.layout.fragment_service_browser, container, false); mRecyclerView = rootView.findViewById(R.id.recycler_view); mProgressView = rootView.findViewById(R.id.progress); mErrorView = rootView.findViewById(R.id.error_container); mRecyclerView.setLayoutManager(new LinearLayoutManager(mRecyclerView.getContext())); mRecyclerView.setHasFixedSize(true); mRecyclerView.setAdapter(mAdapter); if (savedInstanceState != null) { mAdapter.setSelectedItemId(savedInstanceState.getLong(KEY_SELECTED_POSITION, -1L)); } return rootView; }
Example 7
Source File: Html5Webview.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private void init(Context context) { mContext = context; Activity mActivity = (Activity) mContext; mLayout = new FrameLayout(context); mBrowserFrameLayout = (FrameLayout) LayoutInflater.from(mActivity).inflate(R.layout.html5_webview_custom_screen, null); mContentView = (FrameLayout) mBrowserFrameLayout.findViewById(R.id.html5_webview_main_content); mCustomViewContainer = (FrameLayout) mBrowserFrameLayout.findViewById(R.id.html5_webview_fullscreen_custom_content); mLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS); // Configure the webview WebSettings s = getSettings(); s.setBuiltInZoomControls(true); s.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); s.setUseWideViewPort(true); s.setLoadWithOverviewMode(true); // s.setSavePassword(true); s.setSaveFormData(true); s.setJavaScriptEnabled(true); mWebChromeClient = new MyWebChromeClient(); setWebChromeClient(mWebChromeClient); setWebViewClient(new WebViewClient()); setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); // enable navigator.geolocation // s.setGeolocationEnabled(true); // s.setGeolocationDatabasePath("/data/data/org.itri.html5webview/databases/"); // enable Web Storage: localStorage, sessionStorage s.setDomStorageEnabled(true); mContentView.addView(this); }
Example 8
Source File: EntityActionViewUtils.java From commcare-android with Apache License 2.0 | 5 votes |
private static void setupActionImage(String imageURI, FrameLayout actionCardView, Context context) { if (imageURI != null) { ImageView icon = actionCardView.findViewById(R.id.icon); int iconDimension = (int)context.getResources().getDimension(R.dimen.action_icon_size); Bitmap b = MediaUtil.inflateDisplayImage(context, imageURI, iconDimension, iconDimension, true); if (b != null) { icon.setVisibility(View.VISIBLE); icon.setImageBitmap(b); } } }
Example 9
Source File: MainActivity.java From shinny-futures-android with GNU General Public License v3.0 | 5 votes |
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.search_quote: mMainActivityPresenter.setPreSubscribedQuotes(sDataManager.getRtnData().getIns_list()); Intent intent = new Intent(MainActivity.this, SearchActivity.class); int index = mMainActivityPresenter.getmBinding().vpContent.getCurrentItem(); if (index == 2) intent.putExtra(SOURCE_ACTIVITY, SOURCE_ACTIVITY_FUTURE_INFO); else intent.putExtra(SOURCE_ACTIVITY, SOURCE_ACTIVITY_MAIN); startActivityForResult(intent, MAIN_ACTIVITY_TO_SEARCH_ACTIVITY); return true; case android.R.id.home: Menu menu = mToolbar.getMenu(); if (menu == null || menu.size() == 0) return true; MenuItem menuItem = menu.findItem(R.id.right_navigation); FrameLayout rootView = (FrameLayout) menuItem.getActionView(); ImageView view = rootView.findViewById(R.id.view_menu); view.setImageResource(R.mipmap.ic_menu); menuItem.setTitle(MENU_TITLE_NAVIGATION); refreshCO(); getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setHomeButtonEnabled(false); if (ACCOUNT_DETAIL.equals(mTitle)) mMainActivityPresenter.switchToAccount(); else mMainActivityPresenter.switchToMarket(); return true; default: break; } return super.onOptionsItemSelected(item); }
Example 10
Source File: AlMessageSenderView.java From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License | 5 votes |
public void createView(Contact contact, Channel channel, final AlMessageViewEvents listener) { removeAllViews(); this.listener = listener; LayoutInflater inflater = (LayoutInflater) getContext().getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.al_message_sender_view, null); LinearLayout mainEditTextLayout = view.findViewById(R.id.main_edit_text_linear_layout); messageEditText = mainEditTextLayout.findViewById(R.id.conversation_message); attachmentButton = mainEditTextLayout.findViewById(R.id.attach_button); emoticonsButton = mainEditTextLayout.findViewById(R.id.emoticons_btn); emoticonsButton.setVisibility(GONE); messageEditText.setHint("Write a message..."); FrameLayout actionButtonLayout = view.findViewById(R.id.actionButtonLayout); sendMessageButton = actionButtonLayout.findViewById(R.id.conversation_send); audioRecordButton = actionButtonLayout.findViewById(R.id.record_button); audioRecordButton.setVisibility(GONE); sendMessageButton.setVisibility(VISIBLE); ((LinearLayout) view).removeAllViews(); publishTypingStatus(messageEditText, contact, channel); attachListeners(); addView(mainEditTextLayout); addView(actionButtonLayout); }
Example 11
Source File: GlassActionBarHelper.java From GlassActionBar with Apache License 2.0 | 5 votes |
public View createView(Context context) { int[] attrs = { android.R.attr.windowBackground }; // Need to get resource id of style pointed to from actionBarStyle TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(android.R.attr.windowBackground, outValue, true); TypedArray style = context.getTheme().obtainStyledAttributes(outValue.resourceId, attrs); windowBackground = style.getDrawable(0); style.recycle(); LayoutInflater inflater = LayoutInflater.from(context); frame = (FrameLayout) inflater.inflate(R.layout.gab__frame, null); content = inflater.inflate(contentLayout, (ViewGroup) frame, false); frame.addView(content, 0); frame.getViewTreeObserver().addOnGlobalLayoutListener(this); blurredOverlay = (ImageView) frame.findViewById(R.id.blurredOverlay); if (content instanceof NotifyingScrollView) { if (verbose) Log.v(TAG, "ScrollView content!"); scrollView = (NotifyingScrollView) content; scrollView.setOnScrollChangedListener(this); } else if (content instanceof ListView) { if (verbose) Log.v(TAG, "ListView content!"); listView = (ListView) content; listView.setAdapter(adapter); ListViewScrollObserver observer = new ListViewScrollObserver(listView); observer.setOnScrollUpAndDownListener(this); } actionBarHeight = getActionBarHeight(context); return frame; }
Example 12
Source File: ColorDemo.java From LaunchTime with GNU General Public License v3.0 | 4 votes |
public ColorDemo(Context context, AttributeSet attrs) { super(context, attrs); style = GlobState.getStyle(getContext()); body = (FrameLayout) LayoutInflater.from(getContext()).inflate(R.layout.color_demo, null); body.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); bg = body.findViewById(R.id.demo_bg); menu = body.findViewById(R.id.demo_cattabbg); iconarea = body.findViewById(R.id.demo_iconarea); cat1 = body.findViewById(R.id.demo_category_tab); catsel = body.findViewById(R.id.demo_category_tab_sel); icon1 = body.findViewById(R.id.demo_launcher); icon2 = body.findViewById(R.id.demo_launcher2); setIcons(); }
Example 13
Source File: MultiroomManager.java From onpc with GNU General Public License v3.0 | 4 votes |
static AlertDialog createDeviceSelectionDialog( @NonNull final MainActivity activity, @NonNull CharSequence title) { final State state = activity.getStateManager().getState(); final FrameLayout frameView = new FrameLayout(activity); activity.getLayoutInflater().inflate(R.layout.dialog_multiroom_layout, frameView); // Collect available devices final List<BroadcastResponseMsg> devices = new ArrayList<>(); for (BroadcastResponseMsg message : activity.getDeviceList().getDevices()) { if (message.getIdentifier().equals(activity.myDeviceId())) { devices.add(0, message); } else { devices.add(message); } } // Define this group ID final int myZone = state.getActiveZone() + 1; final int myGroupId = state.getMultiroomGroupId(); final Map<String, Boolean> attachedDevices = new HashMap<>(); // Create device list final LinearLayout deviceGroup = frameView.findViewById(R.id.device_group); Logging.info(activity, "Devices for group: " + myGroupId); for (BroadcastResponseMsg msg : devices) { final MultiroomDeviceItem view = createDeviceItem(activity, msg, state.multiroomLayout.get(msg.getIdentifier()), myZone, myGroupId); attachedDevices.put(msg.getIdentifier(), view.isChecked()); deviceGroup.addView(view); } // Define maximum group ID int _maxGroupId = 0; for (MultiroomDeviceInformationMsg di : state.multiroomLayout.values()) { for (MultiroomDeviceInformationMsg.Zone z : di.getZones()) { _maxGroupId = Math.max(_maxGroupId, z.getGroupid()); } } final int maxGroupId = _maxGroupId; Logging.info(activity, " Maximum group ID=" + maxGroupId); // Create dialog final Drawable icon = Utils.getDrawable(activity, R.drawable.cmd_multiroom_group); Utils.setDrawableColorAttr(activity, icon, android.R.attr.textColorSecondary); return new AlertDialog.Builder(activity) .setTitle(title) .setIcon(icon) .setCancelable(true) .setView(frameView) .setNegativeButton(R.string.action_cancel, (dialog1, which) -> dialog1.dismiss()) .setPositiveButton(R.string.action_ok, (dialog2, which) -> { int groupId = myGroupId; if (myGroupId == MultiroomDeviceInformationMsg.NO_GROUP) { groupId = maxGroupId + 1; } sendGroupUpdates(activity, deviceGroup, attachedDevices, myZone, groupId); dialog2.dismiss(); }).create(); }
Example 14
Source File: OverMenuView.java From OverlayMenu with Apache License 2.0 | 4 votes |
private void showMenuOverlay() { if (DEBUG) { Log.i(TAG, "showMenuOverlay"); } if (mMenuShown) { Log.w(TAG, "menu already shown"); return; } FrameLayout root = (FrameLayout) ((Activity) getContext()).getWindow().getDecorView(); int translationY = 0; int translationX = 0; if (mTargetViewId != 0) { View view = ((Activity) getContext()).findViewById(mTargetViewId); if (null != view) { Rect outRect = new Rect(); Rect outRootRect = new Rect(); root.getGlobalVisibleRect(outRootRect); view.getGlobalVisibleRect(outRect); final int[] point = new int[2]; view.getLocationOnScreen(point); translationY = -(outRootRect.height() / 2 - (outRect.height() / 2 + outRect.top)); translationX = -(outRootRect.width() / 2 - (outRect.width() / 2 + outRect.left)); if (DEBUG) { Log.v(TAG, "outRootRect: " + outRootRect); Log.v(TAG, "outRect: " + outRect); Log.v(TAG, "position: " + point[0] + "x" + point[1]); Log.v(TAG, "translationX: " + translationX); Log.v(TAG, "translationY: " + translationY); } } } final boolean entriesChanged = mEntriesChanged; if (entriesChanged) { mOverMenuLayout.setEntries(mEntries); mEntriesChanged = false; } if (root.findViewById(R.id.OverMenuId) == null) { root.addView(mOverMenuLayout); mOverMenuLayout.setTranslationY(translationY); mOverMenuLayout.setTranslationX(translationX); } else if (!entriesChanged) { mOverMenuLayout.updatePosition(); } if (null != mInAnimation) { OverMenuLayout.showView(mOverMenuLayout, mInAnimation); } else { mOverMenuLayout.setVisibility(View.VISIBLE); } if (null != menuVisibilityChangeListener) { menuVisibilityChangeListener.onVisibilityChanged(this, true); } mMenuShown = true; }
Example 15
Source File: PopupManager.java From onpc with GNU General Public License v3.0 | 4 votes |
void showTrackMenuDialog(@NonNull final MainActivity activity, @NonNull final State state) { if (trackMenuDialog == null) { Logging.info(this, "create track menu dialog"); final FrameLayout frameView = new FrameLayout(activity); final Drawable icon = Utils.getDrawable(activity, R.drawable.cmd_track_menu); Utils.setDrawableColorAttr(activity, icon, android.R.attr.textColorSecondary); trackMenuDialog = new AlertDialog.Builder(activity) .setTitle(R.string.cmd_track_menu) .setIcon(icon) .setCancelable(false) .setView(frameView) .setNegativeButton(activity.getResources().getString(R.string.action_cancel), (d, which) -> { if (activity.isConnected()) { activity.getStateManager().sendMessage(StateManager.RETURN_MSG); } d.dismiss(); }) .create(); trackMenuDialog.getLayoutInflater().inflate(R.layout.dialog_track_menu, frameView); trackMenuDialog.setOnDismissListener((d) -> { Logging.info(this, "close track menu dialog"); trackMenuDialog = null; trackMenuGroup = null; }); trackMenuGroup = frameView.findViewById(R.id.track_menu_layout); updateTrackMenuGroup(activity, state, trackMenuGroup); trackMenuDialog.show(); Utils.fixIconColor(trackMenuDialog, android.R.attr.textColorSecondary); } else if (trackMenuGroup != null) { Logging.info(this, "update track menu dialog"); updateTrackMenuGroup(activity, state, trackMenuGroup); } }
Example 16
Source File: EntityActionViewUtils.java From commcare-android with Apache License 2.0 | 4 votes |
private static void setupActionClickListener(FrameLayout actionCardView, final Action action, final CommCareActivity commCareActivity) { CardView cardView = actionCardView.findViewById(R.id.card_body); cardView.setOnClickListener(v -> EntitySelectActivity.triggerDetailAction(action, commCareActivity)); }
Example 17
Source File: UserLogAdapter.java From 600SeriesAndroidUploader with MIT License | 4 votes |
public ViewHolder(FrameLayout container) { super(container); this.textView = container.findViewById(R.id.log_textview); }
Example 18
Source File: FolioPageFragment.java From ankihelper with GNU General Public License v3.0 | 4 votes |
private void initWebView() { FrameLayout webViewLayout = mRootView.findViewById(R.id.webViewLayout); mWebview = webViewLayout.findViewById(R.id.folioWebView); mWebview.setParentFragment(this); webViewPager = webViewLayout.findViewById(R.id.webViewPager); if (getActivity() instanceof FolioActivityCallback) mWebview.setFolioActivityCallback((FolioActivityCallback) getActivity()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) WebView.setWebContentsDebuggingEnabled(true); setupScrollBar(); mWebview.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { int height = (int) Math.floor(mWebview.getContentHeight() * mWebview.getScale()); int webViewHeight = mWebview.getMeasuredHeight(); mScrollSeekbar.setMaximum(height - webViewHeight); } }); mWebview.getSettings().setJavaScriptEnabled(true); mWebview.setVerticalScrollBarEnabled(false); mWebview.getSettings().setAllowFileAccess(true); mWebview.setHorizontalScrollBarEnabled(false); mWebview.addJavascriptInterface(this, "Highlight"); mWebview.addJavascriptInterface(this, "FolioPageFragment"); mWebview.addJavascriptInterface(webViewPager, "WebViewPager"); mWebview.addJavascriptInterface(loadingView, "LoadingView"); mWebview.addJavascriptInterface(mWebview, "FolioWebView"); mWebview.setScrollListener(new FolioWebView.ScrollListener() { @Override public void onScrollChange(int percent) { mScrollSeekbar.setProgressAndThumb(percent); updatePagesLeftText(percent); } }); mWebview.setWebViewClient(webViewClient); mWebview.setWebChromeClient(webChromeClient); mWebview.getSettings().setDefaultTextEncodingName("utf-8"); new HtmlTask(this).execute(getWebviewUrl()); }
Example 19
Source File: ArticleCollectAdapter.java From tysq-android with GNU General Public License v3.0 | 4 votes |
@Override public void initItem(FrameLayout frameLayout) { tvTitle = frameLayout.findViewById(R.id.tv_title); tvTime = frameLayout.findViewById(R.id.tv_time); tvDelete = frameLayout.findViewById(R.id.tv_delete); }
Example 20
Source File: YGuider.java From YGuider with Apache License 2.0 | 3 votes |
private void init(){ //通过DecorView获取 FrameLayout decorView = (FrameLayout)mActivity.getWindow().getDecorView(); mContentView = (FrameLayout) decorView.findViewById(mContentId); mScanRegions = new ArrayList<>(); mScanTargets = new ArrayList<>(); defaultJumpText = mActivity.getResources().getString(R.string.text_jump); defaultNextText = mActivity.getResources().getString(R.string.text_next); buildMask(); }