android-framelayout

Android: unable to click the bottom TextView after translate animation within a FrameLayout

烈酒焚心 提交于 2019-12-11 09:08:03
问题 I have a FrameLayout in which I have placed two identical TextViews. I want to be able to translate the first view to the left (which I have done and is working like a charm). However I want to be able to click the TextView underneath it to perform an action. When I try to click the bottom TextView, the top TextView gets clicked again instead. I have a feeling this is because the way animations are rendered and the change in actual x,y position doesn't take effect. This is what I have so far.

How to set Width and Height of FrameLayout dynamically android?

只愿长相守 提交于 2019-12-11 08:18:10
问题 I am trying to set the width and height of 2 frame layouts which are the containers for 2 fragments, both being children of a Linear Layout. However whenever I set width and height of the layout with frameLayout.setLayoutParams(new FrameLayout.LayoutParams(100,100); it is resulting in a class cast Exception java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams 回答1: use this method ... .setLayoutParams(new LinearLayout

What is android.widget.FrameLayout

坚强是说给别人听的谎言 提交于 2019-12-11 05:53:41
问题 I have a simple App, Layout XML: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <WebView android:id="@+id/webview" android:layout_width="200dp" android:layout_height="200dp" /> </RelativeLayout> When I use following code: WebView webview = (WebView)findViewById(R.id.webview); webview.getRootView().findViewById(android.R.id.content); webview

FrameLayout: is it possible to put child layout off-screen?

依然范特西╮ 提交于 2019-12-11 05:37:04
问题 is it possible to have structure like the one below. And have LinearLayout that is at front to be off screen: <FrameLayout> <LinearLayout> .. Back Layout </LinearLayout> <LinearLayout> .. Front layout </LinearLayout> </FrameLayout> Here is the image. What I have tried: I have tried setting android:layout_marginLeft="-300dp" for LinearLayout A (front), but as soon as I test it on my phone the A layout is back inside of visible area. I have also tried pushing the A layout off the screen with

Make LinearLayout in FrameLayout opaque

半腔热情 提交于 2019-12-11 02:17:19
问题 I cannot find a way how to make linearLayout opaque. It's always transparent no matter what I do. The layout looks like this: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <LinearLayout android:orientation="vertical" android:id="@+id/error_panel" android:layout_width="match_parent" android:background="@color/gray_background_dark" android:layout_height="wrap_content"> <TextView android:id="@+id

media player does not load when activity is recreated on orientation change

大兔子大兔子 提交于 2019-12-10 16:54:37
问题 I am new to play a video in video player using surface view now i want to save instance state of media player when orientation change when view reloaded or recreated then old media player state start at old position not to load on original means at zero position i set in manifest like screen orientation but that time oncreate not called i want to call also oncreate method when screen orientation change means to say i want to reload a new activity when orientation change and also save media

How to android Z order?

∥☆過路亽.° 提交于 2019-12-10 15:55:36
问题 In my app, I want to draw on top of the background image. I have the following xml: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg2" > <com.myapp.drawings.DrawingSurface android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/drawingSurface" /> <LinearLayout

Android - Frame layout height not matching with coordinator layout

蓝咒 提交于 2019-12-09 09:15:38
问题 I have a problem with my FrameLayout (Container in Drawer Layout). The height of the FrameLayout exceeds the screen height (below the android default menu buttons at bottom). <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" android:layout_width="fill_parent" android:layout_height="fill_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/navContainer" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7

In Android, how can I set the order of children in a FrameLayout as they're added?

喜夏-厌秋 提交于 2019-12-06 12:11:19
I have a FrameLayout that will hold a set of ImageViews. I'm using FrameLayout because I actually want them to overlap. However, as I add items to the Layout I don't want them to just stack. I actually need to order them. The image are pulled form storage and I have their correct order stored in my database so: Image1 - layerNumber: 3 Image2 - layerNumber: 12 Image3 - layerNumber: 1 Image4 - layerNumber: 34 Image5 - layerNumber: 6 Image6 - layerNumber: 30 When I place them in the FrameLayout I'll need to them to in the Layout in the layerNumber order. Also, I'll be adding one or more at a time

Rotate Frame layout which contains dynamic buttons

放肆的年华 提交于 2019-12-05 20:09:33
问题 I have a Framelayout which add four imageview at runtime as well in center it contains main image with which user can perform different action but i face the problem with rotate layout view currently on touch of rotate button i'm doing this public void setRotateListener() { mRotateImage.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { float x = event.getX(0); float y = event.getY(0); float theta = getTheta(x, y); switch (event.getAction(