android.app.Dialog.getActionBar()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中android.app.Dialog.getActionBar()方法的一些代码示例,展示了Dialog.getActionBar()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialog.getActionBar()方法的具体详情如下:
包路径:android.app.Dialog
类名称:Dialog
方法名:getActionBar

Dialog.getActionBar介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

dialog.getActionBar().setDisplayHomeAsUpEnabled(true);

代码示例来源:origin: stackoverflow.com

dialog.getActionBar().setDisplayHomeAsUpEnabled(true);

代码示例来源:origin: wasdennnoch/AndroidN-ify

@SuppressWarnings({"ConstantConditions", "deprecation"})
public static void applyTheme(Dialog dialog, Context context, SharedPreferences prefs) {
  if (prefs.getString("app_theme", "light").equals("device")) return;
  int colorPrimary = prefs.getInt("theme_colorPrimary", context.getResources().getColor(R.color.colorPrimary));
  float[] hsv = new float[3];
  Color.colorToHSV(colorPrimary, hsv);
  hsv[2] *= 0.8f;
  int colorPrimaryDark = Color.HSVToColor(hsv);
  dialog.getWindow().setStatusBarColor(colorPrimaryDark);
  try {
    dialog.getActionBar().setBackgroundDrawable(new ColorDrawable(colorPrimary));
  } catch (NullPointerException ignore) {
  }
}

代码示例来源:origin: billthefarmer/currency

@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
                   Preference preference)
{
  boolean result =
    super.onPreferenceTreeClick(preferenceScreen, preference);
  // Set home as up
  if (preference instanceof PreferenceScreen)
  {
    Dialog dialog = ((PreferenceScreen) preference).getDialog();
    ActionBar actionBar = dialog.getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
  }
  return result;
}

代码示例来源:origin: billthefarmer/tuner

@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
                   Preference preference)
{
  boolean result =
    super.onPreferenceTreeClick(preferenceScreen, preference);
  if (preference instanceof PreferenceScreen)
  {
    Dialog dialog = ((PreferenceScreen) preference).getDialog();
    ActionBar actionBar = dialog.getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
  }
  return result;
}

代码示例来源:origin: billthefarmer/scope

@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
                   Preference preference)
{
  boolean result =
    super.onPreferenceTreeClick(preferenceScreen, preference);
  if (preference instanceof PreferenceScreen)
  {
    Dialog dialog = ((PreferenceScreen) preference).getDialog();
    ActionBar actionBar = dialog.getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
  }
  return result;
}

代码示例来源:origin: billthefarmer/diary

@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
                   Preference preference)
{
  boolean result =
    super.onPreferenceTreeClick(preferenceScreen, preference);
  // Set home as up
  if (preference instanceof PreferenceScreen)
  {
    Dialog dialog = ((PreferenceScreen) preference).getDialog();
    ActionBar actionBar = dialog.getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
  }
  return result;
}

相关文章