Showing posts with label background. Show all posts
Showing posts with label background. Show all posts

Friday, 16 October 2015

Issue with setColorFilter on button background (Android 5)



Hi guys,

Teaching myself Android JAVA but am struggling with an issue that's affecting only one major version of Android, which appears to be all of 5.

I have an app using SupportFragments with the v4 support library (also tried it with framework fragments using v13 support library). On two of the fragments I have a ScrollView containing a large set of custom buttons. Both of these screen have an issue where the setColorFilter is being ignored when the scroll position is at the very top of the ScrollView. Oddly, if I scroll even 1 pixel the setColorFilter is working. Baffling.

Note, this only affects Android 5. Android 4, and Android 6 work perfectly. Only the various flavors of 5 I've tested with so far have this problem (5.1.1 - Cyanogen S4, and 5.0.2 - Galaxy Tab S2). The Nexus 9 (6.0), Galaxy Tab 2 (4.2.2) and Galaxy Tab 3 (4.4.2) all work fine.

Below is the example of the the scroll being at the top of the scrollview, and then scrolling by just a tiny margin showing the color filter applied.

******* won't let me post the images yet :( ****************

The buttons are initially added in the populate method called from the Fragments onCreateView using:


Code:


PasswordButton<Password> btn = (PasswordButton<Password>)inflater.inflate(R.layout.password_button, viewGroup, false);
btn.setObject(password);


The setObject(password) actually sets a password object to the button, and applies the color filter that it inherits from it's password group to the background using the following code (again all from the onCreateView):


Code:


public void setColour() {
                int colour = ((ButtonInterface)this.object).getColour();
                Drawable background = ContextCompat.getDrawable(getContext(), R.drawable.password_button_selector);
                background.setColorFilter(new PorterDuffColorFilter(colour, PorterDuff.Mode.MULTIPLY));
                this.setBackground(background);
        }


The button's style is a made up of a 9patch background (which is where I'm applying the color filter), a small arrow image, and the text.

I've made a workaround by overriding the onDraw completely for Android 5, and all other variants simply calling super(canvas), but it would be nice to not have to do this as if I start skinning the buttons my custom onDraw will need constant updating.

The searching I've done found allot of issues the other way (i.e. 5 working, but 4 not), and the ones I've found that had issues with 5 I'm already using the methods they say got it working.

Any help would be appreciated :)



Monday, 12 October 2015

Issue with downloading data on background by Android system



Hello,
I have HTC One M7 with Android Revolution HD One 36.1 and recovery TWRP 2.6.3.4 .

I was running it like this without any issues for more than one year. Only recently (few weeks back) phone started to download huge amounts of data. It downloaded few GBs during weekend. All these downloads are displayed as Android System in background.

I have tried to block it with firewall but to no avail. I have tried to perform factory reset, I have tried to reflash ROM from TWRP. But in all cases issue immediately started again. In the end I was able to reduce consumption by restriction on all downloads in background through settings. This way it does not download data on cellular networks, but it still drains all Wi-Fis I connect to. It also means that I cannot use most functionalities I was used to like autosynchronization of gmail, apps like viber does not work and many other small obstructions.

Does anyone have any idea how to get rid of this?

thank you



Saturday, 10 October 2015

System killing apps in background



Hello guys! When I run a application such as a DLNA server, torrent and lock the device after a while these applications are switched off. When the screen is turned on, everything is okay. I do not know what is the cause, it started like this happen recently. Anyone know what is going on and how to fix it? I'm on rooted stock P605XXUDOE2.



Friday, 9 October 2015

[Q] Can't Change background of dialler keyboard



after i change the background of dialler keyboard and i rc sign it and push to system my dialler keyboard background doesn't change? help :D :D any answer will be appericiated :D:D
my decompiled fw