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

Commit c77e916b authored by Stephen Bird's avatar Stephen Bird
Browse files

Navigation & homepage

Move from single view to fragments.

Add homepage.
The base homepage is basically a list/scroll view with a search box at
the top. Below will be search quick links and other fast link items.

Change-Id: Ifd5fe9f1859837e1a76e250c42312c35e637657f
parent 743e7af9
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -16,24 +16,41 @@

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
appcompat_dir := ../../../external/android/support-prebuilt/appcompat/res
supportdesign_dir := ../../../external/android/support-prebuilt/support-design/res
res_dirs := $(supportdesign_dir) $(appcompat_dir) res

LOCAL_RESOURCE_DIR := \
    $(addprefix $(LOCAL_PATH)/, $(res_dirs))\
    frameworks/support/v7/cardview/res

LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_SRC_FILES += $(call all-java-files-under, libs/android-syntax-highlight/src)
LOCAL_SRC_FILES += $(call all-java-files-under, libs/color-picker-view/src)

LOCAL_STATIC_JAVA_LIBRARIES += libtruezip
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += juniversalchardet
LOCAL_STATIC_JAVA_LIBRARIES += cmfm-android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += cmfm-android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += cmfm-android-support-design
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-cardview

LOCAL_PACKAGE_NAME := CMFileManager
LOCAL_CERTIFICATE := platform
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
#LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_PROGUARD_ENABLED := disabled

LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.design:android.support.v7.appcompat:android.support.v7.cardview

include $(BUILD_PACKAGE)
include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
    juniversalchardet:libs/juniversalchardet/juniversalchardet-1.0.3.jar
    juniversalchardet:libs/juniversalchardet/juniversalchardet-1.0.3.jar \
    cmfm-android-support-v4:../../../external/android/support-prebuilt/appcompat/android-support-v4.jar \
    cmfm-android-support-v7-appcompat:../../../external/android/support-prebuilt/appcompat/android-support-v7-appcompat.jar \
    cmfm-android-support-design:../../../external/android/support-prebuilt/support-design/android-support-design.jar

include $(BUILD_MULTI_PREBUILT)
include $(call all-makefiles-under,$(LOCAL_PATH))
+3 −8
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@

  <original-package android:name="com.cyanogenmod.filemanager" />

  <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
  <uses-sdk android:minSdkVersion="22" android:targetSdkVersion="22" />

  <uses-feature android:name="android.software.leanback"
    android:required="false" />
@@ -51,7 +51,7 @@
    android:banner="@drawable/banner"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@style/FileManager.Theme.Material.Light"
    android:theme="@style/Base.AppTheme"
    android:supportsRtl="true">

    <meta-data
@@ -87,11 +87,10 @@
    </service>

    <activity
      android:name=".activities.NavigationActivity"
      android:name=".activities.MainActivity"
      android:label="@string/app_name"
      android:launchMode="singleTop"
      android:uiOptions="none"
      android:theme="@style/FileManager.Theme.Material.Light.NoActionBar"
      android:windowSoftInputMode="adjustNothing"
      android:configChanges="orientation|keyboardHidden|screenSize"
      android:exported="true">
@@ -135,7 +134,6 @@
      android:label="@string/picker"
      android:uiOptions="none"
      android:configChanges="orientation|keyboardHidden|screenSize"
      android:theme="@style/FileManager.Theme.Material.Light.Overlay"
      android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.GET_CONTENT" />
@@ -170,7 +168,6 @@
      android:name=".activities.ShortcutActivity"
      android:label="@string/app_name"
      android:uiOptions="none"
      android:theme="@style/FileManager.Theme.Material.Light.Overlay"
      android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
@@ -181,7 +178,6 @@
      android:name=".activities.ChangeLogActivity"
      android:label="@string/app_name"
      android:uiOptions="none"
      android:theme="@style/FileManager.Theme.Material.Light.Overlay"
      android:exported="false">
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
@@ -224,7 +220,6 @@
      android:label="@string/app_name"
      android:uiOptions="none"
      android:configChanges="orientation|keyboardHidden|screenSize"
      android:theme="@android:style/Theme.Material.Light.Dialog"
      android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
