Android Open Source - goodintentions U I Utils






From Project

Back to project page goodintentions.

License

The source code is released under:

Apache License

If you think the Android project goodintentions listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.luboganev.goodintentions;
//from  w w w.ja  v  a  2 s  .  c  o m
import android.content.Context;
import android.util.TypedValue;

public class UIUtils {
  /**
   * Returns the physical pixels that 
   * corresponds to the input DIPs
   * 
   * @param context
   *     Use application context and not some activity's context to prevent memory leaks
   */
  public static int getPixelsFromDips(Context context, int dips) {
    float result = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dips, context.getResources().getDisplayMetrics());
    return (int)result;
  }
}




Java Source Code List

com.luboganev.goodintentions.IntentionLauncher.java
com.luboganev.goodintentions.LogUtils.java
com.luboganev.goodintentions.UIUtils.java
com.luboganev.goodintentions.data.Intention.java
com.luboganev.goodintentions.data.LocalStorageManager.java
com.luboganev.goodintentions.data.LocalStorage.java
com.luboganev.goodintentions.ui.AboutActivity.java
com.luboganev.goodintentions.ui.MainActivity$$ViewInjector.java
com.luboganev.goodintentions.ui.MainActivity.java
com.luboganev.goodintentions.ui.views.IntentionCategoriesLinearLayout$$ViewInjector.java
com.luboganev.goodintentions.ui.views.IntentionCategoriesLinearLayout.java
com.luboganev.goodintentions.ui.views.IntentionFlagsLinearLayout$$ViewInjector.java
com.luboganev.goodintentions.ui.views.IntentionFlagsLinearLayout.java