Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f025d123 authored by herriojr's avatar herriojr
Browse files

Added in the MFU Screen and data layer.

This implementation includes the MFU for keeping track of the
top 5 most frequently accessed files.  It is implemented in such
a way that we can easily change algorithms if need be.

Change-Id: Ib9b068deb5ac66f4cff99128396318133d4729c0
Ticket: CLOUD-48
parent 528877a4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@
      android:authorities="com.cyanogenmod.filemanager.providers.index"
      android:name=".providers.MimeTypeIndexProvider"/>

    <provider android:name=".mstaru.MostFrequentlyUsedProvider"
              android:authorities="com.cyanogenmod.filemanager.mfu"
              android:exported="false"/>

    <service
      android:name=".service.MimeTypeIndexService"
      android:label="@string/app_name">
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2012 The CyanogenMod 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
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="oval">

    <solid android:color="@color/white"/>

    <size android:width="120dp"
          android:height="120dp"/>
</shape>
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (c) 2015 The CyanogenMod 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
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="#FFFFFF"
        android:pathData="M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z" />
</vector>
 No newline at end of file
+11 −3
Original line number Diff line number Diff line
@@ -163,15 +163,23 @@
                android:gravity="center" />

            <!-- A CardView that contains a TextView -->

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginBottom="15dp"
                android:background="@color/black_11"/>

            <include layout="@layout/mstaru_list" />

            <android.support.v7.widget.CardView
                android:id="@+id/blank_card"
                android:layout_gravity="center"
                android:layout_width="match_parent"
                android:layout_height="192dp"
                android:layout_margin="8dp"
                card_view:cardCornerRadius="4dp">

            </android.support.v7.widget.CardView>
                android:visibility="gone"
                card_view:cardCornerRadius="4dp" />

        </LinearLayout>

+78 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2015 The CyanogenMod 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
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/mstaru"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginTop="15dp"
        android:layout_marginBottom="17dp"
        android:textColor="@color/black_46"
        android:textSize="14sp"
        android:text="@string/frequent" />

    <LinearLayout android:id="@+id/mstaru_list"
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone">

        <include layout="@layout/mstaru_row" />

        <include layout="@layout/mstaru_row" />

        <include layout="@layout/mstaru_row" />

        <include layout="@layout/mstaru_row" />

        <include layout="@layout/mstaru_row" />
    </LinearLayout>

    <LinearLayout android:id="@+id/mstaru_empty"
                  android:orientation="vertical"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="49dp"
                  android:layout_marginBottom="61dp"
                  android:visibility="visible">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:background="@drawable/circle_large"
                android:src="@drawable/ic_frequent_placeholder"
                android:tint="@color/black_26"
                android:backgroundTint="@color/off_white"
                android:scaleType="center"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="19dp"
                android:textColor="@color/black_26"
                android:text="@string/access_the_files_you_use_the_most_here"/>
    </LinearLayout>
</LinearLayout>
Loading