material-design

Typing in TextField doesn't make label float

人盡茶涼 提交于 2020-01-25 06:08:25
问题 I have made a form with Material Design components. My TextField floating labels float when AutoFill fills the inputs, but not when a user types in them. function fillFields() { $("#passwordTextField").val("test"); $("#usernameTextField").val("test"); } p.highlight-red-on-error { transition: color 180ms cubic-bezier(0.4, 0, 0.2, 1); } div.mdc-text-field--invalid~p.highlight-red-on-error { color: #b00020; } <head> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256

Can I dynamically change the page layout in order to accommodate the window size?

女生的网名这么多〃 提交于 2020-01-25 04:17:29
问题 I have my website like this, with rows and cols (col-xs, col-sm, ... for the various media sizes): However when the browser gets reduced horizontally (or because the screen is narrow) the result is like this and poor kitty gets crushed: Is there a way with bootstrap to make the layout change radically when the window gets too reduced that the previous layout makes no sense anymore? Something that would turn the first layout into this: Thanks! 回答1: Whether this can be incorporated into

Apply style to Alert Dialogs

泄露秘密 提交于 2020-01-24 20:20:08
问题 I decided to try material alert dialogs on android. The problem I am having is when I try to apply some styles. Checking the docs, I found this: <item name="materialAlertDialogTheme">@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog</item> So I decided to try this: <style name="BaseTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <item name="materialAlertDialogTheme">@style/Theme.App.MaterialDialogAlert</item> </style> <style name="Theme.App.MaterialDialogAlert" parent=

How i can set Half Expanded state for my BottomSheet

眉间皱痕 提交于 2020-01-23 07:22:46
问题 I have layout with bottom sheet. <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.material.appbar.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay

How i can set Half Expanded state for my BottomSheet

孤街醉人 提交于 2020-01-23 07:22:28
问题 I have layout with bottom sheet. <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.material.appbar.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay

CoordinatorLayout, FAB and container layout conflict

大城市里の小女人 提交于 2020-01-23 02:05:47
问题 I have a main activity with a drawer that have a container layout where I replace each fragment with FragmentManager . I want to add a FAB to one of my child fragments that hide/show on scroll but Im not sure what Im doing wrong and get: Layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout

Theme not applied using appcompat library on some Android 4.X devices

醉酒当歌 提交于 2020-01-22 17:57:12
问题 After updating the appcompat library to the latest version (v21) to apply the material design, my custom theme isn't used anymore on Android 4.0.X devices unless I explicitly declare it in the XML. I have tested the theme on Android 2.3.X and 5.0.0 devices and it works on those devices. But it's not working on my HTC One S with Android 4.0.3. What do I need to do to fix this? My themes.xml <style name="Theme.Custom" parent="@style/Theme.AppCompat.Light"> <item name="android:editTextStyle">

Modal dialog with fixed header and footer and scrollable content

被刻印的时光 ゝ 提交于 2020-01-22 15:04:31
问题 I'm trying to create a modal dialog that has an fixed header and footer and that the content (in this case list of users) inside the modal dialog is scrollable... My best attempt so far gave me the result on the image: I assume that after seeing the image I dont have to describe what the problem is... and I also assume that you will know what the solution has to look like... :) But just to be sure I'll write it anyway... The modal dialog needs to have a fixed header (Area where the title

Modal dialog with fixed header and footer and scrollable content

不羁的心 提交于 2020-01-22 15:04:10
问题 I'm trying to create a modal dialog that has an fixed header and footer and that the content (in this case list of users) inside the modal dialog is scrollable... My best attempt so far gave me the result on the image: I assume that after seeing the image I dont have to describe what the problem is... and I also assume that you will know what the solution has to look like... :) But just to be sure I'll write it anyway... The modal dialog needs to have a fixed header (Area where the title

?android:attr/selectableItemBackground not visible enough on a dark background

狂风中的少年 提交于 2020-01-22 07:57:49
问题 On Android Lollipop, I'm using: android:background="?android:attr/selectableItemBackground" to have the material animated feedback when I click on a button. It works well when I have a button contained in a white/light layout, like a CardView for example. But when I want to use the same thing on a dark background, we barely see the effect, it is not visible enough. Does someone have an idea? Thank you 回答1: On API 21+ you can set android:theme="@android:style/ThemeOverlay.Material.Dark" on a