android-design-library

Programmatically adding a layout + children

社会主义新天地 提交于 2021-01-28 06:31:58
问题 I'm currently learning the basics of Android programming. I'm able to create a static app with one page and a few buttons. The next step is learn to dynamically create apps, like i'm used to in webapplications. What i'm trying to do is create a simple facebook-like app with some timeline objects, with some text, a like button and the date it was placed. There is a simple NodeJS server which responds to a http GET request with a JSON file. Which is parsed and for each object in the array there

Create Facebook Live Reactions Animation Overlay

本小妞迷上赌 提交于 2021-01-27 05:55:55
问题 I'm currently working in a messaging application, where I want to show new user as animated flying icon like facebook live floating reactions. Can anybody enlighten which process I should follow or any helpful library link please? I've already tried browsing and checked few library links like this1 and this2 but these are not something similar to facebook live reaction packs. 回答1: I have achieved this by modifying an old code So here is my solution. You can change the direction and number of

How can I add a shadow to bottom sheet view?

▼魔方 西西 提交于 2020-12-27 08:24:25
问题 As of now, with the official bottom sheet component from the Android design library implemented the top edge doesn't show a shadow. But for what I've seen in various mockups and in the Material Design specs, the bottom sheet include a discrete shadow of some sort. I think the shadow would help distant the bottom sheet from the main layout, especially if there's a peek value set and/or the bottom sheet is always visible. Otherwise it just will blend together with the main layout and its items.

How can I add a shadow to bottom sheet view?

让人想犯罪 __ 提交于 2020-12-27 08:20:08
问题 As of now, with the official bottom sheet component from the Android design library implemented the top edge doesn't show a shadow. But for what I've seen in various mockups and in the Material Design specs, the bottom sheet include a discrete shadow of some sort. I think the shadow would help distant the bottom sheet from the main layout, especially if there's a peek value set and/or the bottom sheet is always visible. Otherwise it just will blend together with the main layout and its items.

Snackbar stack will always show only the last snackbar

戏子无情 提交于 2020-06-09 05:22:47
问题 The Snackbar.make(...).show() will only show the last snackbar unlike toast the other snackbars are gone. for(int i = 1;i < 11;i++) { Snackbar.make(..., "number: " + i, Snackbar.LENGTH_SHORT).show(); } Sometimes when the snackbar should show after network task and one should show before network task, the seconds snackbar is never shown. Im using a coordinatorlayout. 回答1: Please refer the Android components docs: Snackbars automatically time out from the screen. For usability reasons,

How to change color in Material Components PROGRAMMATICALLY on Android?

浪尽此生 提交于 2020-03-03 09:08:10
问题 I'm looking for a solution to change the color of some Android Material Components layout objects. How can I change the color of text or borders in a Material Button programmatically? All functions like MaterialButton.setTexColor() do not work. Same thing for the StrokeColor. The change must be made logically, directly from code. No XML styles, colors must be able to change in live, based on values read from a database. Things like these don't work : //renewSetDate is a Material Button Object

How to change color in Material Components PROGRAMMATICALLY on Android?

て烟熏妆下的殇ゞ 提交于 2020-03-03 09:06:26
问题 I'm looking for a solution to change the color of some Android Material Components layout objects. How can I change the color of text or borders in a Material Button programmatically? All functions like MaterialButton.setTexColor() do not work. Same thing for the StrokeColor. The change must be made logically, directly from code. No XML styles, colors must be able to change in live, based on values read from a database. Things like these don't work : //renewSetDate is a Material Button Object