Profile

Cover photo
Mobilevangelist
80 followers|15,810 views
AboutPostsPhotosVideos

Stream

Mobilevangelist

Shared publicly  - 
 
Sources tell The Next Web that Google is considering making Swift a “first class” language for Android, while Facebook and Uber mull their options
1
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Looking forward to the new Nexus devices.  And Marshmallow!
 
Exclusive: Nexus 5 (2015) revealed - The Nexus 5 (2015), also known as the 2015 LG Nexus or Nexus 5X, has been revealed in a new leaked image, confirming the final design of the next Google smartphone. (This is a preview - click here to read the entire entry.)
The Nexus 5 (2015), also known as the 2015 LG Nexus or Nexus 5X, has been revealed in a new leaked image, confirming the final design of the next Google smartphone.
75 comments on original post
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Huawei, the next Samsung?
IDC recently released the worldwide smartphone market share numbers and, to no surprise, Apple and Samsung are still the biggest players in the mobile space. But what stuck out as an interesting feat...
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
 
Android M Developer Preview 2 arrives!

Post by +Andrew Grush 
Last year’s Android L Developer Preview marked the first time Google had ever let the general public take part in testing out new versions of Android before they were ready for final release. One thing L didn’t have, however, is regular updates. Thankfully, with Android M Google announced it would be continually updating the test builds between the first release and final commercial version. And now the very first update has arrived! Android M...
24 comments on original post
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Get $200 off a 2nd Gen Moto X with no contract.

#motorola   #motox   #android   #dealoftheday  
1
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
How to update Android Studio to use the GDK Preview released last week.
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Candidate for Congress, +John Campbell, is using +Google Glass on the campaign trail.  It will be interesting seeing a political campaign from the candidate's point of view.

Follow the campaign on Google+ at +CandidCampbell.
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Minor bump, but skeptics will latch on.
 
Google Autonomous Car Potentially Caused Its First Crash

#Android #Google #AutonomousCars #Technology
Google may not be the only company workling on autonomous vehicles at this point, but it's certainly one of the companies whose work is more in the public
5 comments on original post
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
I've always liked flip phones.
 
What's old is new again.
Smartphone manufacturers are always looking for ways to differentiate their products from the competition, but this largely consists of UI skins and differ... by Bertel King, Jr. in LG, News
10 comments on original post
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
 
Hardware Specs For LG & Huawei's Nexus Allegedly Leaked 

#Android   #huawei   #LG   #leaked   #nexus  
Long standing rumors around this year’s Nexus release have claimed that Google will be launching two separate Nexus-branded smartphones this year. While on
6 comments on original post
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Excellent!
 
Project Fi Only Works on the Nexus 6? XDA Begs to Differ 

#Android   #projectfi   #Xda   #nexus6  
Say what you will about the pricing and availability of Project Fi but the technology behind it is nothing short of amazing. The ability to hand off data b
3 comments on original post
1
Add a comment...

Mobilevangelist

Shared publicly  - 
 
Brilliant way to dynamically color your assets to save app space and code complexity.  Nice work +Thomas Devaux.

h/t +Taylor Ling 
 
Android App Tricks: Runtime asset coloring

Soon after I released URL Shortener [0], few people asked me how I implemented certain features in the app. Following +Cyril Mottier's initiative when Capitaine Train [1] was launched, I thought it would be a good idea to humbly contribute to the Android community by sharing some tricks and things I've learned along the way.

Shortening URLs is a boring task. When I started working on URL Shortener, I scratched my head to make the experience visually more appealing. One thing was getting a thumbnail for every URL.

Still, the early version of the Analytics page wasn't great, showing lists of textual stats. My original idea was to match http://goo.gl as much as possible, so I started using charts with the same color palette for the top entries: blue, green, orange, yellow, purple.

I then tried adding icons for top Browsers and Referrers, but quickly realized 5 flavors of each icon would become a pain for multiple reasons:
Code complexity and robustness. That'd have required a bunch of ugly switches trying to find the correct drawable with the correct color. Another solution would have been to generate the resource name at runtime, but that's risky.
App size. It would mean a lot of drawables, x3 for H/X/XXHPI. 
Hard to maintain. What if I want to change one color? Dozens of assets to regenerate.

The "Browsers" card layout is very simple. The chart itself (lighter bars and thin lines) is a custom view, but the left part only contains regular views. Each row is made of:
• An ImageView for the icon background (legend_icon_background) which simulates padding around the real icon.
• An ImageView for the icon (legend_icon), the browser icon itself.
• A TextView with the click count (clicks). It uses an arrow shaped 9-patch that will stretch nicely with text. Because these guys are all in a TableRow, click counts will align vertically.

<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:gravity="center_vertical" >

  <FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="40dp" >

    <TextView
      android:id="@id/clicks"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="center_vertical"
      android:layout_marginLeft="24dp"
      android:gravity="center_vertical|right"
      android:paddingLeft="15dp"
      android:paddingRight="15dp" />

    <RelativeLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_vertical" >

      <ImageView
        android:id="@id/legend_icon_background"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />

      <ImageView
        android:id="@id/legend_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />
    </RelativeLayout>
  </FrameLayout>

</TableRow>

The trick is to use a white icon for the  legend_icon ImageView and color it at runtime.

First easy step is to determine the drawable resource IDs and color for a given row (Top 1: blue, Top 2: green, etc.). Then, the white drawable is colored with a LightingColorFilter [2]. As documentation states, LightingColorFilter "multiplies the RGB channels by one color, and then adds a second color". If the source drawable is pure white, multiplying by the target color and adding zero will give you a drawable with the exact color you passed!

Drawable coloredDrawable = Utils.getColoredDrawable(browserIcon.getContext(), R.drawable.ic_browser_chrome, SOME_COLOR);
browserIcon.setImageDrawable(coloredDrawable);

...

public static Drawable getColoredDrawable(Context context, int whiteDrawableResId, int targetColor) {
  Drawable drawable = context.getResources().getDrawable(whiteDrawableResId);
  ColorFilter filter = new LightingColorFilter(targetColor, 0);
  drawable.mutate().setColorFilter(filter);
  return drawable;
}

Same is done to the TextView 9-patch background - it's colored and set at runtime. Another benefit: white PNGs are very small in size when they get crunched.

#android #AndroidAppTricks  

[0] https://play.google.com/store/apps/details?id=com.tdevaux.googleurlshortener
[1] https://play.google.com/store/apps/details?id=com.capitainetrain.android
[2] http://developer.android.com/reference/android/graphics/LightingColorFilter.html
14 comments on original post
1
Add a comment...
Story
Tagline
Android enthusiast, Apple admirer, mobile evangelist, Glass Explorer.
Introduction
Passionate about mobile technologies.  Love Google, appreciate Apple, monitoring Microsoft.
Contact Information
Contact info
Email