android-framelayout

Take screenshot

扶醉桌前 提交于 2019-12-12 09:15:00
问题 I am working on an app, which uses the frontcamera to simulate a mirror for the person using the app. I have implemented a "Head-up-Display" which is in front of the cameraview and displays some stuff. This works fine at the moment. Now I'd like to implement a method to take a screenshot every 5s. But how to take a screenshot? I tried one possible solution, but this just takes a screenshot of the HuD without the mirror, because I have to pass a view (v1) to this method: // create bitmap

No view found for id 0x7f0900ad when performing fragment transaction

帅比萌擦擦* 提交于 2019-12-12 06:15:59
问题 When I try to start a fragment from an activity class I keep getting a No view found for id 0x7f0900ad frame_container2 error. The code then crashes after progress dialog shows up and moves to the fragment I'm trying to starting. When it crashes it gives me an error like this: 05-23 12:02:32.271: E/FragmentManager(4295): No view found for id 0x7f0900ad (com.fitserv.androidapp:id/frame_container2) for fragment UserWorkoutPlanFragment{4165dbc8 #0 id=0x7f0900ad} 05-23 12:02:32.271: E

Android Image is seen/not seen when orientation is changed

邮差的信 提交于 2019-12-12 03:05:11
问题 I'm having some problems with ScrollView and an ImageView . What I want is: I have an ImageView set always at the top of the screen. Then, I have an ScrollView where go all elements of the View , and inside it I have another ImageView which it is set at the bottom of the screen when previous elements don't fill screen (usually Big Screens), and it is set at the bottom of the ScrollView when exists Scroll. It is ok for some other Activities I have, but I have some problems in one Activity that

How to use a layout's background as a bitmap to convert X and Y to RGB values

痴心易碎 提交于 2019-12-12 01:11:51
问题 I have a layout with the color palette as the background. Within the layout I added a smaller image as a thumb (which is resized using @dimen to make it smaller, really small, like a crosshair) which should move around as the user drag around the layout above: How do I use the layout's background as a bitmap so I can use the following code: f = (FrameLayout) findViewById(R.id.fl); f.setOnTouchListener(flt); iv = (ImageView) findViewById(R.id.iv); View.OnTouchListener flt = new View

Top and bottom images overlay on imageview Issue

為{幸葍}努か 提交于 2019-12-11 18:34:28
问题 I want to make my layout like this as per below picture. this image i am able to see in iphone devices. Here i used frame layout to achieve make overlays of top and bottom image bar on imageview but after using frame layout i can only able to see top imagebar overlay not bottom image bar? why its happens? Forgot about the content of top and bottom iamge bar.. i am focusing to achieve this functionality. Please make me correct if i am wrong in my code. xml file code : <FrameLayout xmlns

How to keep X and Y within layout's view ?

邮差的信 提交于 2019-12-11 18:14:44
问题 I have a FrameLayout which has a thumb image which the user can drag around. The thumb width is 10dp and height is 10dp. f = (FrameLayout) findViewById(R.id.fl); f.setOnTouchListener(flt); f.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED); width = f.getMeasuredWidth(); height = f.getMeasuredHeight(); @Override public boolean onTouch(View v, MotionEvent event) { float x = event.getX(); float y = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if (x<0) { x = x

With FrameLayout as root layout, add view on top of another one, with offset of X,Y

雨燕双飞 提交于 2019-12-11 16:37:11
问题 I'd like to place a view on top of an existing view. The view I'm targeting is inside a LinearLayout, which resides in a FrameLayout. I'm thinking there's a way to do this with RelativeLayout because I already have it partially working. I'd like to align the new view to the bottom-left or top-left (as the origin) and then offset X and Y to some precise value that I specify. How can this be achieved? Here's the idea: public static void placeTextRelativeToBottomLeftOfViewAtXY(final FrameLayout

How to implement RecyclerView on a FrameLayout?

帅比萌擦擦* 提交于 2019-12-11 16:27:16
问题 I am learning RecyclerView and stuck in activity. I have a bottomNavigationView and a frame layout above the bottomNavigationView I want to show a RecyclerView on that FrameLayout. How can I do that? There is no error in my program and i don't know why its not showing the RecyclerView. This is the xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width

ScrollView overflowing its FrameLayout parent

随声附和 提交于 2019-12-11 13:46:26
问题 I have a complicated LinearLayout (vertical) with a FrameLayout above some other stuff (a TextView and an EditText box). The FrameLayout contains two things: a) a map and b) a ScrollView containing a semi-transparent LinearLayout that 'overlays' the map. The ScrollView is initially GONE , but I render it visible programmatically. I also programmatically add Views into the LinearLayout embedded in the ScrollView . The FrameLayout dimensions are set using onMeasure() so that the height and

FrameLayout child view not updating correctly on resize

混江龙づ霸主 提交于 2019-12-11 11:52:30
问题 I have an Android application in which the root view is a FrameLayout which on rotation is kept and resized rather than recreated. Among the children of the FrameView is one custom View (the main view) that takes up the entire space, and another custom View which I want to display as a narrow band along the bottom edge (in portrait mode) or the right edge (in landscape mode). To this end I run the following code from the main view's onSizeChanged() method: boolean isBandShowing = ...; //