本文整理汇总了Java中android.app.ActivityManager.TaskDescription类的典型用法代码示例。如果您正苦于以下问题:Java TaskDescription类的具体用法?Java TaskDescription怎么用?Java TaskDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskDescription类属于android.app.ActivityManager包,在下文中一共展示了TaskDescription类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
application = (WalletApplication) getApplication();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
setTaskDescription(new TaskDescription(null, null, getResources().getColor(R.color.bg_action_bar)));
super.onCreate(savedInstanceState);
}
开发者ID:guodroid,项目名称:okwallet,代码行数:10,代码来源:AbstractWalletActivity.java
示例2: configureTaskDescription
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void configureTaskDescription(Activity activity) {
if (isLollipopOrGreater()) {
Bitmap icon = BitmapFactory.decodeResource(
activity.getResources(), R.mipmap.ic_launcher);
TaskDescription taskDesc = new TaskDescription(
null, icon, ContextCompat.getColor(activity, R.color.primaryDark));
activity.setTaskDescription(taskDesc);
}
}
开发者ID:jruesga,项目名称:rview,代码行数:11,代码来源:AndroidHelper.java
示例3: onResume
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
try {
PackageManager pm = getPackageManager();
ActivityInfo activityInfo = pm.getActivityInfo(
getComponentName(), PackageManager.GET_META_DATA);
TaskDescription taskDescription = new TaskDescription(
activityInfo.loadLabel(pm).toString(),
BitmapFactory.decodeResource(getResources(), activityInfo.icon),
ResourceUtil.getAttrColor(this, android.R.attr.colorPrimary)
);
setTaskDescription(taskDescription);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
开发者ID:sorcererXW,项目名称:SorceryIconPack,代码行数:20,代码来源:BaseActivity.java
示例4: addAppTask
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
private static void addAppTask(Activity activity, int tabId, TabState tabState,
String currentUrl, String title, Bitmap favicon, Bitmap bitmap) {
if (tabId == ActivityDelegate.getTabIdFromIntent(activity.getIntent())) return;
// Create intent and taskDescription.
Intent intent = new Intent(Intent.ACTION_VIEW,
DocumentTabModelSelector.createDocumentDataString(tabId, currentUrl));
intent.setClassName(activity, ChromeLauncherActivity.getDocumentClassName(false));
intent.putExtra(IntentHandler.EXTRA_PRESERVE_TASK, true);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
ActivityManager am =
(ActivityManager) activity.getSystemService(Activity.ACTIVITY_SERVICE);
Bitmap thumbnail = Bitmap.createBitmap(am.getAppTaskThumbnailSize().getWidth(),
am.getAppTaskThumbnailSize().getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(thumbnail);
if (bitmap == null) {
canvas.drawColor(Color.WHITE);
} else {
float scale = Math.max(
(float) thumbnail.getWidth() / bitmap.getWidth(),
(float) thumbnail.getHeight() / bitmap.getHeight());
canvas.scale(scale, scale);
canvas.drawBitmap(bitmap, 0, 0, null);
}
TaskDescription taskDescription = new TaskDescription(title, favicon,
activity.getResources().getColor(R.color.default_primary_color));
am.addAppTask(activity, intent, taskDescription, thumbnail);
Entry entry = new Entry(tabId, tabState);
DocumentTabModelImpl tabModel = (DocumentTabModelImpl) ChromeApplication
.getDocumentTabModelSelector().getModel(false);
tabModel.addEntryForMigration(entry);
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:33,代码来源:DocumentMigrationHelper.java
示例5: applyTaskDescription
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void applyTaskDescription(Activity activity) {
String taskName = mContext.getString(R.string.app_name);
int taskColor = getPrimaryColor();
Bitmap taskIcon = getAppIcon();
TaskDescription taskDescription = new TaskDescription(taskName, taskIcon, taskColor);
activity.setTaskDescription(taskDescription);
}
开发者ID:marverenic,项目名称:Jockey,代码行数:10,代码来源:PresetThemeStore.java
示例6: onCreate
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
AndroidInjection.inject(this);
super.onCreate(savedInstanceState);
if ("true".equals(getIntent().getStringExtra("crash"))) {
throw new RuntimeException("Crash! Bang! Pow! This is only a test...");
}
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
CheatSheet.setup(launchView);
setTaskDescription(new TaskDescription(appName, rasterizeTaskIcon(), primaryNormal));
videoSizePercentageAdapter = new VideoSizePercentageAdapter(this);
videoSizePercentageView.setAdapter(videoSizePercentageAdapter);
videoSizePercentageView.setSelection(
VideoSizePercentageAdapter.getSelectedPosition(videoSizePreference.get()));
showCountdownView.setChecked(showCountdownPreference.get());
hideFromRecentsView.setChecked(hideFromRecentsPreference.get());
recordingNotificationView.setChecked(recordingNotificationPreference.get());
showTouchesView.setChecked(showTouchesPreference.get());
useDemoModeView.setChecked(useDemoModePreference.get());
showDemoModeSetting = new DemoModeHelper.ShowDemoModeSetting() {
@Override public void show() {
useDemoModeContainerView.setVisibility(VISIBLE);
}
@Override public void hide() {
useDemoModeView.setChecked(false);
useDemoModeContainerView.setVisibility(GONE);
}
};
DemoModeHelper.showDemoModeSetting(this, showDemoModeSetting);
}
开发者ID:JakeWharton,项目名称:Telecine,代码行数:39,代码来源:TelecineActivity.java
示例7: onCreate
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final AppResources res = AppResources.get(this);
// WTF! IRIS506Q android version "unknown"
try {
getWindow().setStatusBarColor(res.getPrimaryColor());
} catch (Exception e) {
Log.e("BaseActivity", "get a stone and throw it at your device vendor", e);
}
// color recents tab
final Bitmap appIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_devicecontrol);
final TaskDescription description = new TaskDescription(String.valueOf(getTitle()), appIcon, res.getAccentColor());
setTaskDescription(description);
}
}
开发者ID:amartinz,项目名称:DeviceControl,代码行数:19,代码来源:BaseActivity.java
示例8: setupRecentBar
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
@TargetApi(value=Build.VERSION_CODES.LOLLIPOP)
public static void setupRecentBar(Activity activity) {
if (isLollipopOrGreater()) {
int color = ContextCompat.getColor(activity, R.color.color_primary);
if (Color.alpha(color) != 255) {
// Remove alpha color. TaskDescription needs an opaque color
color = Color.rgb(Color.red(color), Color.green(color), Color.blue(color));
}
TaskDescription taskDesc = new TaskDescription(
activity.getString(R.string.app_name), null, color);
activity.setTaskDescription(taskDesc);
}
}
开发者ID:jruesga,项目名称:PhotoPhase,代码行数:14,代码来源:AndroidHelper.java
示例9: setTaskDescription
import android.app.ActivityManager.TaskDescription; //导入依赖的package包/类
public void setTaskDescription(TaskDescription taskDescription) {
mHostActivity.setTaskDescription(taskDescription);
}
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:4,代码来源:Target_Activity.java
注:本文中的android.app.ActivityManager.TaskDescription类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论