This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean dispatchTouchEvent(MotionEvent event) { | |
View v = getCurrentFocus(); | |
boolean result = super.dispatchTouchEvent(event); | |
if (v instanceof EditText) { | |
View w = getCurrentFocus(); | |
int coords[] = new int[2]; | |
w.getLocationOnScreen(coords); | |
float x = event.getRawX() + w.getLeft() - coords[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I’ve been struggling for some hours with TextView and Spannable.. ClickableSpan to be precise. It seems that when you tap the clickable text it gets an ugly orange stroke (might differ on devices) around the text and if you so happen to have this in a custom view as an item in e.g Gallery it really stands out by highlighting it everytime you scroll away from that view. Annoying, yes? | |
The solution is extremely simple and was provided by a thread over at Stackoverflow.com. | |
To edit or remove the higlight color you can simply set the TextViews highlight color itself to any color you want or Color.TRANSPARENT if you don’t want any color. | |
android:textColorHighlight="@color/something" | |
or in code | |
textView.setHighlightColor(Color.TRANSPARENT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From theme | |
<style name="SearchToolbar" parent="Theme.AppCompat.Light.NoActionBar"> | |
//toolbar back arrow color | |
<item name="android:textColorSecondary">@android:color/white</item> | |
//toolbar title color | |
<item name="android:textColorPrimary">@android:color/white</item> | |
</style> | |
Also we can do it from java code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
প্রতিদিন আমরা ডেভেলপমেন্ট করার সময় বিভিন্ন মেথদস ব্যবহার করি যা সবসময় প্রয়োজন হয়। এখানে আমি যখন যেটা পাই সেটা সেইভ করে রাখব যাতে পরবর্তিতে সহজে ব্যবহার করেতে পারি। |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder