android-framelayout

Overlay image over another android

社会主义新天地 提交于 2019-12-03 03:37:34
I have photo album which shows the image as rounded with white border. Image will be adding dynamically. I tried frame layout but it it not working for me. My try : Adding dynamic image over already existing round shape image.. <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/image" android:layout_width="60dip" android:layout_height="60dip" android:adjustViewBounds="true" android:scaleType="centerCrop" /> <ImageView android:id="@+id/imagef" android:layout_width="100dp" android:layout_height="100dp" android:background="@drawable/ph

How to create an overlay that blocks touch events to UI below it?

南楼画角 提交于 2019-12-03 02:47:32
I used a layer of framelayout with a semi-translucent background to create an overlay. But this overlay doesn't block touch events to interact with the views below it. How should create an overlay that blocks all touch events? Following code will add overlay on top of everything : View v1 = new View(this); WindowManager.LayoutParams params = new WindowManager.LayoutParams( 1000, 50, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, PixelFormat.OPAQUE); params.gravity = Gravity.BOTTOM; WindowManager wm

DrawerLayout not functioning and blocks not related widgets

一世执手 提交于 2019-12-02 14:43:14
问题 I havd an Activity which has a TextView and i wanted to add a navigation drawer to that Activity . So I changed my XML and implemented DrawerLayout . After implementing the DrawerLayout it simply does not functioning(meaning it don't open) and the FrameLayout implemented within the DrawerLayout blocks the not related to the DrawerLayout TextView text. drawer.xml : <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res

Called From Wrong Thread Exception

戏子无情 提交于 2019-12-02 09:32:04
I am getting an exception here when I try to bring another view to the front. It happens in the last method of my BoardView class where it says if(lives == 0). Can anybody see where I should be calling this bringToFront method from?? public class BoardView extends SurfaceView implements SurfaceHolder.Callback{ Context mContext; // thread initialization private BoardThread thread; Thread timer; // box variables Bitmap box = (BitmapFactory.decodeResource (getResources(), R.drawable.box)); private int box_x = 140; private int box_y = 378; private int boxWidth = box.getWidth(); private int

Inflating view above RecyclerView in FrameLayout

不打扰是莪最后的温柔 提交于 2019-12-02 05:16:58
问题 On a button click, I am attempting to inflate an EditText above a RecyclerView . But instead of the EditText being added to the top of the layout, thus pushing down the RecyclerView, it is simply being placed on top of the RecyclerView, covering it like so: You can see that "New Text" is covering the first item of the RecyclerView. How can I get it to inflate above the RecyclerView, and have the RecyclerView pushed down, accommodating the newly added EditText? Here is the XML of my

How to add two fragments together in a frameLayout in runtime

一个人想着一个人 提交于 2019-12-02 00:54:29
I am developing an andorid application with navigation drawer and I have a layout for contentview like this: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- As the main content view, the view below consumes the entire space available using match_parent in both dimensions. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height

Add a Textview to a FrameLayout in a determined position

不羁的心 提交于 2019-12-01 04:00:23
I'm trying to add a textView to a frameLayout . The TextView has wrap_content properties, so it grows when the text grows. I'm adding it to a FrameLayout with this function: ((FrameLayout) findViewById(R.id.mainLayout)).addView(mEditText); This is the xml of the frame layout: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainLayout" android:layout_width="wrap_content" android:layout_height="wrap_content"> </FrameLayout> The textView always appears in the top left corner of the screen. I'd like to position it in the middle, or top middle. How can this

Add a Textview to a FrameLayout in a determined position

谁都会走 提交于 2019-12-01 01:48:57
问题 I'm trying to add a textView to a frameLayout . The TextView has wrap_content properties, so it grows when the text grows. I'm adding it to a FrameLayout with this function: ((FrameLayout) findViewById(R.id.mainLayout)).addView(mEditText); This is the xml of the frame layout: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainLayout" android:layout_width="wrap_content" android:layout_height="wrap_content"> </FrameLayout> The textView always appears in

How can I align an element to the right in the FrameLayout?

[亡魂溺海] 提交于 2019-11-30 17:12:41
I have a FrameLayout which contains 2 views , the second is something like a Close Button (X) and i want to position it on the right. I've tried layout_gravity = " right ", but that didn't work. This is my layout xml : <FrameLayout android:layout_width="320dp" android:layout_height="wrap_content" android:id="@+id/layoutSmallImg"> <ImageView android:id="@+id/bigImage" android:layout_width="320dp" android:layout_height="wrap_content"/> <ImageView android:id="@+id/bigImage" android:layout_width="320dp" android:layout_height="wrap_content"/> <ImageButton android:id="@+id/closebutton" android

How can I align an element to the right in the FrameLayout?

匆匆过客 提交于 2019-11-30 16:29:18
问题 I have a FrameLayout which contains 2 views , the second is something like a Close Button (X) and i want to position it on the right. I've tried layout_gravity = " right ", but that didn't work. This is my layout xml : <FrameLayout android:layout_width="320dp" android:layout_height="wrap_content" android:id="@+id/layoutSmallImg"> <ImageView android:id="@+id/bigImage" android:layout_width="320dp" android:layout_height="wrap_content"/> <ImageView android:id="@+id/bigImage" android:layout_width=