+4 −0
Original line number Diff line number Diff line
@@ -13,6 +13,10 @@
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider

-keep class android.support.design.widget.** { *; }
-keep interface android.support.design.widget.** { *; }
-dontwarn android.support.design.**

#keep all classes that might be used in XML layouts
-keep public class * extends android.view.View {
    public <init>(android.content.Context);
+133 −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.
-->
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <!-- A CardView that contains a TextView -->
            <android.support.v7.widget.CardView
                android:id="@+id/card_view"
                android:layout_gravity="center"
                android:layout_width="match_parent"
                android:layout_height="400dp"
                card_view:cardCornerRadius="4dp">

                <TextView
                    android:id="@+id/info_text"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

            </android.support.v7.widget.CardView>

            <com.cyanogenmod.filemanager.ui.widgets.WrappedGridView
                android:id="@+id/easy_modeView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:columnWidth="90dp"
                android:numColumns="auto_fit"
                android:verticalSpacing="10dp"
                android:horizontalSpacing="10dp"
                android:stretchMode="columnWidth"
                android:gravity="center" />

            <!-- A CardView that contains a TextView -->
            <android.support.v7.widget.CardView
                android:id="@+id/card_view3"
                android:layout_gravity="center"
                android:layout_width="200dp"
                android:layout_height="200dp"
                card_view:cardCornerRadius="4dp">

                <TextView
                    android:id="@+id/info_text2"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

            </android.support.v7.widget.CardView>

        </LinearLayout>

    </android.support.v4.widget.NestedScrollView>

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <android.support.v7.widget.CardView
                android:id="@+id/card_view2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                card_view:cardCornerRadius="4dp"
                android:layout_marginStart="16dp"
                android:layout_marginEnd="16dp"
                android:layout_gravity="bottom"
                android:layout_alignParentBottom="true"
                android:layout_marginBottom="4dp">

                <android.support.v7.widget.SearchView
                    android:id="@+id/homepage_searchbar"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:layout_collapseMode="parallax"
                    android:background="@color/console_fg"
                    android:layout_alignParentBottom="true" />

            </android.support.v7.widget.CardView>

            <ImageView
                android:id="@+id/backdrop"
                android:src="@drawable/bg_header"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                android:fitsSystemWindows="true"
                app:layout_collapseMode="pin" />

            <android.support.v7.widget.Toolbar
                android:id="@+id/material_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

</android.support.design.widget.CoordinatorLayout>
+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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:filemanager="http://schemas.android.com/apk/res/com.cyanogenmod.filemanager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar
        android:id="@+id/material_toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_collapseMode="pin" />

    <com.cyanogenmod.filemanager.ui.widgets.ScrimInsetsFrameLayout
        android:id="@+id/scrimInsetsFrameLayoutNavigation"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:insetForeground="@color/material_palette_blue_primary_dark">

        <!-- The main content view -->
        <LinearLayout
            android:id="@+id/navigation_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <!-- Navigation View -->
            <com.cyanogenmod.filemanager.ui.widgets.NavigationView
                android:id="@+id/navigation_view"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                filemanager:navigation="browsable"/>

            <ListView
                android:background="@android:color/white"
                android:id="@+id/lv_easy_mode"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:visibility="gone"/>

            <!-- SelectionBar -->
            <com.cyanogenmod.filemanager.ui.widgets.SelectionView
                android:id="@+id/navigation_selectionbar"
                android:layout_width="match_parent"
                android:layout_height="@dimen/small_row_height"
                android:background="@drawable/bg_material_selectionbar"
                android:visibility="invisible"/>

            <!-- StatusBar -->
            <include layout="@layout/navigation_view_statusbar"/>

        </LinearLayout>

    </com.cyanogenmod.filemanager.ui.widgets.ScrimInsetsFrameLayout>

</LinearLayout>
Loading