android-framelayout

Application crash on some devices with android.support.v7.widget.ContentFrameLayout.setDecorPadding

随声附和 提交于 2021-02-07 06:18:06
问题 Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackage/com.mypackage.activities.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.ContentFrameLayout.setDecorPadding(int, int, int, int)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2721) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2782) at android.app

RecyclerView flows over the screen

断了今生、忘了曾经 提交于 2020-06-17 09:37:48
问题 I have a fragment that replaces FrameLayout. In this fragment, if I had only RecyclerView, I could set its height to match_parent and everything could work well. However, if I have multiple elements that need to be over the top of RecyclerView, the RecyclerView cannot be fit into the screen. Code for the first scenario: <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools=

Does BadgeDrawable not work for views within a FrameLayout such as buttons, images, textviews etc.?

我们两清 提交于 2020-03-24 11:10:52
问题 I have this function in my main activity which doesn't display a badge: private fun setFindShiftBadge(state: HomeState) { val findShiftsBadge = BadgeDrawable.create(this) home_framelayout.foreground = findShiftsBadge findShiftsBadge.badgeGravity = BadgeDrawable.TOP_END findShiftsBadge.backgroundColor = resources.getColor(R.color.colorWhite) findShiftsBadge.badgeTextColor = resources.getColor(R.color.colorPrimary) findShiftsBadge.number = state.availableShifts.size } In the same activity, I

Handle Fragment duplication on Screen Rotate (with sample code)

假装没事ソ 提交于 2020-01-22 09:52:11
问题 There are some similar answers, but not to this situation. My situation is simple. I have an Activity with two different layouts, one in Portrait, another in Landscape. In Portrait , i use <FrameLayout> and add Fragment into it dynamically . In Landscape , i use <fragment> so the Fragment is static . (in fact this doesn't matter) It first starts in Portrait , then i added the Fragment by simply: ListFrag listFrag = new ListFrag(); getSupportFragmentManager().beginTransaction() .replace(R.id

How to put up or down a view programatically?

时光怂恿深爱的人放手 提交于 2020-01-16 18:33:32
问题 I have a xml that the basic "skeleton" is <RelativeLayout> <FrameLayout> <RelativeLayout> <TextView> </TextView> <TextView> </TextView> </RelativeLayout> <DrawView> //The view that changes 1 </DrawVIew> <EditText> //The view that changes 2 </EditText> </FrameLayout> <RelativeLayout> </RelativeLayout> </RelativeLayout> What I want is that using code the DrawView goes up or down, so sometimes you can use the DrawView and in other moments you can use the EditText, but ever the two views are

implement Globe-Weis File Folder in android

前提是你 提交于 2020-01-16 01:19:29
问题 i want to implement Globe-Weis File Folder like picture below which by clicking on green button it scrolling smoothly up and by clicking on the green button again ,the folder page scrolling down smoothly. what i try so far was putting three scrollView in a frameLayout , and to open and close it if (!underIsOpen) { ObjectAnimator .ofInt(sv_Under, "scrollY", findViewById(R.id.ll_under_botton).getTop()) .setDuration(1000).start(); underIsOpen = true; } else { ObjectAnimator .ofInt(sv_Under,

center Crop Image In proper size to set on ImageView

荒凉一梦 提交于 2020-01-15 18:39:05
问题 I am using camera API to take picture i have to open camera in different sizes according to my Image view size. I am following the sample project which we get inside Android sdk/sample/adroid-18 at the name "ApiDemo" the thing i have changed is not set camera on setcontentview. I have set the camera on Frame Layout. at first my camera preview was starched so i got the camera OptimalPreviewSize and make FrameLayout parameter width and height as wrap-content.Now the camera preview is smaller

center Crop Image In proper size to set on ImageView

Deadly 提交于 2020-01-15 18:35:03
问题 I am using camera API to take picture i have to open camera in different sizes according to my Image view size. I am following the sample project which we get inside Android sdk/sample/adroid-18 at the name "ApiDemo" the thing i have changed is not set camera on setcontentview. I have set the camera on Frame Layout. at first my camera preview was starched so i got the camera OptimalPreviewSize and make FrameLayout parameter width and height as wrap-content.Now the camera preview is smaller

Bitmap created from FrameLayout is black

纵然是瞬间 提交于 2020-01-15 10:36:09
问题 I am trying to create a bitmap for share intent.Bitmap is created( I hope because it is not null which it was when tried out buildDrawingCache() solution) but when it is shared it is null.I have looked at other SO answers also but none of them works. In my code you can see I have tried other solutions also but created bitmap is null there.Here at least the bitmap is created but it's black. My image is 500px X 500px image by the way if it matters. share_image.xml <?xml version="1.0" encoding=

how to set image inside framelayout

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 09:58:48
问题 I want to set image inside the FrameLayout but is overlapping the framelayout's background 回答1: This is sample example, https://snag.gy/IrawbT.jpg item last put on the stack will be drawn on top of the items below it. This layout makes it very easy to draw on top of other layouts, especially for tasks such as button placement. To arrange the children inside of a FrameLayout use the android:layout_gravity attribute along with whatever android:padding and android:margin you need. <FrameLayout