aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorTrevor Johns <trevorjohns@google.com>2016-04-11 17:00:27 -0700
committerTrevor Johns <trevorjohns@google.com>2016-04-11 17:00:27 -0700
commit23cb6da670da5dda07ca18fcf182dd21e4648c3b (patch)
tree51e0c6df31f31dba1c0395ad79a129ab04ebcafb /system
parentf8064b80615433cd4d619be0daace76d563545f3 (diff)
parentf09110409432e21494f89221284ccd3f4404fab7 (diff)
downloadandroid-23cb6da670da5dda07ca18fcf182dd21e4648c3b.tar.gz
Resolve merge conflicts of f091104 to nyc-dev
Change-Id: Ie5a6e3a472784605577c00d06ac0abf798deb8e1
Diffstat (limited to 'system')
-rw-r--r--system/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsFragment.java6
-rw-r--r--system/AppUsageStatistics/Application/src/main/res/layout/fragment_app_usage_statistics.xml8
2 files changed, 8 insertions, 6 deletions
diff --git a/system/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsFragment.java b/system/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsFragment.java
index 9f54d02c..9a3fd5e9 100644
--- a/system/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsFragment.java
+++ b/system/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsFragment.java
@@ -24,7 +24,6 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.app.Fragment;
-import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
@@ -91,10 +90,9 @@ public class AppUsageStatisticsFragment extends Fragment {
public void onViewCreated(View rootView, Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);
- mLayoutManager = new LinearLayoutManager(getActivity());
mUsageListAdapter = new UsageListAdapter();
mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview_app_usage);
- mRecyclerView.setLayoutManager(mLayoutManager);
+ mLayoutManager = mRecyclerView.getLayoutManager();
mRecyclerView.scrollToPosition(0);
mRecyclerView.setAdapter(mUsageListAdapter);
mOpenUsageSettingButton = (Button) rootView.findViewById(R.id.button_open_usage_setting);
@@ -197,7 +195,7 @@ public class AppUsageStatisticsFragment extends Fragment {
@Override
public int compare(UsageStats left, UsageStats right) {
- return (int) (right.getLastTimeUsed() - left.getLastTimeUsed());
+ return Long.compare(right.getLastTimeUsed(), left.getLastTimeUsed());
}
}
diff --git a/system/AppUsageStatistics/Application/src/main/res/layout/fragment_app_usage_statistics.xml b/system/AppUsageStatistics/Application/src/main/res/layout/fragment_app_usage_statistics.xml
index 1d567b76..297bf1e3 100644
--- a/system/AppUsageStatistics/Application/src/main/res/layout/fragment_app_usage_statistics.xml
+++ b/system/AppUsageStatistics/Application/src/main/res/layout/fragment_app_usage_statistics.xml
@@ -16,11 +16,13 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:padding="@dimen/margin_medium">
+ android:padding="@dimen/margin_medium"
+ >
<Button android:id="@+id/button_open_usage_setting"
android:layout_width="wrap_content"
@@ -50,6 +52,8 @@
android:scrollbars="vertical"
android:drawSelectorOnTop="true"
android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ android:layout_height="match_parent"
+ app:layoutManager="LinearLayoutManager"
+ />
</LinearLayout>