A broad summary of the changes or new functionality that this PR brings.
A detailed list of changes and new functionality. You can be very technical and specific in this section.
package com.example.scalpeldrawer; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.support.v4.widget.DrawerLayout; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.CheckBox; |
MenuItemCompat.setOnActionExpandListener(search, new MenuItemCompat.OnActionExpandListener() { | |
@Override | |
public boolean onMenuItemActionExpand(MenuItem menuItem) { | |
Toast.makeText(getApplicationContext(), "Expand", Toast.LENGTH_SHORT).show(); | |
return true; | |
} | |
@Override | |
public boolean onMenuItemActionCollapse(MenuItem menuItem) { | |
Toast.makeText(getApplicationContext(), "Collapse", Toast.LENGTH_SHORT).show(); |
/* | |
* Copyright (C) 2006 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | |
public static String getForegroundProcess(Context context) { | |
String topPackageName = null; | |
UsageStatsManager usage = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE); | |
long time = System.currentTimeMillis(); | |
List<UsageStats> stats = usage.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, time - 1000*1000, time); | |
if (stats != null) { | |
SortedMap<Long, UsageStats> runningTask = new TreeMap<Long,UsageStats>(); | |
for (UsageStats usageStats : stats) { | |
runningTask.put(usageStats.getLastTimeUsed(), usageStats); |
/** | |
* A convenience wrapper around the [Interaction] types | |
*/ | |
@Immutable | |
data class CustomInteraction( | |
val enabled: Boolean = false, | |
val hovered: Boolean = false, | |
val pressed: Boolean = false, | |
val focused: Boolean = false, |