62 questions
5 votes
1 answer
11k views
Custom Android notification sound
I'm trying to implement a custom notification sound in my application. I have written the following code, but the application plays only default sound and not the custom sound i've added in raw folder....
2 votes
1 answer
280 views
Animate TextView to lower case using MotionLayout
Animate textView in Capitalize to lower Case using MotionLayout like FACTS -> facts I am succeeded in translating and change textColor where as I am not able to convert all letter to lower case ...
1 vote
0 answers
997 views
Can I use enum from code in android custom enum attribute?
I have an enum in my Kotlin app: enum class MeasurementUnits(val displayString: String) { KILOGRAM("kg"), POUND("lbs"), KILOMETER("km"), MILE("mi&...
2 votes
0 answers
310 views
Android: Is it possible to "expose" sub-views attributes for a custom view?
I am trying to "expose" the attributes of subviews for a custom view I have created. In XML this would look like: <com.isupatches.android.customview.MyView android:id="@+id/...
1 vote
1 answer
995 views
Update custom view custom properties programmatically
I have custom view named CustomView which has two custom attributes att1 and att2 defined. Inside XML I can update the attributes easily like below: <com.example.myapp.CustomView android:id=&...
0 votes
1 answer
306 views
Access values from dimen xml file in Custom TextView
I have a requirement where I need to use a custom TextView across all modules in App . When user enters XML attribute as "large" ,custom textview should pickup value from dimen.xml and ...
1 vote
1 answer
2k views
Pass Callback Function to Custom View in Android
I have a custom view in my android project, MyCustomView. With a built-in view like button, I can use the data binding library to pass a callback function to the button: <Button ... ...
3 votes
1 answer
1k views
custom attribute setter error when data binding - Android
I have custom attribute which is declared as type of string, when a pass the value as just string in xml like this app:cpb_title="sometsring" its working but when i try data binding like ...
1 vote
0 answers
367 views
some of the custom attributes not working on android [duplicate]
I have following custom attributes: <attr name="myText" format="string" /> <attr name="myRadius" format="float" /> and i want to get this ...
1 vote
0 answers
35 views
Re-using android's built in xml attributes for a custom view [duplicate]
Let's say I have a custom view like this (This is just an example): <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:...
0 votes
0 answers
546 views
Custom ViewGroup LayoutParams not working in android
Well I m just learning custom viewgroups in android so i have made a simple viewgroup. i named it LearnLayout i have custom layoutparam in it, called as LearnLayoutParams Problem when i use custom ...
10 votes
3 answers
11k views
Android CustomAttribute in MotionLayout to change Text in TextView
Anyone can help me with the correct way to change TextView's text in MotionLayout... this is what I doing. I'm testing the MotionLayout on a Simple App... I reach the part on the Motion tutorials ...
2 votes
1 answer
1k views
android set custom attributes in styles.xml and get in program
I am trying to get a button custom attribute to return true/false using custom attributes defined in styles.xml. My example is trivial with only two buttons but I can't get it to work. My layout ...
0 votes
1 answer
318 views
android studio structural search and replace with regEx for search template
I want to implement mechanism for required xml custom attributes - exactly like layout_width/layout_height, but for custom attributes. possible solution is adding structural search to inspections, ...
1 vote
1 answer
1k views
How do you define custom attributes for the LayoutParams class of a custom RecyclerView.LayoutManager implementation?
I know how to create custom attributes for specific classes. You simply define them in a Styleable using the class name for the name, like so. <declare-styleable name="MyCustomView"> <...