android-layout

landscape view and portrait view of webview in android

前提是你 提交于 2020-04-30 07:46:06
问题 im working on an android app and im dealing with a webview inside of my android app. i have two layout mainly the activitymain.xml found in layout folder and another layout named activitymain.xml found in layout-land folder and im loading these two from 1 java file but i need these two to load two different webview one for landscape and one for portrait.my question is is it possible to directly put the url/file path of my webview in xml so that when the user change orientation and the

How to have a properly Dark and Light Theme with Splash Screen

試著忘記壹切 提交于 2020-04-27 10:21:00
问题 I have read that there is a way to have a values-night and a values folder. But how to change from values to values-night before starting ,because of my splash screen. I know that there must be a way to have a dark and light themed splash screen ,because of WhatsApp. How to change to values-night before Splash Screen is shown? 回答1: Try below dark mode code which I am use. Step - 1 First of create night folder into your resource file like below image(i.e. values-night) Step - 2 Create styles

How to have a properly Dark and Light Theme with Splash Screen

我与影子孤独终老i 提交于 2020-04-27 10:17:43
问题 I have read that there is a way to have a values-night and a values folder. But how to change from values to values-night before starting ,because of my splash screen. I know that there must be a way to have a dark and light themed splash screen ,because of WhatsApp. How to change to values-night before Splash Screen is shown? 回答1: Try below dark mode code which I am use. Step - 1 First of create night folder into your resource file like below image(i.e. values-night) Step - 2 Create styles

How to have a properly Dark and Light Theme with Splash Screen

▼魔方 西西 提交于 2020-04-27 10:14:08
问题 I have read that there is a way to have a values-night and a values folder. But how to change from values to values-night before starting ,because of my splash screen. I know that there must be a way to have a dark and light themed splash screen ,because of WhatsApp. How to change to values-night before Splash Screen is shown? 回答1: Try below dark mode code which I am use. Step - 1 First of create night folder into your resource file like below image(i.e. values-night) Step - 2 Create styles

Problem copying AbsoluteLayout - com.android.internal.R cannot be resolved

别说谁变了你拦得住时间么 提交于 2020-04-20 16:57:51
问题 I came to a problem that the only solutions is using a AbsoluteLayout (Just to show something at specific positions). I'm trying to copy the AbsoluteLayout class to avoid it being removed on future releases and my app stop working. I'm copying from here: http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/core/java/android/widget/AbsoluteLayout.java&exact_package=android&q=AbsoluteLayout&type=cs But getting this code, first, I changed all the mPadding(Direction) to getPadding

Customization Bottom Sheet Dialog's View

血红的双手。 提交于 2020-04-18 12:50:12
问题 I just want to get the bottom sheet dialog like below_: margin from the system window. How can I get like this? 回答1: You can create Bottom Sheet Dialog Fragment in following way: First create the xml file as below named as fragment_bottomsheet <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/transparent" android

add an actionbar for each fragment

吃可爱长大的小学妹 提交于 2020-04-16 02:41:25
问题 Suppose I have 4 fragments that I put in mainActivity, I want to create different actionbar different in each frgament. When I press fragment 1 then the actionBar appears fragment 1, when I press the two fragment that appears actoinbar belonging to fragment 2 01-02 20:12:33.700 15035-15035/src.go_letskerja E/AndroidRuntime: FATAL EXCEPTION: main Process: src.go_letskerja, PID: 15035 java.lang.NullPointerException at src.go_letskerja.Fragment.OtherFragment.onCreateView(OtherFragment.java:26)

TextView visibility change notification

十年热恋 提交于 2020-04-11 12:44:26
问题 I need to detect when a TextView is made visible and when its made invisible. Is there any way to do this in Android? I've to make some processing when a TextView in my application changes visibility. Actually, it's visibility is being updated at a number of places and I'm looking to avoid calls at all of these places. 回答1: I don't know if this will answer your question, but if you want to listen to textview visibility changes, I suggest customizing TextView and implement your own listener

How to display a date like Whatsapp on scrolling ListView

*爱你&永不变心* 提交于 2020-04-11 11:36:10
问题 How can I show dates in an app when I scroll the ListView like in WhatsApp? See the below image for clarity: When I scroll the ListView, the date gets displayed over the list. If you still did not understand my question please open your WhatsApp, go to any group & start scrolling: you will see the date getting displayed for older texts. 回答1: To show date like this screenshot, you can use val firstVisiblePosition = layoutManager.findFirstVisibleItemPosition() if (getDateFromFirebaseTime

Repeatedly altering visibility of a child view and measuring parent view causes wrong results in measured size and display

做~自己de王妃 提交于 2020-04-10 18:10:53
问题 Why is it that when you repeatedly alter the visibility of a child view that is contained within a parent view and measure the parent view, Android returns wrong results? I created a simple test: an XML file with only one ConstraintLayout and two TextViews. I will repeatedly alter the visibility of the last TextView to GONE and VISIBLE. Each time I alter the visibility of the TextView, I will measure the ConstraintLayout's width and height. To alter the visibility of the TextView, I set a