Tabnine Logo
OSUtils.isEmui
Code IndexAdd Tabnine to your IDE (free)

How to use
isEmui
method
in
com.lody.virtual.helper.utils.OSUtils

Best Java code snippets using com.lody.virtual.helper.utils.OSUtils.isEmui (Showing top 6 results out of 315)

origin: android-hacker/VirtualXposed

public int getNotificationWidth(Context context, int width, int height, int padding) {
  if (mWidth > 0) {
    return mWidth;
  }
  int w = getDefaultWidth(width, padding);
  if (OSUtils.getInstance().isEmui()) {
    // huawei's emui
    w = getEMUINotificationWidth(context, width, height);
  } else if (OSUtils.getInstance().isMiui()) {
    if (Build.VERSION.SDK_INT >= 21) {
      padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10f,
          context.getResources().getDisplayMetrics()));
      w = getMIUINotificationWidth(context, width - padding * 2, height);
    } else {
      padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 25f,
          context.getResources().getDisplayMetrics()));
      w = getMIUINotificationWidth(context, width - padding * 2, height);
    }
  }
  mWidth = w;
  return w;
}
origin: android-hacker/VirtualXposed

void fixIconImage(Resources resources, RemoteViews remoteViews, boolean hasIconBitmap, Notification notification) {
  if (remoteViews == null || notification.icon == 0) return;
  if (!mNotificationCompat.isSystemLayout(remoteViews)) {
    return;
  }
  try {
    //noinspection deprecation
    int id = R_Hide.id.icon.get();
    //only fake small icon
    if (!hasIconBitmap && notification.largeIcon == null) {
      Drawable drawable = resources.getDrawable(notification.icon);
      drawable.setLevel(notification.iconLevel);
      Bitmap bitmap = drawableToBitMap(drawable);
      remoteViews.setImageViewBitmap(id, bitmap);
      //emui
      if(OSUtils.getInstance().isEmui()) {
        if (notification.largeIcon == null) {
          notification.largeIcon = bitmap;
        }
      }
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: bzsome/VirtualApp-x326

public int getNotificationWidth(Context context, int width, int height, int padding) {
  if (mWidth > 0) {
    return mWidth;
  }
  int w = getDefaultWidth(width, padding);
  if (OSUtils.getInstance().isEmui()) {
    // huawei's emui
    w = getEMUINotificationWidth(context, width, height);
  } else if (OSUtils.getInstance().isMiui()) {
    if (Build.VERSION.SDK_INT >= 21) {
      padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10f,
          context.getResources().getDisplayMetrics()));
      w = getMIUINotificationWidth(context, width - padding * 2, height);
    } else {
      padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 25f,
          context.getResources().getDisplayMetrics()));
      w = getMIUINotificationWidth(context, width - padding * 2, height);
    }
  }
  mWidth = w;
  return w;
}
origin: darkskygit/VirtualApp

public int getNotificationWidth(Context context, int width, int height, int padding) {
  if (mWidth > 0) {
    return mWidth;
  }
  int w = getDefaultWidth(width, padding);
  if (OSUtils.getInstance().isEmui()) {
    // huawei's emui
    w = getEMUINotificationWidth(context, width, height);
  } else if (OSUtils.getInstance().isMiui()) {
    if (Build.VERSION.SDK_INT >= 21) {
      padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10f,
          context.getResources().getDisplayMetrics()));
      w = getMIUINotificationWidth(context, width - padding * 2, height);
    } else {
      padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 25f,
          context.getResources().getDisplayMetrics()));
      w = getMIUINotificationWidth(context, width - padding * 2, height);
    }
  }
  mWidth = w;
  return w;
}
origin: darkskygit/VirtualApp

void fixIconImage(Resources resources, RemoteViews remoteViews, boolean hasIconBitmap, Notification notification) {
  if (remoteViews == null || notification.icon == 0) return;
  if (!mNotificationCompat.isSystemLayout(remoteViews)) {
    return;
  }
  try {
    //noinspection deprecation
    int id = R_Hide.id.icon.get();
    //only fake small icon
    if (!hasIconBitmap && notification.largeIcon == null) {
      Drawable drawable = resources.getDrawable(notification.icon);
      drawable.setLevel(notification.iconLevel);
      Bitmap bitmap = drawableToBitMap(drawable);
      remoteViews.setImageViewBitmap(id, bitmap);
      //emui
      if(OSUtils.getInstance().isEmui()) {
        if (notification.largeIcon == null) {
          notification.largeIcon = bitmap;
        }
      }
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: bzsome/VirtualApp-x326

void fixIconImage(Resources resources, RemoteViews remoteViews, boolean hasIconBitmap, Notification notification) {
  if (remoteViews == null || notification.icon == 0) return;
  if (!mNotificationCompat.isSystemLayout(remoteViews)) {
    return;
  }
  try {
    //noinspection deprecation
    int id = R_Hide.id.icon.get();
    //only fake small icon
    if (!hasIconBitmap && notification.largeIcon == null) {
      Drawable drawable = resources.getDrawable(notification.icon);
      drawable.setLevel(notification.iconLevel);
      Bitmap bitmap = drawableToBitMap(drawable);
      remoteViews.setImageViewBitmap(id, bitmap);
      //emui
      if(OSUtils.getInstance().isEmui()) {
        if (notification.largeIcon == null) {
          notification.largeIcon = bitmap;
        }
      }
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}
com.lody.virtual.helper.utilsOSUtilsisEmui

Popular methods of OSUtils

  • getInstance
  • hasFlyme
  • isMiui

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • String (java.lang)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now