This change enabled the theme support, and added a new dark theme under the package
CMFileManagerThemes. To compile under build system, it must be enabled in
vendor/cm/config/common.mk or vendor/cm/config/themes_common.mk (this was
requested in change http://review.cyanogenmod.org/#/c/26311/)
Themes were enabled in a new settings option. Under this setting the application
show the user the available themes installed in the system.
--------------------
For build new themes, developers should:
- Create a new package that contains an activity with:
* Permission: com.cyanogenmod.filemanager.permissions.READ_THEME
* Action: com.cyanogenmod.filemanager.actions.MAIN_THEME
* Category: com.cyanogenmod.filemanager.categories.THEME
- Define the themes_ids, themes_names and themes_descriptions arrays-strings
definitions for the themes that the package support.
- Create a xxx_theme.xml for every theme that the package support, where the
xxx is the id of the theme. Put your resources in this file, prefixing the
resource with the id of the theme (xxx_). For a list of all supported
resources see theme.xml in res/values of CMFileManager project.
-------------------
Other fixes:
* Protect console buffers from NPE
* Fix code style of xmls (layouts, drawables, ...)
Patchset 2: Fixed code style and added Christian suggestion
Patchset 3: Added forgotten READ_THEME permission check as described in the
note above.
Patchset 4: Use centerInside in theme preview for better image fit
Change-Id: I4142da6d9ed1b06318e47ff9c05f9a874c62f3ae
<?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.
--->
+<!-- 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.
+ -->
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyanogenmod.filemanager"
- android:versionCode="100"
- android:versionName="1.0.0">
+ android:versionCode="101"
+ android:versionName="1.0.1">
<original-package android:name="com.cyanogenmod.filemanager" />
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.NFC"/>
+ <uses-permission android:name="com.cyanogenmod.filemanager.permissions.READ_THEME"/>
<application
android:name="FileManagerApplication"
CyanogenMod File Manager
========================
+Version 1.0.1
+-------------
+* NFC support
+* Themes support
+
Version 1.0.0
-------------
Initial release.
* Open and Open With
* Send to
* Internal editor
+
-keep public class * extends android.preference.PreferenceFragment {
public <init>(...);
}
+-keep public class * extends android.preference.Preference {
+ public <init>(...);
+}
<?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.
--->
+<!-- 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.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
<item
android:drawable="@drawable/btn_holo_light_check_off_normal"/>
-</selector>
\ No newline at end of file
+</selector>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_app"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_audio"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_binary"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_calendar"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_cdimage"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_compress"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_contact"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_database"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_document"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_ebook"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_email"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_executable"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_feed"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_font"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_image"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_markup_document"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_pdf"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_presentation"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_security"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_shell"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_source"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_spreadsheet"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_system"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_text"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
<?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.\r
--->
+<!-- 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.
+ -->
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_fso_default"/>
<item android:drawable="@drawable/ic_fso_type_video"/>
-</layer-list>
\ No newline at end of file
+</layer-list>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@color/default_background"/>
+
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@color/blue_transparent"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector>
+++ /dev/null
-<?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.
--->
-<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
-
- <item
- android:drawable="@color/blue_transparent"
- android:state_selected="true"/>
- <item
- android:drawable="@android:color/holo_blue_dark"
- android:state_pressed="true"/>
- <item
- android:drawable="@android:color/holo_blue_light"
- android:state_enabled="true"
- android:state_focused="true"/>
- <item
- android:drawable="@color/default_background"/>
-
-</selector>
\ No newline at end of file
<?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.
--->
+<!-- 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.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
<item
android:drawable="@color/blue_transparent"/>
-</selector>
\ No newline at end of file
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@color/blue_transparent"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@drawable/bg_holo_popup_background"/>
+
+</selector>
<?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.
--->
+<!-- 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.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
<item
android:drawable="@android:color/transparent"/>
-</selector>
\ No newline at end of file
+</selector>
<?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.
--->
+<!-- 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.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
<item
android:drawable="@android:color/transparent"/>
-</selector>
\ No newline at end of file
+</selector>
<?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.
--->
+<!-- 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.
+ -->
+
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
<item
android:drawable="@android:color/transparent"/>
-</selector>
\ No newline at end of file
+</selector>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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
+ 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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:id="@android:id/background"
+ android:drawable="@drawable/progress_bg_holo_light" />
+
+ <item android:id="@android:id/secondaryProgress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_secondary_holo_light" />
+ </item>
+
+ <item android:id="@android:id/progress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_primary_holo_light" />
+ </item>
+
+</layer-list>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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
+ 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.
+-->
+
+<com.cyanogenmod.filemanager.ui.preferences.ThemeView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="1dp"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <RelativeLayout
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="0.5">
+ <TextView
+ android:id="@+id/theme_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance" />
+
+ <TextView
+ android:id="@+id/theme_author"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/theme_name"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance_nohighlight" />
+
+ <TextView
+ android:id="@+id/theme_desc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:maxLines="4"
+ android:textAppearance="@style/secondary_text_appearance" />
+ </RelativeLayout>
+
+ <ImageView
+ android:id="@+id/theme_preview"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="0.5"
+ android:padding="@dimen/default_margin"
+ android:layout_gravity="center"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+ </LinearLayout>
+
+</com.cyanogenmod.filemanager.ui.preferences.ThemeView>
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/editor_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
+ android:id="@+id/execution_script_name_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
+ android:id="@+id/execution_time_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:textAppearance="@style/secondary_text_appearance" />
<TextView
+ android:id="@+id/execution_exitcode_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
</ScrollView>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
android:orientation="vertical" >
<LinearLayout
+ android:id="@+id/filesystem_info_dialog_tabhost"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
android:orientation="horizontal" >
android:textAllCaps="true"
android:textAppearance="@style/primary_text_appearance" />
- <include layout="@layout/horizontal_divider" />
+ <include
+ android:id="@+id/filesystem_info_dialog_tab_divider1"
+ layout="@layout/horizontal_divider" />
<TextView
android:id="@+id/filesystem_info_dialog_tab_disk_usage"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
- <include layout="@layout/vertical_divider" />
+ <include
+ android:id="@+id/filesystem_info_dialog_tab_divider2"
+ layout="@layout/vertical_divider" />
</LinearLayout>
</LinearLayout>
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_status_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_mount_point_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_device_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_type_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_options_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_dump_pass_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_total_disk_usage_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_used_disk_usage_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/filesystem_info_free_disk_usage_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
</TableLayout>
</LinearLayout>
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
android:layout_height="wrap_content" >
<LinearLayout
+ android:id="@+id/fso_properties_dialog_tabhost"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height" >
android:textAllCaps="true"
android:textAppearance="@style/primary_text_appearance" />
- <include layout="@layout/horizontal_divider" />
+ <include
+ android:id="@+id/fso_properties_dialog_tab_divider1"
+ layout="@layout/horizontal_divider" />
<TextView
android:id="@+id/fso_properties_dialog_tab_permissions"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
- <include layout="@layout/vertical_divider" />
+ <include
+ android:id="@+id/fso_properties_dialog_tab_divider2"
+ layout="@layout/vertical_divider" />
</LinearLayout>
</TableLayout>
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_name_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_parent_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_type_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_category_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:visibility="gone" >
<TextView
+ android:id="@+id/fso_properties_link_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_size_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:visibility="gone" >
<TextView
+ android:id="@+id/fso_properties_contains_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_date_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:singleLine="false"
android:textAppearance="@style/secondary_text_appearance" />
</TableRow>
-
- <!-- Info message -->
- <TextView
- android:id="@+id/fso_properties_msg"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_marginLeft="@dimen/extra_large_margin"
- android:layout_marginRight="@dimen/extra_large_margin"
- android:contentDescription="@null"
- android:drawableLeft="@drawable/ic_holo_light_fs_warning"
- android:drawablePadding="@dimen/default_margin"
- android:gravity="left|center_vertical"
- android:singleLine="false"
- android:text="@null"
- android:textAppearance="@style/secondary_text_appearance"
- android:textSize="@dimen/note_text_size"
- android:visibility="gone" />
</TableLayout>
</ScrollView>
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_owner_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_group_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" >
- <include layout="@layout/vertical_divider" />
+ <include
+ android:id="@+id/fso_properties_dialog_tab_divider3"
+ layout="@layout/vertical_divider" />
</LinearLayout>
<!-- Permissions -->
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_special_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_read_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_write_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="@style/primary_text_appearance" />
<TextView
+ android:id="@+id/fso_properties_permissions_execute_label"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_permissions_owner_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_permissions_group_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="@dimen/extra_large_margin" >
<TextView
+ android:id="@+id/fso_properties_permissions_others_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
</LinearLayout>
</ScrollView>
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
limitations under the License.
-->
+<!-- The layout_height must hardcode here from @dimen/default_row_height, because
+ it is not resolved in themed context, because theme context and app context are
+ not the same -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:layout_height="48dp"
+ android:background="@drawable/holo_list_selector_deselected" >
<TextView
android:id="@+id/menu_item_text"
android:singleLine="true"
android:textAppearance="@style/primary_text_appearance_nohighlight" />
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
limitations under the License.
-->
+<!-- The layout_height must hardcode here from @dimen/vertical_divider_height, because
+ it is not resolved in themed context, because theme context and app context are
+ not the same -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="@dimen/vertical_divider_height">
+ android:layout_height="0.75dp">
<TextView
android:id="@+id/menu_item_text"
android:layout_width="match_parent"
android:layout_height="match_parent" />
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
android:text="@null"
android:textAppearance="@style/secondary_text_appearance"
android:textStyle="normal"
- android:layout_marginBottom="@dimen/extra_margin" />
+ android:paddingBottom="@dimen/extra_margin" />
</RelativeLayout>
android:id="@+id/navigation_selectionbar"
android:layout_width="match_parent"
android:layout_height="@dimen/small_row_height"
+ android:background="@drawable/bg_holo_selectionbar"
android:visibility="invisible" />
<!-- StatusBar -->
android:id="@+id/navigation_view_details_item"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:background="@drawable/holo_list_selector_deselected" >
<com.cyanogenmod.filemanager.ui.widgets.TransparentNonFocusableButtonItem
android:id="@+id/navigation_view_item_check"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/bg_holo_selectionbar"
android:orientation="horizontal" >
<com.cyanogenmod.filemanager.ui.widgets.ButtonItem
android:id="@+id/navigation_view_details_item"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:background="@drawable/holo_list_selector_deselected" >
<com.cyanogenmod.filemanager.ui.widgets.TransparentNonFocusableButtonItem
android:id="@+id/navigation_view_item_check"
limitations under the License.
-->
+<!-- The layout_height must hardcode here from @dimen/default_row_height, because
+ it is not resolved in themed context, because theme context and app context are
+ not the same -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="@dimen/default_row_height"
+ android:layout_height="48dp"
android:background="@drawable/holo_selector" >
<ImageView
android:id="@+id/search_item"
android:layout_width="match_parent"
android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deseleted" >
+ android:background="@drawable/holo_list_selector_deselected" >
<ImageView
android:id="@+id/search_item_icon"
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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
+ 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/theme_roulette_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <View
+ android:id="@+id/spacer1"
+ android:layout_width="1dp"
+ android:layout_height="match_parent" />
+
+ <!-- Roulette views goes here -->
+
+ <View
+ android:id="@+id/spacer2"
+ android:layout_width="1dp"
+ android:layout_height="match_parent" />
+
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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
+ 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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:padding="@dimen/extra_margin">
+
+ <!-- Required by Preference. Not used -->
+ <TextView android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+ <!-- Required by Preference. Not used -->
+ <TextView android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+ <!-- Required by Preference. Not used -->
+ <LinearLayout android:id="@android:id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+
+ <!-- THEME PREFERENCE LAYOUT -->
+
+ <Button
+ android:id="@+id/theme_button"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/default_row_height"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="@dimen/default_margin"
+ android:text="@string/pref_themes_set_theme"
+ android:enabled="false" />
+
+ <!-- Theme roulette -->
+ <com.cyanogenmod.filemanager.ui.preferences.ThemeRoulette
+ android:id="@+id/theme_roulette"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentTop="true"
+ android:layout_above="@id/theme_button"
+ android:scrollbars="none" />
+
+ <ProgressBar
+ android:id="@+id/theme_waiting"
+ android:layout_width="@dimen/default_row_height"
+ android:layout_height="@dimen/default_row_height"
+ android:layout_above="@id/theme_button"
+ android:layout_alignParentTop="true"
+ android:layout_centerInParent="true"
+ android:indeterminate="true"
+ android:indeterminateOnly="true"
+ android:visibility="gone" />
+
+</RelativeLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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
+ 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.
+-->
+
+<com.cyanogenmod.filemanager.ui.preferences.ThemeView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="1dp"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/theme_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance" />
+
+ <TextView
+ android:id="@+id/theme_author"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/theme_name"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance_nohighlight" />
+
+ <TextView
+ android:id="@+id/theme_desc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:gravity="center"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:maxLines="2"
+ android:textAppearance="@style/secondary_text_appearance" />
+
+ <ImageView
+ android:id="@+id/theme_preview"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@id/theme_desc"
+ android:layout_below="@id/theme_author"
+ android:padding="@dimen/extra_large_margin"
+ android:layout_gravity="center"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+
+</com.cyanogenmod.filemanager.ui.preferences.ThemeView>
CyanogenMod File Manager
========================
+Version 1.0.1
+-------------
+* NFC support
+* Themes support
+
Version 1.0.0
-------------
Initial release.
* Open and Open With
* Send to
* Internal editor
+
#
# Binary
-a = BINARY | application/octet-stream | fso_type_binary
-bin = BINARY | application/octet-stream | fso_type_binary
-class = BINARY | application/java-vm | fso_type_binary
-com = BINARY | application/x-msdownload | fso_type_binary
-dex = BINARY | application/octet-stream | fso_type_binary
-dump = BINARY | application/octet-stream | fso_type_binary
-exe = BINARY | application/x-msdownload | fso_type_binary
-dat = BINARY | application/octet-stream | fso_type_binary
-dll = BINARY | application/x-msdownload | fso_type_binary
-lib = BINARY | application/x-msdownload | fso_type_binary
-o = BINARY | application/octet-stream | fso_type_binary
-obj = BINARY | application/octet-stream | fso_type_binary
-pyc = BINARY | application/x-python-code | fso_type_binary
-pyo = BINARY | application/x-python-code | fso_type_binary
-ser = BINARY | application/java-serialized-object | fso_type_binary
-swf = BINARY | application/x-shockwave-flash | fso_type_binary
-so = BINARY | application/octet-stream | fso_type_binary
-dmg = BINARY | application/octet-stream | fso_type_cdimage
-cue = BINARY | application/octet-stream | fso_type_cdimage
-img = BINARY | application/octet-stream | fso_type_cdimage
-iso = BINARY | application/octet-stream | fso_type_cdimage
-msd = BINARY | application/octet-stream | fso_type_cdimage
-nrg = BINARY | application/octet-stream | fso_type_cdimage
-uif = BINARY | application/octet-stream | fso_type_cdimage
+a = BINARY | application/octet-stream | fso_type_binary_drawable
+bin = BINARY | application/octet-stream | fso_type_binary_drawable
+class = BINARY | application/java-vm | fso_type_binary_drawable
+com = BINARY | application/x-msdownload | fso_type_binary_drawable
+dex = BINARY | application/octet-stream | fso_type_binary_drawable
+dump = BINARY | application/octet-stream | fso_type_binary_drawable
+exe = BINARY | application/x-msdownload | fso_type_binary_drawable
+dat = BINARY | application/octet-stream | fso_type_binary_drawable
+dll = BINARY | application/x-msdownload | fso_type_binary_drawable
+lib = BINARY | application/x-msdownload | fso_type_binary_drawable
+o = BINARY | application/octet-stream | fso_type_binary_drawable
+obj = BINARY | application/octet-stream | fso_type_binary_drawable
+pyc = BINARY | application/x-python-code | fso_type_binary_drawable
+pyo = BINARY | application/x-python-code | fso_type_binary_drawable
+ser = BINARY | application/java-serialized-object | fso_type_binary_drawable
+swf = BINARY | application/x-shockwave-flash | fso_type_binary_drawable
+so = BINARY | application/octet-stream | fso_type_binary_drawable
+dmg = BINARY | application/octet-stream | fso_type_cdimage_drawable
+cue = BINARY | application/octet-stream | fso_type_cdimage_drawable
+img = BINARY | application/octet-stream | fso_type_cdimage_drawable
+iso = BINARY | application/octet-stream | fso_type_cdimage_drawable
+msd = BINARY | application/octet-stream | fso_type_cdimage_drawable
+nrg = BINARY | application/octet-stream | fso_type_cdimage_drawable
+uif = BINARY | application/octet-stream | fso_type_cdimage_drawable
# Text
-asm = TEXT | text/x-asm | fso_type_source
-c = TEXT | text/x-c | fso_type_source
-cc = TEXT | text/x-c | fso_type_source
-conf = TEXT | text/plain | fso_type_text
-cpp = TEXT | text/x-c | fso_type_source
-css = TEXT | text/css | fso_type_source
-csv = TEXT | text/csv | fso_type_text
-cxx = TEXT | text/x-c | fso_type_source
-def = TEXT | text/plain | fso_type_source
-dic = TEXT | text/x-c | fso_type_source
-diff = TEXT | text/plain | fso_type_text
-dtd = TEXT | application/xml-dtd | fso_type_markup_document
-f = TEXT | text/x-fortran | fso_type_source
-f77 = TEXT | text/x-fortran | fso_type_source
-f90 = TEXT | text/x-fortran | fso_type_source
-for = TEXT | text/x-fortran | fso_type_source
-h = TEXT | text/x-c | fso_type_source
-hh = TEXT | text/x-c | fso_type_source
-hpp = TEXT | text/x-c | fso_type_source
-htm = TEXT | text/html | fso_type_markup_document
-html = TEXT | text/html | fso_type_markup_document
-in = TEXT | text/plain | fso_type_text
-jad = TEXT | text/vnd.sun.j2me.app-descriptor | fso_type_source
-java = TEXT | text/x-java-source | fso_type_source
-jnlp = TEXT | application/x-java-jnlp-file | fso_type_source
-js = TEXT | application/javascript | fso_type_source
-json = TEXT | application/json | fso_type_source
-list = TEXT | text/plain | fso_type_text
-log = TEXT | text/plain | fso_type_text
-mathml= TEXT | application/mathml+xml | fso_type_markup_document
-mht = TEXT | message/rfc822 | fso_type_markup_document
-mhtml = TEXT | message/rfc822 | fso_type_markup_document
-mxml = TEXT | application/xv+xml | fso_type_markup_document
-p = TEXT | text/x-pascal | fso_type_source
-pas = TEXT | text/x-pascal | fso_type_source
-pl = TEXT | text/plain | fso_type_source
-prop = TEXT | text/plain | fso_type_text
-properties = TEXT| text/plain | fso_type_text
-py = TEXT | text/x-python | fso_type_source
-rc = TEXT | text/plain | fso_type_text
-rss = TEXT | application/rss+xml | fso_type_feed
-s = TEXT | text/x-asm | fso_type_source
-sgm = TEXT | text/sgml | fso_type_markup_document
-sgml = TEXT | text/sgml | fso_type_markup_document
-text = TEXT | text/plain | fso_type_text
-tsv = TEXT | text/tab-separated-values | fso_type_text
-txt = TEXT | text/plain | fso_type_text
-wsdl = TEXT | application/wsdl+xml | fso_type_markup_document
-xht = TEXT | application/xhtml+xml | fso_type_markup_document
-xhtml = TEXT | application/xhtml+xml | fso_type_markup_document
-xml = TEXT | text/plain | fso_type_markup_document
-xsl = TEXT | application/xml | fso_type_markup_document
-xslt = TEXT | application/xslt+xml | fso_type_markup_document
+asm = TEXT | text/x-asm | fso_type_source_drawable
+c = TEXT | text/x-c | fso_type_source_drawable
+cc = TEXT | text/x-c | fso_type_source_drawable
+conf = TEXT | text/plain | fso_type_text_drawable
+cpp = TEXT | text/x-c | fso_type_source_drawable
+css = TEXT | text/css | fso_type_source_drawable
+csv = TEXT | text/csv | fso_type_text_drawable
+cxx = TEXT | text/x-c | fso_type_source_drawable
+def = TEXT | text/plain | fso_type_source_drawable
+dic = TEXT | text/x-c | fso_type_source_drawable
+diff = TEXT | text/plain | fso_type_text_drawable
+dtd = TEXT | application/xml-dtd | fso_type_markup_document_drawable
+f = TEXT | text/x-fortran | fso_type_source_drawable
+f77 = TEXT | text/x-fortran | fso_type_source_drawable
+f90 = TEXT | text/x-fortran | fso_type_source_drawable
+for = TEXT | text/x-fortran | fso_type_source_drawable
+h = TEXT | text/x-c | fso_type_source_drawable
+hh = TEXT | text/x-c | fso_type_source_drawable
+hpp = TEXT | text/x-c | fso_type_source_drawable
+htm = TEXT | text/html | fso_type_markup_document_drawable
+html = TEXT | text/html | fso_type_markup_document_drawable
+in = TEXT | text/plain | fso_type_text_drawable
+jad = TEXT | text/vnd.sun.j2me.app-descriptor | fso_type_source_drawable
+java = TEXT | text/x-java-source | fso_type_source_drawable
+jnlp = TEXT | application/x-java-jnlp-file | fso_type_source_drawable
+js = TEXT | application/javascript | fso_type_source_drawable
+json = TEXT | application/json | fso_type_source_drawable
+list = TEXT | text/plain | fso_type_text_drawable
+log = TEXT | text/plain | fso_type_text_drawable
+mathml= TEXT | application/mathml+xml | fso_type_markup_document_drawable
+mht = TEXT | message/rfc822 | fso_type_markup_document_drawable
+mhtml = TEXT | message/rfc822 | fso_type_markup_document_drawable
+mxml = TEXT | application/xv+xml | fso_type_markup_document_drawable
+p = TEXT | text/x-pascal | fso_type_source_drawable
+pas = TEXT | text/x-pascal | fso_type_source_drawable
+pl = TEXT | text/plain | fso_type_source_drawable
+prop = TEXT | text/plain | fso_type_text_drawable
+properties = TEXT| text/plain | fso_type_text_drawable
+py = TEXT | text/x-python | fso_type_source_drawable
+rc = TEXT | text/plain | fso_type_text_drawable
+rss = TEXT | application/rss+xml | fso_type_feed_drawable
+s = TEXT | text/x-asm | fso_type_source_drawable
+sgm = TEXT | text/sgml | fso_type_markup_document_drawable
+sgml = TEXT | text/sgml | fso_type_markup_document_drawable
+text = TEXT | text/plain | fso_type_text_drawable
+tsv = TEXT | text/tab-separated-values | fso_type_text_drawable
+txt = TEXT | text/plain | fso_type_text_drawable
+wsdl = TEXT | application/wsdl+xml | fso_type_markup_document_drawable
+xht = TEXT | application/xhtml+xml | fso_type_markup_document_drawable
+xhtml = TEXT | application/xhtml+xml | fso_type_markup_document_drawable
+xml = TEXT | text/plain | fso_type_markup_document_drawable
+xsl = TEXT | application/xml | fso_type_markup_document_drawable
+xslt = TEXT | application/xslt+xml | fso_type_markup_document_drawable
# Document
-doc = DOCUMENT | application/msword | fso_type_document
-docx = DOCUMENT | application/vnd.openxmlformats-officedocument.wordprocessingml.document | fso_type_document
-fdf = DOCUMENT | application/vnd.fdf | fso_type_pdf
-pdf = DOCUMENT | application/pdf | fso_type_pdf
-ppt = DOCUMENT | application/vnd.ms-powerpoint | fso_type_presentation
-pptx = DOCUMENT | application/vnd.openxmlformats-officedocument.presentationml.presentation | fso_type_presentation
-odp = DOCUMENT | application/vnd.oasis.opendocument.presentation | fso_type_presentation
-ods = DOCUMENT | application/vnd.oasis.opendocument.spreadsheet | fso_type_spreadsheet
-odt = DOCUMENT | application/vnd.oasis.opendocument.text | fso_type_document
-rtf = DOCUMENT | application/rtf | fso_type_document
-xls = DOCUMENT | application/vnd.ms-excel | fso_type_spreadsheet
-xlsx = DOCUMENT | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | fso_type_spreadsheet
+doc = DOCUMENT | application/msword | fso_type_document_drawable
+docx = DOCUMENT | application/vnd.openxmlformats-officedocument.wordprocessingml.document | fso_type_document_drawable
+fdf = DOCUMENT | application/vnd.fdf | fso_type_pdf_drawable
+pdf = DOCUMENT | application/pdf | fso_type_pdf_drawable
+ppt = DOCUMENT | application/vnd.ms-powerpoint | fso_type_presentation_drawable
+pptx = DOCUMENT | application/vnd.openxmlformats-officedocument.presentationml.presentation | fso_type_presentation_drawable
+odp = DOCUMENT | application/vnd.oasis.opendocument.presentation | fso_type_presentation_drawable
+ods = DOCUMENT | application/vnd.oasis.opendocument.spreadsheet | fso_type_spreadsheet_drawable
+odt = DOCUMENT | application/vnd.oasis.opendocument.text | fso_type_document_drawable
+rtf = DOCUMENT | application/rtf | fso_type_document_drawable
+xls = DOCUMENT | application/vnd.ms-excel | fso_type_spreadsheet_drawable
+xlsx = DOCUMENT | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | fso_type_spreadsheet_drawable
# e-Book
-azw = EBOOK | application/octet-stream | fso_type_ebook
-djv = EBOOK | image/x-djvu | fso_type_ebook
-djvu = EBOOK | image/vnd.djvu | fso_type_ebook
-epub = EBOOK | application/epub+zip | fso_type_ebook
-kf8 = EBOOK | application/octet-stream | fso_type_ebook
-lit = EBOOK | application/x-ms-reader | fso_type_ebook
-lrf = EBOOK | application/x-sony-bbeb | fso_type_ebook
-lrx = EBOOK | application/x-sony-bbeb | fso_type_ebook
-ibooks= EBOOK | application/x-ibooks+zip | fso_type_ebook
+azw = EBOOK | application/octet-stream | fso_type_ebook_drawable
+djv = EBOOK | image/x-djvu | fso_type_ebook_drawable
+djvu = EBOOK | image/vnd.djvu | fso_type_ebook_drawable
+epub = EBOOK | application/epub+zip | fso_type_ebook_drawable
+kf8 = EBOOK | application/octet-stream | fso_type_ebook_drawable
+lit = EBOOK | application/x-ms-reader | fso_type_ebook_drawable
+lrf = EBOOK | application/x-sony-bbeb | fso_type_ebook_drawable
+lrx = EBOOK | application/x-sony-bbeb | fso_type_ebook_drawable
+ibooks= EBOOK | application/x-ibooks+zip | fso_type_ebook_drawable
# Internet document
-ics = MAIL | text/calendar | fso_type_calendar
-ifb = MAIL | text/calendar | fso_type_calendar
-eml = MAIL | message/rfc822 | fso_type_email
-msg = MAIL | application/vnd.ms-outlook | fso_type_email
-vcf = MAIL | text/x-vcard | fso_type_contact
-vcs = MAIL | text/x-vcalendar | fso_type_calendar
+ics = MAIL | text/calendar | fso_type_calendar_drawable
+ifb = MAIL | text/calendar | fso_type_calendar_drawable
+eml = MAIL | message/rfc822 | fso_type_email_drawable
+msg = MAIL | application/vnd.ms-outlook | fso_type_email_drawable
+vcf = MAIL | text/x-vcard | fso_type_contact_drawable
+vcs = MAIL | text/x-vcalendar | fso_type_calendar_drawable
# Compress
-ace = COMPRESS | application/x-ace-compressed | fso_type_compress
-bz = COMPRESS | application/x-bzip | fso_type_compress
-bz2 = COMPRESS | application/x-bzip2 | fso_type_compress
-cab = COMPRESS | application/vnd.ms-cab-compressed| fso_type_compress
-cpio = COMPRESS | application/x-cpio | fso_type_compress
-gz = COMPRESS | application/x-gzip | fso_type_compress
-lha = COMPRESS | application/octet-stream | fso_type_compress
-lrf = COMPRESS | application/octet-stream | fso_type_compress
-lzh = COMPRESS | application/octet-stream | fso_type_compress
-lzma = COMPRESS | application/x-lzma | fso_type_compress
-jar = COMPRESS | application/java-archive | fso_type_compress
-rar = COMPRESS | application/x-rar-compressed | fso_type_compress
-tar = COMPRESS | application/x-tar | fso_type_compress
-tar.bz2 = COMPRESS| application/x-bzip | fso_type_compress
-tar.gz = COMPRESS| application/x-gzip | fso_type_compress
-tar.lzma = COMPRESS| application/x-lzma | fso_type_compress
-tgz = COMPRESS | application/x-gzip | fso_type_compress
-xz = COMPRESS | application/x-xz | fso_type_compress
-zip = COMPRESS | application/zip | fso_type_compress
-Z = COMPRESS | application/x-compress | fso_type_compress
+ace = COMPRESS | application/x-ace-compressed | fso_type_compress_drawable
+bz = COMPRESS | application/x-bzip | fso_type_compress_drawable
+bz2 = COMPRESS | application/x-bzip2 | fso_type_compress_drawable
+cab = COMPRESS | application/vnd.ms-cab-compressed| fso_type_compress_drawable
+cpio = COMPRESS | application/x-cpio | fso_type_compress_drawable
+gz = COMPRESS | application/x-gzip | fso_type_compress_drawable
+lha = COMPRESS | application/octet-stream | fso_type_compress_drawable
+lrf = COMPRESS | application/octet-stream | fso_type_compress_drawable
+lzh = COMPRESS | application/octet-stream | fso_type_compress_drawable
+lzma = COMPRESS | application/x-lzma | fso_type_compress_drawable
+jar = COMPRESS | application/java-archive | fso_type_compress_drawable
+rar = COMPRESS | application/x-rar-compressed | fso_type_compress_drawable
+tar = COMPRESS | application/x-tar | fso_type_compress_drawable
+tar.bz2 = COMPRESS| application/x-bzip | fso_type_compress_drawable
+tar.gz = COMPRESS| application/x-gzip | fso_type_compress_drawable
+tar.lzma = COMPRESS| application/x-lzma | fso_type_compress_drawable
+tgz = COMPRESS | application/x-gzip | fso_type_compress_drawable
+xz = COMPRESS | application/x-xz | fso_type_compress_drawable
+zip = COMPRESS | application/zip | fso_type_compress_drawable
+Z = COMPRESS | application/x-compress | fso_type_compress_drawable
# Executable
-bat = EXEC | application/x-msdownload | fso_type_shell
-csh = EXEC | application/x-csh | fso_type_shell
-ksh = EXEC | text/plain | fso_type_shell
-sh = EXEC | application/x-sh | fso_type_shell
+bat = EXEC | application/x-msdownload | fso_type_shell_drawable
+csh = EXEC | application/x-csh | fso_type_shell_drawable
+ksh = EXEC | text/plain | fso_type_shell_drawable
+sh = EXEC | application/x-sh | fso_type_shell_drawable
# Database
-db = DATABASE | application/octet-stream | fso_type_database
-db3 = DATABASE | application/octet-stream | fso_type_database
-mdb = DATABASE | application/octet-stream | fso_type_database
+db = DATABASE | application/octet-stream | fso_type_database_drawable
+db3 = DATABASE | application/octet-stream | fso_type_database_drawable
+mdb = DATABASE | application/octet-stream | fso_type_database_drawable
# Font
-otf = FONT | application/x-font-otf | fso_type_font
-ttf = FONT | application/x-font-ttf | fso_type_font
-gsf = FONT | application/x-font-ghostscript | fso_type_font
-psf = FONT | application/x-font-linux-psf | fso_type_font
+otf = FONT | application/x-font-otf | fso_type_font_drawable
+ttf = FONT | application/x-font-ttf | fso_type_font_drawable
+gsf = FONT | application/x-font-ghostscript | fso_type_font_drawable
+psf = FONT | application/x-font-linux-psf | fso_type_font_drawable
# Image
-bmp = IMAGE | image/bmp | fso_type_image
-cgm = IMAGE | image/cgm | fso_type_image
-g3 = IMAGE | image/g3fax | fso_type_image
-gif = IMAGE | image/gif | fso_type_image
-ief = IMAGE | image/ief | fso_type_image
-jpe = IMAGE | image/jpeg | fso_type_image
-jpeg = IMAGE | image/jpeg | fso_type_image
-jpg = IMAGE | image/jpeg | fso_type_image
-png = IMAGE | image/png | fso_type_image
-btif = IMAGE | image/prs.btif | fso_type_image
-svg = IMAGE | image/svg+xml | fso_type_image
-svgz = IMAGE | image/svg+xml | fso_type_image
-tif = IMAGE | image/tiff | fso_type_image
-tiff = IMAGE | image/tiff | fso_type_image
-psd = IMAGE | image/vnd.adobe.photoshop | fso_type_image
-djv = IMAGE | image/vnd.djvu | fso_type_image
-djvu = IMAGE | image/vnd.djvu | fso_type_image
-dwg = IMAGE | image/vnd.dwg | fso_type_image
-dxf = IMAGE | image/vnd.dxf | fso_type_image
-fbs = IMAGE | image/vnd.fastbidsheet | fso_type_image
-fpx = IMAGE | image/vnd.fpx | fso_type_image
-fst = IMAGE | image/vnd.fst | fso_type_image
-mmr = IMAGE | image/vnd.fujixerox.edmics-mmr | fso_type_image
-rlc = IMAGE | image/vnd.fujixerox.edmics-rlc | fso_type_image
-mdi = IMAGE | image/vnd.ms-modi | fso_type_image
-npx = IMAGE | image/vnd.net-fpx | fso_type_image
-wbmp = IMAGE | image/vnd.wap.wbmp | fso_type_image
-xif = IMAGE | image/vnd.xiff | fso_type_image
-ras = IMAGE | image/x-cmu-raster | fso_type_image
-cmx = IMAGE | image/x-cmx | fso_type_image
-fh = IMAGE | image/x-freehand | fso_type_image
-fh4 = IMAGE | image/x-freehand | fso_type_image
-fh5 = IMAGE | image/x-freehand | fso_type_image
-fh7 = IMAGE | image/x-freehand | fso_type_image
-fhc = IMAGE | image/x-freehand | fso_type_image
-ico = IMAGE | image/x-icon | fso_type_image
-pcx = IMAGE | image/x-pcx | fso_type_image
-pct = IMAGE | image/x-pict | fso_type_image
-pic = IMAGE | image/x-pict | fso_type_image
-pnm = IMAGE | image/x-portable-anymap | fso_type_image
-pbm = IMAGE | image/x-portable-bitmap | fso_type_image
-pgm = IMAGE | image/x-portable-graymap | fso_type_image
-ppm = IMAGE | image/x-portable-pixmap | fso_type_image
-rgb = IMAGE | image/x-rgb | fso_type_image
-xbm = IMAGE | image/x-xbitmap | fso_type_image
-xpm = IMAGE | image/x-xpixmap | fso_type_image
-xwd = IMAGE | image/x-xwindowdump | fso_type_image
+bmp = IMAGE | image/bmp | fso_type_image_drawable
+cgm = IMAGE | image/cgm | fso_type_image_drawable
+g3 = IMAGE | image/g3fax | fso_type_image_drawable
+gif = IMAGE | image/gif | fso_type_image_drawable
+ief = IMAGE | image/ief | fso_type_image_drawable
+jpe = IMAGE | image/jpeg | fso_type_image_drawable
+jpeg = IMAGE | image/jpeg | fso_type_image_drawable
+jpg = IMAGE | image/jpeg | fso_type_image_drawable
+png = IMAGE | image/png | fso_type_image_drawable
+btif = IMAGE | image/prs.btif | fso_type_image_drawable
+svg = IMAGE | image/svg+xml | fso_type_image_drawable
+svgz = IMAGE | image/svg+xml | fso_type_image_drawable
+tif = IMAGE | image/tiff | fso_type_image_drawable
+tiff = IMAGE | image/tiff | fso_type_image_drawable
+psd = IMAGE | image/vnd.adobe.photoshop | fso_type_image_drawable
+djv = IMAGE | image/vnd.djvu | fso_type_image_drawable
+djvu = IMAGE | image/vnd.djvu | fso_type_image_drawable
+dwg = IMAGE | image/vnd.dwg | fso_type_image_drawable
+dxf = IMAGE | image/vnd.dxf | fso_type_image_drawable
+fbs = IMAGE | image/vnd.fastbidsheet | fso_type_image_drawable
+fpx = IMAGE | image/vnd.fpx | fso_type_image_drawable
+fst = IMAGE | image/vnd.fst | fso_type_image_drawable
+mmr = IMAGE | image/vnd.fujixerox.edmics-mmr | fso_type_image_drawable
+rlc = IMAGE | image/vnd.fujixerox.edmics-rlc | fso_type_image_drawable
+mdi = IMAGE | image/vnd.ms-modi | fso_type_image_drawable
+npx = IMAGE | image/vnd.net-fpx | fso_type_image_drawable
+wbmp = IMAGE | image/vnd.wap.wbmp | fso_type_image_drawable
+xif = IMAGE | image/vnd.xiff | fso_type_image_drawable
+ras = IMAGE | image/x-cmu-raster | fso_type_image_drawable
+cmx = IMAGE | image/x-cmx | fso_type_image_drawable
+fh = IMAGE | image/x-freehand | fso_type_image_drawable
+fh4 = IMAGE | image/x-freehand | fso_type_image_drawable
+fh5 = IMAGE | image/x-freehand | fso_type_image_drawable
+fh7 = IMAGE | image/x-freehand | fso_type_image_drawable
+fhc = IMAGE | image/x-freehand | fso_type_image_drawable
+ico = IMAGE | image/x-icon | fso_type_image_drawable
+pcx = IMAGE | image/x-pcx | fso_type_image_drawable
+pct = IMAGE | image/x-pict | fso_type_image_drawable
+pic = IMAGE | image/x-pict | fso_type_image_drawable
+pnm = IMAGE | image/x-portable-anymap | fso_type_image_drawable
+pbm = IMAGE | image/x-portable-bitmap | fso_type_image_drawable
+pgm = IMAGE | image/x-portable-graymap | fso_type_image_drawable
+ppm = IMAGE | image/x-portable-pixmap | fso_type_image_drawable
+rgb = IMAGE | image/x-rgb | fso_type_image_drawable
+xbm = IMAGE | image/x-xbitmap | fso_type_image_drawable
+xpm = IMAGE | image/x-xpixmap | fso_type_image_drawable
+xwd = IMAGE | image/x-xwindowdump | fso_type_image_drawable
# Audio
-adp = AUDIO | audio/adpcm | fso_type_audio
-au = AUDIO | audio/basic | fso_type_audio
-snd = AUDIO | audio/basic | fso_type_audio
-kar = AUDIO | audio/midi | fso_type_audio
-mid = AUDIO | audio/midi | fso_type_audio
-midi = AUDIO | audio/midi | fso_type_audio
-rmi = AUDIO | audio/midi | fso_type_audio
-mp4a = AUDIO | audio/mp4 | fso_type_audio
-m2a = AUDIO | audio/mpeg | fso_type_audio
-m3a = AUDIO | audio/mpeg | fso_type_audio
-mp2 = AUDIO | audio/mpeg | fso_type_audio
-mp2a = AUDIO | audio/mpeg | fso_type_audio
-mp3 = AUDIO | audio/mpeg | fso_type_audio
-mpga = AUDIO | audio/mpeg | fso_type_audio
-oga = AUDIO | audio/ogg | fso_type_audio
-ogg = AUDIO | audio/ogg | fso_type_audio
-spx = AUDIO | audio/ogg | fso_type_audio
-eol = AUDIO | audio/vnd.digital-winds | fso_type_audio
-dts = AUDIO | audio/vnd.dts | fso_type_audio
-dtshd = AUDIO | audio/vnd.dts.hd | fso_type_audio
-lvp = AUDIO | audio/vnd.lucent.voice | fso_type_audio
-pya = AUDIO | audio/vnd.ms-playready.media.pya | fso_type_audio
-ecelp4800 = AUDIO| audio/vnd.nuera.ecelp4800 | fso_type_audio
-ecelp7470 = AUDIO| audio/vnd.nuera.ecelp7470 | fso_type_audio
-ecelp9600 = AUDIO| audio/vnd.nuera.ecelp9600 | fso_type_audio
-aac = AUDIO | audio/x-aac | fso_type_audio
-aif = AUDIO | audio/x-aiff | fso_type_audio
-aifc = AUDIO | audio/x-aiff | fso_type_audio
-aiff = AUDIO | audio/x-aiff | fso_type_audio
-m3u = AUDIO | audio/x-mpegurl | fso_type_audio
-wax = AUDIO | audio/x-ms-wax | fso_type_audio
-wma = AUDIO | audio/x-ms-wma | fso_type_audio
-ra = AUDIO | audio/x-pn-realaudio | fso_type_audio
-ram = AUDIO | audio/x-pn-realaudio | fso_type_audio
-rmp = AUDIO | audio/x-pn-realaudio-plugin | fso_type_audio
-wav = AUDIO | audio/x-wav | fso_type_audio
+adp = AUDIO | audio/adpcm | fso_type_audio_drawable
+au = AUDIO | audio/basic | fso_type_audio_drawable
+snd = AUDIO | audio/basic | fso_type_audio_drawable
+kar = AUDIO | audio/midi | fso_type_audio_drawable
+mid = AUDIO | audio/midi | fso_type_audio_drawable
+midi = AUDIO | audio/midi | fso_type_audio_drawable
+rmi = AUDIO | audio/midi | fso_type_audio_drawable
+mp4a = AUDIO | audio/mp4 | fso_type_audio_drawable
+m2a = AUDIO | audio/mpeg | fso_type_audio_drawable
+m3a = AUDIO | audio/mpeg | fso_type_audio_drawable
+mp2 = AUDIO | audio/mpeg | fso_type_audio_drawable
+mp2a = AUDIO | audio/mpeg | fso_type_audio_drawable
+mp3 = AUDIO | audio/mpeg | fso_type_audio_drawable
+mpga = AUDIO | audio/mpeg | fso_type_audio_drawable
+oga = AUDIO | audio/ogg | fso_type_audio_drawable
+ogg = AUDIO | audio/ogg | fso_type_audio_drawable
+spx = AUDIO | audio/ogg | fso_type_audio_drawable
+eol = AUDIO | audio/vnd.digital-winds | fso_type_audio_drawable
+dts = AUDIO | audio/vnd.dts | fso_type_audio_drawable
+dtshd = AUDIO | audio/vnd.dts.hd | fso_type_audio_drawable
+lvp = AUDIO | audio/vnd.lucent.voice | fso_type_audio_drawable
+pya = AUDIO | audio/vnd.ms-playready.media.pya | fso_type_audio_drawable
+ecelp4800 = AUDIO| audio/vnd.nuera.ecelp4800 | fso_type_audio_drawable
+ecelp7470 = AUDIO| audio/vnd.nuera.ecelp7470 | fso_type_audio_drawable
+ecelp9600 = AUDIO| audio/vnd.nuera.ecelp9600 | fso_type_audio_drawable
+aac = AUDIO | audio/x-aac | fso_type_audio_drawable
+aif = AUDIO | audio/x-aiff | fso_type_audio_drawable
+aifc = AUDIO | audio/x-aiff | fso_type_audio_drawable
+aiff = AUDIO | audio/x-aiff | fso_type_audio_drawable
+m3u = AUDIO | audio/x-mpegurl | fso_type_audio_drawable
+wax = AUDIO | audio/x-ms-wax | fso_type_audio_drawable
+wma = AUDIO | audio/x-ms-wma | fso_type_audio_drawable
+ra = AUDIO | audio/x-pn-realaudio | fso_type_audio_drawable
+ram = AUDIO | audio/x-pn-realaudio | fso_type_audio_drawable
+rmp = AUDIO | audio/x-pn-realaudio-plugin | fso_type_audio_drawable
+wav = AUDIO | audio/x-wav | fso_type_audio_drawable
# Video
-3gp = VIDEO | video/3gpp | fso_type_video
-3g2 = VIDEO | video/3gpp2 | fso_type_video
-h261 = VIDEO | video/h261 | fso_type_video
-h263 = VIDEO | video/h263 | fso_type_video
-h264 = VIDEO | video/h264 | fso_type_video
-jpgv = VIDEO | video/jpeg | fso_type_video
-jpgm = VIDEO | video/jpm | fso_type_video
-jpm = VIDEO | video/jpm | fso_type_video
-mj2 = VIDEO | video/mj2 | fso_type_video
-mjp2 = VIDEO | video/mj2 | fso_type_video
-mp4 = VIDEO | video/mp4 | fso_type_video
-mp4v = VIDEO | video/mp4 | fso_type_video
-mpg4 = VIDEO | video/mp4 | fso_type_video
-m1v = VIDEO | video/mpeg | fso_type_video
-m2v = VIDEO | video/mpeg | fso_type_video
-mpa = VIDEO | video/mpeg | fso_type_video
-mpe = VIDEO | video/mpeg | fso_type_video
-mpeg = VIDEO | video/mpeg | fso_type_video
-mpg = VIDEO | video/mpeg | fso_type_video
-ogv = VIDEO | video/ogg | fso_type_video
-mov = VIDEO | video/quicktime | fso_type_video
-qt = VIDEO | video/quicktime | fso_type_video
-fvt = VIDEO | video/vnd.fvt | fso_type_video
-m4u = VIDEO | video/vnd.mpegurl | fso_type_video
-mxu = VIDEO | video/vnd.mpegurl | fso_type_video
-pyv = VIDEO | video/vnd.ms-playready.media.pyv | fso_type_video
-viv = VIDEO | video/vnd.vivo | fso_type_video
-f4v = VIDEO | video/x-f4v | fso_type_video
-fli = VIDEO | video/x-fli | fso_type_video
-flv = VIDEO | video/x-flv | fso_type_video
-m4v = VIDEO | video/x-m4v | fso_type_video
-asf = VIDEO | video/x-ms-asf | fso_type_video
-asx = VIDEO | video/x-ms-asf | fso_type_video
-avi = VIDEO | video/x-msvideo | fso_type_video
-wm = VIDEO | video/x-ms-wm | fso_type_video
-wmv = VIDEO | video/x-ms-wmv | fso_type_video
-wmx = VIDEO | video/x-ms-wmx | fso_type_video
-wvx = VIDEO | video/x-ms-wvx | fso_type_video
-movie = VIDEO | video/x-sgi-movie | fso_type_video
+3gp = VIDEO | video/3gpp | fso_type_video_drawable
+3g2 = VIDEO | video/3gpp2 | fso_type_video_drawable
+h261 = VIDEO | video/h261 | fso_type_video_drawable
+h263 = VIDEO | video/h263 | fso_type_video_drawable
+h264 = VIDEO | video/h264 | fso_type_video_drawable
+jpgv = VIDEO | video/jpeg | fso_type_video_drawable
+jpgm = VIDEO | video/jpm | fso_type_video_drawable
+jpm = VIDEO | video/jpm | fso_type_video_drawable
+mj2 = VIDEO | video/mj2 | fso_type_video_drawable
+mjp2 = VIDEO | video/mj2 | fso_type_video_drawable
+mp4 = VIDEO | video/mp4 | fso_type_video_drawable
+mp4v = VIDEO | video/mp4 | fso_type_video_drawable
+mpg4 = VIDEO | video/mp4 | fso_type_video_drawable
+m1v = VIDEO | video/mpeg | fso_type_video_drawable
+m2v = VIDEO | video/mpeg | fso_type_video_drawable
+mpa = VIDEO | video/mpeg | fso_type_video_drawable
+mpe = VIDEO | video/mpeg | fso_type_video_drawable
+mpeg = VIDEO | video/mpeg | fso_type_video_drawable
+mpg = VIDEO | video/mpeg | fso_type_video_drawable
+ogv = VIDEO | video/ogg | fso_type_video_drawable
+mov = VIDEO | video/quicktime | fso_type_video_drawable
+qt = VIDEO | video/quicktime | fso_type_video_drawable
+fvt = VIDEO | video/vnd.fvt | fso_type_video_drawable
+m4u = VIDEO | video/vnd.mpegurl | fso_type_video_drawable
+mxu = VIDEO | video/vnd.mpegurl | fso_type_video_drawable
+pyv = VIDEO | video/vnd.ms-playready.media.pyv | fso_type_video_drawable
+viv = VIDEO | video/vnd.vivo | fso_type_video_drawable
+f4v = VIDEO | video/x-f4v | fso_type_video_drawable
+fli = VIDEO | video/x-fli | fso_type_video_drawable
+flv = VIDEO | video/x-flv | fso_type_video_drawable
+m4v = VIDEO | video/x-m4v | fso_type_video_drawable
+asf = VIDEO | video/x-ms-asf | fso_type_video_drawable
+asx = VIDEO | video/x-ms-asf | fso_type_video_drawable
+avi = VIDEO | video/x-msvideo | fso_type_video_drawable
+wm = VIDEO | video/x-ms-wm | fso_type_video_drawable
+wmv = VIDEO | video/x-ms-wmv | fso_type_video_drawable
+wmx = VIDEO | video/x-ms-wmx | fso_type_video_drawable
+wvx = VIDEO | video/x-ms-wvx | fso_type_video_drawable
+movie = VIDEO | video/x-sgi-movie | fso_type_video_drawable
# Security
-asc = SECURITY | application/pgp-signature | fso_type_security
-cer = SECURITY | application/pkix-cert | fso_type_security
-crl = SECURITY | application/pkix-crl | fso_type_security
-crt = SECURITY | application/x-x509-ca-cert | fso_type_security
-der = SECURITY | application/x-x509-ca-cert | fso_type_security
-p12 = SECURITY | application/x-pkcs12 | fso_type_security
-p7b = SECURITY | application/x-pkcs7-certificates | fso_type_security
-p7c = SECURITY | application/pkcs7-mime | fso_type_security
-p7m = SECURITY | application/pkcs7-mime | fso_type_security
-p7r = SECURITY | application/x-pkcs7-certreqresp | fso_type_security
-p7s = SECURITY | application/pkcs7-signature | fso_type_security
-p10 = SECURITY | application/pkcs10 | fso_type_security
-pfx = SECURITY | application/x-pkcs12 | fso_type_security
-pki = SECURITY | application/pkixcmp | fso_type_security
-pgp = SECURITY | application/pgp-encrypted | fso_type_security
-sig = SECURITY | application/pgp-signature | fso_type_security
-spc = SECURITY | application/x-pkcs7-certificates | fso_type_security
+asc = SECURITY | application/pgp-signature | fso_type_security_drawable
+cer = SECURITY | application/pkix-cert | fso_type_security_drawable
+crl = SECURITY | application/pkix-crl | fso_type_security_drawable
+crt = SECURITY | application/x-x509-ca-cert | fso_type_security_drawable
+der = SECURITY | application/x-x509-ca-cert | fso_type_security_drawable
+p12 = SECURITY | application/x-pkcs12 | fso_type_security_drawable
+p7b = SECURITY | application/x-pkcs7-certificates | fso_type_security_drawable
+p7c = SECURITY | application/pkcs7-mime | fso_type_security_drawable
+p7m = SECURITY | application/pkcs7-mime | fso_type_security_drawable
+p7r = SECURITY | application/x-pkcs7-certreqresp | fso_type_security_drawable
+p7s = SECURITY | application/pkcs7-signature | fso_type_security_drawable
+p10 = SECURITY | application/pkcs10 | fso_type_security_drawable
+pfx = SECURITY | application/x-pkcs12 | fso_type_security_drawable
+pki = SECURITY | application/pkixcmp | fso_type_security_drawable
+pgp = SECURITY | application/pgp-encrypted | fso_type_security_drawable
+sig = SECURITY | application/pgp-signature | fso_type_security_drawable
+spc = SECURITY | application/x-pkcs7-certificates | fso_type_security_drawable
# Application
-apk = APP | application/vnd.android.package-archive | fso_type_app
-pkg = APP | application/octet-stream | fso_type_app
-deb = APP | application/x-debian-package | fso_type_app
-udeb = APP | application/x-debian-package | fso_type_app
-msi = APP | application/x-msdownload | fso_type_app
-rpm = APP | application/x-rpm | fso_type_app
+apk = APP | application/vnd.android.package-archive | fso_type_app_drawable
+pkg = APP | application/octet-stream | fso_type_app_drawable
+deb = APP | application/x-debian-package | fso_type_app_drawable
+udeb = APP | application/x-debian-package | fso_type_app_drawable
+msi = APP | application/x-msdownload | fso_type_app_drawable
+rpm = APP | application/x-rpm | fso_type_app_drawable
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The strings of the menu for navigation sort mode enumeration -->
<item>@string/compression_mode_bzip</item>
</string-array>
+ <!-- The default theme definition -->
+ <string-array name="themes_ids" translatable="false">
+ <item>light</item>
+ </string-array>
+ <string-array name="themes_names" translatable="false">
+ <item>@string/theme_default_name</item>
+ </string-array>
+ <string-array name="themes_descriptions" translatable="false">
+ <item>@string/theme_default_description</item>
+ </string-array>
+
</resources>
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The default background color -->
<!-- Relevance * 75% ~ 100% -->
<color name="relevance_percentil_100">#be207da4</color>
+ <!-- A color for highlight text -->
+ <color name="search_highlight">#ffffff00</color>
+
<!-- Divider. Normal -->
<color name="divider_color">#90909090</color>
<!-- Divider. Light -->
<!-- The progress height -->
<dimen name="default_progress_height">32dp</dimen>
+ <!-- Theme button min width -->
+ <dimen name="themes_min_width_button">300dp</dimen>
+
+ <!-- Theme width -->
+ <dimen name="theme_max_width">300dip</dimen>
+
</resources>
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- The name of the application -->
<string name="pref_general">General settings</string>
<!-- Preferences * Search title -->
<string name="pref_search">Search options</string>
+ <!-- Preferences * Themes title -->
+ <string name="pref_themes">Themes</string>
<!-- Preferences * About title -->
<string name="pref_about">About</string>
<!-- Preferences * About summary -->
<string name="pref_remove_saved_search_terms_summary">Tap to remove all the saved search terms</string>
<!-- Preferences * Search * Suggestions were truncated -->
<string name="pref_remove_saved_search_terms_msg">All saved search terms were removed.</string>
+ <!-- Preferences * Themes * Themes selection category -->
+ <string name="pref_themes_selection_category">Themes</string>
+ <!-- Preferences * Themes * Set theme button -->
+ <string name="pref_themes_set_theme">Set theme</string>
+ <!-- Preferences * Themes * No preview -->
+ <string name="pref_themes_no_preview">No preview\navailable</string>
+ <!-- Preferences * Themes * Confirmation message -->
+ <string name="pref_themes_confirmation">Theme was applied successfully.</string>
+ <!-- Preferences * Themes * Theme not found message -->
+ <string name="pref_themes_not_found">Theme not found.</string>
<!-- Preferences * Debug * Capture debug traces -->
<string name="pref_debug_traces">Log debugging information</string>
+ <!-- Themes * Default theme name -->
+ <string name="theme_default_name">Light Theme</string>
+ <!-- Themes * Default theme description -->
+ <string name="theme_default_description">A light theme for CyanogenMod File Manager.</string>
+ <!-- Themes * Default theme author -->
+ <string name="themes_author">CyanogenMod</string>
+
<!-- Security * Extract relative or absolute files -->
<string name="security_warning_extract">Warning!\n\n
Extracting an archive file with relative or absolute paths may cause damage to your device
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- The default theme -->
+ <!-- Base themes -->
<style name="FileManager.Theme.Holo.Light" parent="@android:style/Theme.Holo.Light">
<item name="android:windowBackground">@color/default_background</item>
<item name="android:actionBarStyle">@style/FileManager.Widget.ActionBar.White</item>
+ <item name="android:homeAsUpIndicator">@drawable/ic_ab_back_holo_light</item>
+ </style>
+ <style name="FileManager.Theme.Holo" parent="@android:style/Theme.Holo">
+ <item name="android:homeAsUpIndicator">@drawable/ic_ab_back_holo_light</item>
</style>
<!-- A theme with overlay -->
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
-
- <!-- A theme with overlay -->
- <style name="FileManager.Theme.Holo.Light.Transparent" parent="@style/FileManager.Theme.Holo.Light">
+ <style name="FileManager.Theme.Holo.Overlay" parent="@style/FileManager.Theme.Holo">
<item name="android:windowIsTranslucent">true</item>
- <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:windowBackground">@color/black_transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:textStyle">bold</item>
</style>
- <!-- The text appearance for principal information (text that need to be highligthed) -->
+ <!-- The text appearance for principal information (text that need to be highlighted) -->
<style name="primary_text_appearance">
<item name="android:textSize">@dimen/primary_text_size</item>
<item name="android:textColor">@color/black_transparent</item>
--- /dev/null
+<?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.
+ -->
+
+<!--
+ The default light theme for CMFileManager. This is the default theme
+ of the app, only has the definitions and comments of every customizable
+ part of the app. Developers MUST take this theme as the base for building
+ new themes for CMFileManager.
+ Developers MUST replace the "light" prefix of every resource for the identifier
+ of the theme.
+ -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The base theme used to customize some (non-themeables) widgets like dialogs
+ 2 possibles values:
+ * holo: @android:style/Theme.Holo
+ * holo_light: @android:style/Theme.Holo.Light
+ -->
+ <string name="base_theme">holo_light</string>
+
+ <!-- The image preview -->
+ <drawable name="theme_preview_drawable">@drawable/theme_preview</drawable>
+ <drawable name="theme_no_preview_drawable">@drawable/theme_no_preview</drawable>
+
+ <!-- The drawable for the title bar -->
+ <drawable name="titlebar_drawable">@drawable/bg_holo_titlebar</drawable>
+
+ <!-- The background drawable -->
+ <drawable name="background_drawable">@drawable/bg_holo_background</drawable>
+
+ <!-- The drawable for the status bar -->
+ <drawable name="statusbar_drawable">@drawable/bg_holo_statusbar</drawable>
+
+ <!-- The drawable for the selection bar -->
+ <drawable name="selectionbar_drawable">@drawable/bg_holo_selectionbar</drawable>
+
+ <!-- The drawable for the overflow action bar button -->
+ <drawable name="ab_overflow_drawable">@drawable/ic_holo_light_overflow</drawable>
+ <!-- The drawable for the actions action bar button -->
+ <drawable name="ab_actions_drawable">@drawable/ic_holo_light_contextual_action</drawable>
+ <!-- The drawable for the search action bar button -->
+ <drawable name="ab_search_drawable">@drawable/ic_holo_light_search</drawable>
+ <!-- The drawable for the bookmarks action bar button -->
+ <drawable name="ab_bookmarks_drawable">@drawable/ic_holo_light_bookmarks</drawable>
+ <!-- The drawable for the history action bar button -->
+ <drawable name="ab_history_drawable">@drawable/ic_holo_light_history</drawable>
+ <!-- The drawable for the sort mode of expander bar -->
+ <drawable name="ab_sort_mode_drawable">@drawable/ic_holo_light_sort_alphabetically</drawable>
+ <!-- The drawable for the layout mode of expander bar -->
+ <drawable name="ab_layout_mode_drawable">@drawable/ic_holo_light_layout</drawable>
+ <!-- The drawable for the view options of expander bar -->
+ <drawable name="ab_view_options_drawable">@drawable/ic_holo_light_view</drawable>
+ <!-- The drawable for the selection done button -->
+ <drawable name="ab_selection_done_drawable">@drawable/ic_holo_light_accept</drawable>
+ <!-- The drawable for the save action bar button -->
+ <drawable name="ab_save_drawable">@drawable/ic_holo_light_save</drawable>
+ <!-- The drawable for the tab action bar button -->
+ <drawable name="ab_tab_drawable">@drawable/ic_holo_light_tab</drawable>
+
+ <!-- The close action drawable from the expander bar -->
+ <drawable name="expander_close_drawable">@drawable/ic_holo_light_expander_close</drawable>
+ <!-- The open action drawable from the expander bar -->
+ <drawable name="expander_open_drawable">@drawable/ic_holo_light_expander_open</drawable>
+
+ <!-- The text color of TextView controls -->
+ <color name="text_color">@color/black_transparent</color>
+ <!-- The text color of Dialog -->
+ <color name="dialog_text_color">@android:color/holo_blue_dark</color>
+
+ <!-- The highlight color for terms found in the search result -->
+ <color name="search_highlight_color">@color/search_highlight</color>
+
+ <!-- The breadcrumb divider drawable -->
+ <drawable name="breadcrumb_divider_drawable">@drawable/ic_holo_light_breadcrumb_divider</drawable>
+
+ <!-- FileSystem locked drawable -->
+ <drawable name="filesystem_locked_drawable">@drawable/ic_holo_light_fs_locked</drawable>
+ <!-- FileSystem unlocked drawable -->
+ <drawable name="filesystem_unlocked_drawable">@drawable/ic_holo_light_fs_unlocked</drawable>
+ <!-- FileSystem warning drawable -->
+ <drawable name="filesystem_warning_drawable">@drawable/ic_holo_light_fs_warning</drawable>
+
+ <!-- The popup menu checkable selector drawable -->
+ <drawable name="popup_checkable_selector_drawable">@drawable/checkable_selector</drawable>
+ <!-- The menu checkable selector drawable -->
+ <drawable name="menu_checkable_selector_drawable">@drawable/holo_popup_selector</drawable>
+ <!-- The checkable item selector drawable -->
+ <drawable name="selection_drawable">@drawable/holo_selection</drawable>
+
+ <!-- Selectors -->
+ <drawable name="selectors_deselected_drawable">@drawable/holo_list_selector_deselected</drawable>
+ <drawable name="selectors_selected_drawable">@drawable/holo_list_selector_selected</drawable>
+ <drawable name="selectors_button_drawable">@drawable/holo_button_selector</drawable>
+
+ <!-- Checkboxes -->
+ <drawable name="checkbox_deselected_drawable">@drawable/btn_holo_light_check_off_normal</drawable>
+ <drawable name="checkbox_selected_drawable">@drawable/btn_holo_light_check_on_normal</drawable>
+
+ <!-- Dividers -->
+ <drawable name="horizontal_divider_drawable">@drawable/divider_horizontal_bright_opaque</drawable>
+ <drawable name="vertical_divider_drawable">@drawable/divider_vertical_bright_opaque</drawable>
+ <color name="horizontal_divider_color">@color/divider_color_light</color>
+ <color name="vertical_divider_color">@color/divider_color</color>
+
+ <!-- Icons -->
+ <drawable name="ic_close_drawable">@drawable/ic_holo_light_close</drawable>
+ <drawable name="ic_config_drawable">@drawable/ic_holo_light_config</drawable>
+ <drawable name="ic_home_drawable">@drawable/ic_holo_light_home</drawable>
+ <drawable name="ic_filesystem_drawable">@drawable/ic_holo_light_filesystem</drawable>
+ <drawable name="ic_sdcard_drawable">@drawable/ic_holo_light_sdcard</drawable>
+ <drawable name="ic_usb_drawable">@drawable/ic_holo_light_usb</drawable>
+ <drawable name="ic_user_defined_bookmark_drawable">@drawable/ic_holo_light_user_defined_bookmark</drawable>
+ <drawable name="ic_history_search_drawable">@drawable/ic_holo_light_history_search</drawable>
+
+ <!-- Disk usage graph -->
+ <color name="disk_usage_total_color">@color/disk_usage_total</color>
+ <color name="disk_usage_used_color">@color/disk_usage_used</color>
+ <color name="disk_usage_used_warning_color">@color/disk_usage_used_warning</color>
+
+ <!-- Disk usage filters -->
+ <color name="disk_usage_filter_normal_color">@color/disk_usage_color_filter_normal</color>
+ <color name="disk_usage_filter_warning_color">@color/disk_usage_color_filter_warning</color>
+
+ <!-- ProgressBar -->
+ <drawable name="horizontal_progress_bar">@drawable/progress_horizontal_holo_light</drawable>
+
+ <!-- Autocomplete -->
+ <color name="autocomplete_fg_color">@color/black_transparent</color>
+ <color name="autocomplete_bg_color">@android:color/darker_gray</color>
+
+ <!-- Console -->
+ <color name="console_bg_color">@color/console_bg</color>
+ <color name="console_fg_color">@color/console_fg</color>
+
+ <!-- Fso Icons -->
+ <drawable name="ic_fso_folder_drawable">@drawable/ic_fso_folder</drawable>
+ <drawable name="ic_fso_default_drawable">@drawable/ic_fso_default</drawable>
+ <drawable name="fso_type_app_drawable">@drawable/fso_type_app</drawable>
+ <drawable name="fso_type_audio_drawable">@drawable/fso_type_audio</drawable>
+ <drawable name="fso_type_binary_drawable">@drawable/fso_type_binary</drawable>
+ <drawable name="fso_type_calendar_drawable">@drawable/fso_type_calendar</drawable>
+ <drawable name="fso_type_cdimage_drawable">@drawable/fso_type_cdimage</drawable>
+ <drawable name="fso_type_compress_drawable">@drawable/fso_type_compress</drawable>
+ <drawable name="fso_type_contact_drawable">@drawable/fso_type_contact</drawable>
+ <drawable name="fso_type_database_drawable">@drawable/fso_type_database</drawable>
+ <drawable name="fso_type_document_drawable">@drawable/fso_type_document</drawable>
+ <drawable name="fso_type_ebook_drawable">@drawable/fso_type_ebook</drawable>
+ <drawable name="fso_type_email_drawable">@drawable/fso_type_email</drawable>
+ <drawable name="fso_type_executable_drawable">@drawable/fso_type_executable</drawable>
+ <drawable name="fso_type_feed_drawable">@drawable/fso_type_feed</drawable>
+ <drawable name="fso_type_font_drawable">@drawable/fso_type_font</drawable>
+ <drawable name="fso_type_image_drawable">@drawable/fso_type_image</drawable>
+ <drawable name="fso_type_markup_document_drawable">@drawable/fso_type_markup_document</drawable>
+ <drawable name="fso_type_pdf_drawable">@drawable/fso_type_pdf</drawable>
+ <drawable name="fso_type_presentation_drawable">@drawable/fso_type_presentation</drawable>
+ <drawable name="fso_type_security_drawable">@drawable/fso_type_security</drawable>
+ <drawable name="fso_type_shell_drawable">@drawable/fso_type_shell</drawable>
+ <drawable name="fso_type_source_drawable">@drawable/fso_type_source</drawable>
+ <drawable name="fso_type_spreadsheet_drawable">@drawable/fso_type_spreadsheet</drawable>
+ <drawable name="fso_type_system_drawable">@drawable/fso_type_system</drawable>
+ <drawable name="fso_type_text_drawable">@drawable/fso_type_text</drawable>
+ <drawable name="fso_type_video_drawable">@drawable/fso_type_video</drawable>
+
+</resources>
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header
android:fragment="com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences$GeneralPreferenceFragment"
android:fragment="com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences$SearchPreferenceFragment"
android:title="@string/pref_search" />
<header
+ android:fragment="com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences$ThemesPreferenceFragment"
+ android:title="@string/pref_themes" />
+ <header
android:title="@string/pref_about"
android:summary="@null" />
</preference-headers>
See the License for the specific language governing permissions and
limitations under the License.
-->
+
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
--- /dev/null
+<?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.
+ -->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- Search Results -->
+ <PreferenceCategory
+ android:key="themes_selection"
+ android:title="@string/pref_themes_selection_category">
+
+ <!-- Themes selector -->
+ <com.cyanogenmod.filemanager.ui.preferences.ThemeSelectorPreference
+ android:key="cm_filemanager_theme"
+ android:persistent="true"
+ android:defaultValue="com.cyanogenmod.filemanager:light" />
+
+ </PreferenceCategory>
+
+</PreferenceScreen>
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
import android.util.Log;
import com.cyanogenmod.filemanager.console.Console;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.ObjectStringIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
-import com.cyanogenmod.filemanager.util.ExceptionUtil;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
private static boolean sIsDebuggable = false;
private static boolean sIsDeviceRooted = false;
- private final BroadcastReceiver mOnSettingChangeReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- if (intent != null &&
- intent.getAction().compareTo(FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
-
- // The settings has changed
- String key = intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
- if (key != null &&
- key.compareTo(FileManagerSettings.SETTINGS_SHOW_TRACES.getId()) == 0) {
-
- // The debug traces setting has changed. Notify to consoles
- Console c = null;
- try {
- c = getBackgroundConsole();
- } catch (Exception e) {/**NON BLOCK**/}
- if (c != null) {
- c.reloadTrace();
- }
- try {
- c = ConsoleBuilder.getConsole(context, false);
+ if (intent != null) {
+ if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
+
+ // The settings has changed
+ String key =
+ intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
+ if (key != null &&
+ key.compareTo(FileManagerSettings.SETTINGS_SHOW_TRACES.getId()) == 0) {
+
+ // The debug traces setting has changed. Notify to consoles
+ Console c = null;
+ try {
+ c = getBackgroundConsole();
+ } catch (Exception e) {/**NON BLOCK**/}
if (c != null) {
c.reloadTrace();
}
- } catch (Throwable _throw) {/**NON BLOCK**/}
+ try {
+ c = ConsoleBuilder.getConsole(context, false);
+ if (c != null) {
+ c.reloadTrace();
+ }
+ } catch (Throwable _throw) {/**NON BLOCK**/}
+ }
+ }
+ }
+ }
+ };
+
+ // A broadcast receiver for detect the uninstall of apk with themes
+ private final BroadcastReceiver mUninstallReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(Intent.ACTION_PACKAGE_REMOVED) == 0 ||
+ intent.getAction().compareTo(Intent.ACTION_PACKAGE_FULLY_REMOVED) == 0) {
+ // Check that the remove package is not the current theme
+ if (intent.getData() != null) {
+ // Get the package name and remove the schema
+ String apkPackage = intent.getData().toString();
+ apkPackage = apkPackage.substring("package:".length()); //$NON-NLS-1$
+
+ Theme currentTheme = ThemeManager.getCurrentTheme(context);
+ if (currentTheme.getPackage().compareTo(apkPackage) == 0) {
+ // The apk that contains the current theme was remove, change
+ // to default theme
+ String composedId =
+ (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue();
+ ThemeManager.setCurrentTheme(getApplicationContext(), composedId);
+ try {
+ Preferences.savePreference(
+ FileManagerSettings.SETTINGS_THEME, composedId, true);
+ } catch (Throwable ex) {
+ Log.w(TAG, "can't save theme preference", ex); //$NON-NLS-1$
+ }
+
+ // Notify the changes to activities
+ try {
+ Intent broadcastIntent =
+ new Intent(FileManagerSettings.INTENT_THEME_CHANGED);
+ broadcastIntent.putExtra(
+ FileManagerSettings.EXTRA_THEME_ID, composedId);
+ sendBroadcast(broadcastIntent);
+ } catch (Throwable ex) {
+ Log.w(TAG, "notify of theme change failed", ex); //$NON-NLS-1$
+ }
+ }
+ }
}
}
}
Log.d(TAG, "onTerminate"); //$NON-NLS-1$
}
try {
- unregisterReceiver(this.mOnSettingChangeReceiver);
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+ try {
+ unregisterReceiver(this.mUninstallReceiver);
} catch (Throwable ex) {
/**NON BLOCK**/
}
new File(getString(R.string.su_binary)).exists() &&
getSystemProperty("ro.cm.version") != null; //$NON-NLS-1$
- // Register the broadcast receiver
+ // Register the notify broadcast receiver
IntentFilter filter = new IntentFilter();
filter.addAction(FileManagerSettings.INTENT_SETTING_CHANGED);
- registerReceiver(this.mOnSettingChangeReceiver, filter);
+ registerReceiver(this.mNotificationReceiver, filter);
+
+ // Register the uninstall broadcast receiver
+ IntentFilter unfilter = new IntentFilter();
+ unfilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
+ unfilter.addAction(Intent.ACTION_PACKAGE_FULLY_REMOVED);
+ unfilter.addDataScheme("package"); //$NON-NLS-1$
+ registerReceiver(this.mUninstallReceiver, unfilter);
}
/**
FileHelper.ROOT_DIRECTORY = getString(R.string.root_dir);
Preferences.loadDefaults();
+ // Allocate the default and current themes
+ String defaultValue = ((String)FileManagerSettings.
+ SETTINGS_THEME.getDefaultValue());
+ String value = Preferences.getSharedPreferences().getString(
+ FileManagerSettings.SETTINGS_THEME.getId(),
+ defaultValue);
+ ThemeManager.getDefaultTheme(getApplicationContext());
+ if (!ThemeManager.setCurrentTheme(getApplicationContext(), value)) {
+ //The current theme was not found. Mark the default setting as default theme
+ ThemeManager.setCurrentTheme(getApplicationContext(), defaultValue);
+ try {
+ Preferences.savePreference(
+ FileManagerSettings.SETTINGS_THEME, defaultValue, true);
+ } catch (Throwable ex) {
+ Log.w(TAG, "can't save theme preference", ex); //$NON-NLS-1$
+ }
+ }
+
//Create a console for background tasks
allocBackgroundConsole(getApplicationContext());
}
/**
- * Method that check if the app is signed with the platform signature
- *
- * @param ctx The current context
- * @return boolean If the app is signed with the platform signature
- */
- public static boolean isAppPlatformSignature(Context ctx) {
- // TODO This need to be improved, checking if the app is really with the platform signature
- try {
- // For now only check that the app is installed in system directory
- PackageManager pm = ctx.getPackageManager();
- String appDir = pm.getApplicationInfo(ctx.getPackageName(), 0).sourceDir;
- String systemDir = ctx.getString(R.string.system_dir);
- return appDir.startsWith(systemDir);
-
- } catch (Exception e) {
- ExceptionUtil.translateException(ctx, e, true, false);
- }
- return false;
- }
-
- /**
* Method that returns the access mode of the application
*
* @return boolean If the access mode of the application
import android.app.ActionBar;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.XmlResourceParser;
import android.database.Cursor;
import com.cyanogenmod.filemanager.preferences.Bookmarks;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.dialogs.InitialDirectoryDialog;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerListener;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerResponder;
-import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
}
};
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
// Bookmark list XML tags
private static final String TAG_BOOKMARKS = "Bookmarks"; //$NON-NLS-1$
private static final String TAG_BOOKMARK = "bookmark"; //$NON-NLS-1$
@Override
protected void onCreate(Bundle state) {
if (DEBUG) {
- Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
+ Log.d(TAG, "BookmarksActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
// Is ChRooted?
this.mChRooted = FileManagerApplication.getAccessMode().compareTo(AccessMode.SAFE) == 0;
initTitleActionBar();
initBookmarks();
+ // Apply the theme
+ applyTheme();
+
//Save state
super.onCreate(state);
}
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "BookmarksActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected void onPause() {
//Set out transition
overridePendingTransition(R.anim.hold_in, R.anim.translate_to_left_out);
title.setText(R.string.bookmarks);
title.setContentDescription(getString(R.string.bookmarks));
getActionBar().setCustomView(customTitle);
-
}
/**
}
return bookmarks;
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ // -View
+ theme.setBackgroundDrawable(
+ this, this.mBookmarksListView, "background_drawable"); //$NON-NLS-1$
+ if (((BookmarksAdapter)this.mBookmarksListView.getAdapter()) != null) {
+ ((BookmarksAdapter)this.mBookmarksListView.getAdapter()).notifyThemeChanged();
+ ((BookmarksAdapter)this.mBookmarksListView.getAdapter()).notifyDataSetChanged();
+ }
+ this.mBookmarksListView.setDivider(
+ theme.getDrawable(this, "horizontal_divider_drawable")); //$NON-NLS-1$
+ this.mBookmarksListView.invalidate();
+ }
}
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
+import android.content.Intent;
+import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import java.io.InputStream;
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
/**
* {@inheritDoc}
*/
Log.d(TAG, "ChangeLogActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
//Save state
super.onCreate(state);
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "ChangeLogActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
* Initialize the activity. This method handles the passed intent, opens
* the appropriate activity and ends.
*/
R.string.changelog_title, sb.toString(), false);
dialog.setOnCancelListener(this);
dialog.setOnDismissListener(this);
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
} catch (Exception e) {
Log.e(TAG, "Failed to read changelog file", e); //$NON-NLS-1$
finish();
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+ }
+
}
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.TextView.BufferType;
import com.cyanogenmod.filemanager.console.RelaunchableException;
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
-import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
private static final char[] VALID_NON_PRINTABLE_CHARS = {' ', '\t', '\r', '\n'};
/**
Log.d(TAG, "EditorActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
//Set the main layout of the activity
setContentView(R.layout.editor);
//Initialize
initTitleActionBar();
initLayout();
+
+ // Apply the theme
+ applyTheme();
+
+ // Initialize the console
initializeConsole();
+
+ // Read the file
readFile();
//Save state
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "EditorActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
}
}
});
- alert.show();
+ DialogHelper.delegateDialogShow(EditorActivity.this, alert);
}
});
}
}
}
});
- dlg.show();
+ DialogHelper.delegateDialogShow(this, dlg);
return;
}
setResult(Activity.RESULT_OK);
return TextUtils.isGraphic(c);
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_button1);
+ theme.setImageDrawable(this, (ImageView)v, "ab_save_drawable"); //$NON-NLS-1$
+ // -View
+ v = findViewById(R.id.editor_layout);
+ theme.setBackgroundDrawable(this, v, "background_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.editor);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
}
import android.app.ActionBar;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ImageView;
import android.widget.ListPopupWindow;
import android.widget.ListView;
import android.widget.TextView;
import com.cyanogenmod.filemanager.adapters.HistoryAdapter;
import com.cyanogenmod.filemanager.adapters.SimpleMenuListAdapter;
import com.cyanogenmod.filemanager.model.History;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
/**
* @hide
*/
@Override
protected void onCreate(Bundle state) {
if (DEBUG) {
- Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
+ Log.d(TAG, "HistoryActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
this.mIsEmpty = false;
this.mIsClearHistory = false;
initTitleActionBar();
initHistory();
+ // Apply the theme
+ applyTheme();
+
//Save state
super.onCreate(state);
}
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "HistoryActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
// Retrieve the loading view
final View waiting = findViewById(R.id.history_waiting);
+ this.mListView = (ListView)findViewById(R.id.history_listview);
+
// Load the history in background
AsyncTask<Void, Void, Boolean> task = new AsyncTask<Void, Void, Boolean>() {
Exception mCause;
//Show inverted history
final List<History> adapterList = new ArrayList<History>(this.mHistory);
Collections.reverse(adapterList);
-
- HistoryActivity.this.mListView =
- (ListView)findViewById(R.id.history_listview);
HistoryActivity.this.mAdapter =
new HistoryAdapter(HistoryActivity.this, adapterList);
});
popup.show();
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_button1);
+ theme.setImageDrawable(this, (ImageView)v, "ab_overflow_drawable"); //$NON-NLS-1$
+ // -View
+ theme.setBackgroundDrawable(this, this.mListView, "background_drawable"); //$NON-NLS-1$
+ if (this.mAdapter != null) {
+ this.mAdapter.notifyThemeChanged();
+ this.mAdapter.notifyDataSetChanged();
+ }
+ this.mListView.setDivider(
+ theme.getDrawable(this, "horizontal_divider_drawable")); //$NON-NLS-1$
+ this.mListView.invalidate();
+ }
}
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
-import android.nfc.NdefMessage;
-import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.NfcEvent;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListPopupWindow;
import android.widget.PopupWindow;
+import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.FileManagerApplication;
import com.cyanogenmod.filemanager.preferences.NavigationLayoutMode;
import com.cyanogenmod.filemanager.preferences.ObjectIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.dialogs.ActionsDialog;
import com.cyanogenmod.filemanager.ui.dialogs.FilesystemInfoDialog;
import com.cyanogenmod.filemanager.ui.dialogs.FilesystemInfoDialog.OnMountListener;
// exit, and the toast is shown again after the first tap.
private static final int RELEASE_EXIT_CHECK_TIMEOUT = 3500;
- private final BroadcastReceiver mOnSettingChangeReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent != null) {
} catch (Exception e) {
ExceptionUtil.translateException(context, e, true, false);
}
+ } else if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
}
}
}
IntentFilter filter = new IntentFilter();
filter.addAction(FileManagerSettings.INTENT_SETTING_CHANGED);
filter.addAction(FileManagerSettings.INTENT_FILE_CHANGED);
- registerReceiver(this.mOnSettingChangeReceiver, filter);
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
//Set the main layout of the activity
setContentView(R.layout.navigation);
mNfcAdapter.setBeamPushUrisCallback(new NfcAdapter.CreateBeamUrisCallback() {
@Override
public Uri[] createBeamUris(NfcEvent event) {
- List<FileSystemObject> selectedFiles = getNavigationView(NavigationActivity.
- this.mCurrentNavigationView).getSelectedFiles();
+ List<FileSystemObject> selectedFiles =
+ getCurrentNavigationView().getSelectedFiles();
if (selectedFiles.size() > 0) {
List<Uri> fileUri = new ArrayList<Uri>();
for (FileSystemObject f : selectedFiles) {
}, this);
}
- // Show welcome message
- showWelcomeMsg();
-
//Initialize activity
init();
}
this.mOrientation = orientation;
+ // Apply the theme
+ applyTheme();
+
+ // Show welcome message
+ showWelcomeMsg();
+
this.mHandler = new Handler();
this.mHandler.post(new Runnable() {
@Override
// Unregister the receiver
try {
- unregisterReceiver(this.mOnSettingChangeReceiver);
+ unregisterReceiver(this.mNotificationReceiver);
} catch (Throwable ex) {
/**NON BLOCK**/
}
AlertDialog dialog = DialogHelper.createAlertDialog(
this, R.drawable.ic_launcher,
R.string.welcome_title, getString(R.string.welcome_msg), false);
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
// Don't display again this dialog
try {
//Navigate to previous history
back();
} else {
- // I don't know is the search view was changed, so do a refresh
+ // I don't know is the search view was changed, so try to do a refresh
// of the navigation view
- getCurrentNavigationView().refresh();
+ getCurrentNavigationView().refresh(true);
}
}
break;
this,
R.string.filesystem_info_warning_title,
R.string.filesystem_info_warning_msg);
- alert.show();
+ DialogHelper.delegateDialogShow(this, alert);
return;
}
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
}
/**
* Method that reconfigures the layout for better fit in portrait and landscape modes
*/
private void onLayoutChanged() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+
// Apply only when the orientation was changed
int orientation = getResources().getConfiguration().orientation;
if (this.mOrientation == orientation) return;
statusBar.setLayoutParams(params);
newParent.addView(statusBar);
+ // Apply theme
+ theme.setBackgroundDrawable(this, statusBar, "titlebar_drawable"); //$NON-NLS-1$
+
// Hide holder
View holder = findViewById(R.id.navigation_statusbar_portrait_holder);
holder.setVisibility(View.GONE);
}
// Add to the new location
- ViewGroup newParent = (ViewGroup)findViewById(R.id.navigation_statusbar_portrait_holder);
+ ViewGroup newParent = (ViewGroup)findViewById(
+ R.id.navigation_statusbar_portrait_holder);
LinearLayout.LayoutParams params =
new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
statusBar.setLayoutParams(params);
newParent.addView(statusBar);
+ // Apply theme
+ theme.setBackgroundDrawable(this, statusBar, "statusbar_drawable"); //$NON-NLS-1$
+
// Show holder
newParent.setVisibility(View.VISIBLE);
}
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ int orientation = getResources().getConfiguration().orientation;
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ //- StatusBar
+ View v = findViewById(R.id.navigation_statusbar);
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ theme.setBackgroundDrawable(this, v, "titlebar_drawable"); //$NON-NLS-1$
+ } else {
+ theme.setBackgroundDrawable(this, v, "statusbar_drawable"); //$NON-NLS-1$
+ }
+ v = findViewById(R.id.ab_overflow);
+ theme.setImageDrawable(this, (ImageView)v, "ab_overflow_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_actions);
+ theme.setImageDrawable(this, (ImageView)v, "ab_actions_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_search);
+ theme.setImageDrawable(this, (ImageView)v, "ab_search_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_bookmarks);
+ theme.setImageDrawable(this, (ImageView)v, "ab_bookmarks_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_history);
+ theme.setImageDrawable(this, (ImageView)v, "ab_history_drawable"); //$NON-NLS-1$
+ //- Expanders
+ v = findViewById(R.id.ab_configuration);
+ theme.setImageDrawable(this, (ImageView)v, "expander_open_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_close);
+ theme.setImageDrawable(this, (ImageView)v, "expander_close_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_sort_mode);
+ theme.setImageDrawable(this, (ImageView)v, "ab_sort_mode_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_layout_mode);
+ theme.setImageDrawable(this, (ImageView)v, "ab_layout_mode_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_view_options);
+ theme.setImageDrawable(this, (ImageView)v, "ab_view_options_drawable"); //$NON-NLS-1$
+ //- SelectionBar
+ v = findViewById(R.id.navigation_selectionbar);
+ theme.setBackgroundDrawable(this, v, "selectionbar_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_selection_done);
+ theme.setImageDrawable(this, (ImageView)v, "ab_selection_done_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.navigation_status_selection_label);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ //- NavigationView
+ int cc = this.mNavigationViews.length;
+ for (int i = 0; i < cc; i++) {
+ getNavigationView(i).applyTheme();
+ }
+ }
+
}
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.Breadcrumb;
import com.cyanogenmod.filemanager.ui.widgets.ButtonItem;
import com.cyanogenmod.filemanager.ui.widgets.NavigationView;
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
private String mMimeType;
private FileSystemObject mFso; // The picked item
private AlertDialog mDialog;
Log.d(TAG, "PickerActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
// Initialize the activity
init();
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "PickerActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
measureHeight();
this.mNavigationView.setOnFilePickedListener(this);
this.mNavigationView.setBreadcrumb(breadcrumb);
+ // Apply the current theme
+ applyTheme();
+
// Create the dialog
this.mDialog = DialogHelper.createDialog(
this, R.drawable.ic_launcher, R.string.picker_title, this.mRootView);
this.mDialog.setCancelable(true);
this.mDialog.setOnCancelListener(this);
this.mDialog.setOnDismissListener(this);
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this, this.mDialog);
// Set content description of storage volume button
ButtonItem fs = (ButtonItem)this.mRootView.findViewById(R.id.ab_filesystem_info);
* {@inheritDoc}
*/
@Override
- protected void onDestroy() {
- if (DEBUG) {
- Log.d(TAG, "PickerActivity.onDestroy"); //$NON-NLS-1$
- }
-
- //All destroy. Continue
- super.onDestroy();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void onDismiss(DialogInterface dialog) {
if (this.mFso != null) {
Intent result = new Intent();
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
popup.dismiss();
if (volumes != null) {
-
PickerActivity.this.
mNavigationView.changeCurrentDir(volumes[position].getPath());
}
});
popup.show();
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ // View
+ theme.setBackgroundDrawable(this, this.mRootView, "background_drawable"); //$NON-NLS-1$
+ this.mNavigationView.applyTheme();
+ }
}
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Parcelable;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
+import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.ProgressBar;
import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.providers.RecentSearchesContentProvider;
import com.cyanogenmod.filemanager.tasks.SearchResultDrawingAsyncTask;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.dialogs.ActionsDialog;
import com.cyanogenmod.filemanager.ui.dialogs.MessageProgressDialog;
import com.cyanogenmod.filemanager.ui.policy.DeleteActionPolicy;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerListener;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerResponder;
-import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
//Minimum characters to allow query
private static final int MIN_CHARS_SEARCH = 3;
- private final BroadcastReceiver mOnSettingChangeReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- if (intent != null &&
- intent.getAction().compareTo(FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
-
- // The settings has changed
- String key = intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
- if (key != null) {
- if (SearchActivity.this.mSearchListView.getAdapter() != null &&
- (key.compareTo(
- FileManagerSettings.SETTINGS_HIGHLIGHT_TERMS.getId()) == 0 ||
- key.compareTo(
- FileManagerSettings.SETTINGS_SHOW_RELEVANCE_WIDGET.getId()) == 0 ||
- key.compareTo(
- FileManagerSettings.SETTINGS_SORT_SEARCH_RESULTS_MODE.getId()) == 0)) {
-
- // Recreate the adapter
- int pos = SearchActivity.this.mSearchListView.getFirstVisiblePosition();
- drawResults();
- SearchActivity.this.mSearchListView.setSelection(pos);
- return;
+ if (intent != null) {
+ if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_SETTING_CHANGED) == 0) {
+
+ // The settings has changed
+ String key = intent.getStringExtra(
+ FileManagerSettings.EXTRA_SETTING_CHANGED_KEY);
+ if (key != null) {
+ if (SearchActivity.this.mSearchListView.getAdapter() != null &&
+ (key.compareTo(
+ FileManagerSettings.
+ SETTINGS_HIGHLIGHT_TERMS.getId()) == 0 ||
+ key.compareTo(
+ FileManagerSettings.
+ SETTINGS_SHOW_RELEVANCE_WIDGET.getId()) == 0 ||
+ key.compareTo(
+ FileManagerSettings.
+ SETTINGS_SORT_SEARCH_RESULTS_MODE.getId()) == 0)) {
+
+ // Recreate the adapter
+ int pos = SearchActivity.
+ this.mSearchListView.getFirstVisiblePosition();
+ drawResults();
+ SearchActivity.this.mSearchListView.setSelection(pos);
+ return;
+ }
}
+ } else if (intent.getAction().compareTo(
+ FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
}
}
}
@Override
protected void onCreate(Bundle state) {
if (DEBUG) {
- Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
+ Log.d(TAG, "SearchActivity.onCreate"); //$NON-NLS-1$
}
// Check if app is running in chrooted mode
// Register the broadcast receiver
IntentFilter filter = new IntentFilter();
filter.addAction(FileManagerSettings.INTENT_SETTING_CHANGED);
- registerReceiver(this.mOnSettingChangeReceiver, filter);
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
//Set in transition
overridePendingTransition(R.anim.translate_to_right_in, R.anim.hold_out);
//Initialize action bars and search
initTitleActionBar();
initComponents();
+
+ // Apply current theme
+ applyTheme();
+
if (this.mRestoreState != null) {
//Restore activity from cached data
loadFromCacheData();
* {@inheritDoc}
*/
@Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "SearchActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
* {@inheritDoc}
*/
@Override
- protected void onDestroy() {
- super.onDestroy();
- try {
- unregisterReceiver(this.mOnSettingChangeReceiver);
- } catch (Throwable ex) {/**NON BLOCK**/}
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected void onSaveInstanceState(Bundle outState) {
if (DEBUG) {
Log.d(TAG, "SearchActivity.onSaveInstanceState"); //$NON-NLS-1$
back(true, null, false);
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(this, dialog);
}
/**
Integer.valueOf(progress));
SearchActivity.this.mDialog.setProgress(Html.fromHtml(msg));
}
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.ab_button1);
+ theme.setImageDrawable(this, (ImageView)v, "ic_config_drawable"); //$NON-NLS-1$
+ // ContentView
+ theme.setBackgroundDrawable(
+ this, getWindow().getDecorView(), "background_drawable"); //$NON-NLS-1$
+ //- StatusBar
+ v = findViewById(R.id.search_status);
+ theme.setBackgroundDrawable(this, v, "statusbar_drawable"); //$NON-NLS-1$
+ v = findViewById(R.id.search_status_found_items);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.search_status_query_terms);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ //ListView
+ if (this.mSearchListView.getAdapter() != null) {
+ ((SearchResultAdapter)this.mSearchListView.getAdapter()).notifyDataSetChanged();
+ }
+ this.mSearchListView.setDivider(
+ theme.getDrawable(this, "horizontal_divider_drawable")); //$NON-NLS-1$
+ this.mSearchListView.invalidate();
+ }
}
package com.cyanogenmod.filemanager.activities;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
+import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.console.ConsoleBuilder;
import com.cyanogenmod.filemanager.model.FileSystemObject;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.IntentsActionPolicy;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
private static boolean DEBUG = false;
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ applyTheme();
+ }
+ }
+ }
+ };
+
/**
* Constant for extra information about the type of the shortcut.<br/>
* <br/>
Log.d(TAG, "ShortcutActivity.onCreate"); //$NON-NLS-1$
}
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
+
//Save state
super.onCreate(state);
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "ShortcutActivity.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
+ }
+
+ /**
* Initialize the activity. This method handles the passed intent, opens
* the appropriate activity and ends.
*/
finish();
}
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+ }
+
}
import android.app.ActionBar;
import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import com.cyanogenmod.filemanager.preferences.ObjectStringIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.providers.RecentSearchesContentProvider;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+import com.cyanogenmod.filemanager.ui.preferences.ThemeSelectorPreference;
import com.cyanogenmod.filemanager.util.DialogHelper;
import java.util.List;
*/
public class SettingsPreferences extends PreferenceActivity {
+ private static final String TAG = "SettingsPreferences"; //$NON-NLS-1$
+
private static final boolean DEBUG = false;
- private static final String LOG_TAG = "SettingsPreferences"; //$NON-NLS-1$
+ private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null) {
+ if (intent.getAction().compareTo(FileManagerSettings.INTENT_THEME_CHANGED) == 0) {
+ finish();
+ }
+ }
+ }
+ };
/**
* {@inheritDoc}
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ if (DEBUG) {
+ Log.d(TAG, "SettingsPreferences.onCreate"); //$NON-NLS-1$
+ }
+
+ // Register the broadcast receiver
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(FileManagerSettings.INTENT_THEME_CHANGED);
+ registerReceiver(this.mNotificationReceiver, filter);
//Initialize action bars
initTitleActionBar();
+
+ // Apply the theme
+ applyTheme();
+
+ super.onCreate(savedInstanceState);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onDestroy() {
+ if (DEBUG) {
+ Log.d(TAG, "SettingsPreferences.onDestroy"); //$NON-NLS-1$
+ }
+
+ // Unregister the receiver
+ try {
+ unregisterReceiver(this.mNotificationReceiver);
+ } catch (Throwable ex) {
+ /**NON BLOCK**/
+ }
+
+ //All destroy. Continue
+ super.onDestroy();
}
/**
String key = preference.getKey();
if (DEBUG) {
- Log.d(LOG_TAG,
+ Log.d(TAG,
String.format("New value for %s: %s", //$NON-NLS-1$
key,
String.valueOf(newValue)));
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
if (DEBUG) {
- Log.d(LOG_TAG,
+ Log.d(TAG,
String.format("New value for %s: %s", //$NON-NLS-1$
key,
String.valueOf(newValue)));
}
}
+ /**
+ * A class that manages the theme selection
+ */
+ public static class ThemesPreferenceFragment extends PreferenceFragment {
+
+ private ThemeSelectorPreference mThemeSelector;
+
+ private final OnPreferenceChangeListener mOnChangeListener =
+ new OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ String key = preference.getKey();
+ if (DEBUG) {
+ Log.d(TAG,
+ String.format("New value for %s: %s", //$NON-NLS-1$
+ key,
+ String.valueOf(newValue)));
+ }
+
+ // Notify to all activities that the theme has changed
+ Intent intent = new Intent(FileManagerSettings.INTENT_THEME_CHANGED);
+ intent.putExtra(FileManagerSettings.EXTRA_THEME_ID, (String)newValue);
+ getActivity().sendBroadcast(intent);
+
+ //Wait for allow activities to apply the theme, prior to finish settings
+ try {
+ Thread.sleep(250L);
+ } catch (Throwable e) {/**NON BLOCK**/}
+ getActivity().finish();
+ return true;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Change the preference manager
+ getPreferenceManager().setSharedPreferencesName(Preferences.SETTINGS_FILENAME);
+ getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);
+
+ // Add the preferences
+ addPreferencesFromResource(R.xml.preferences_themes);
+
+ // Theme selector
+ this.mThemeSelector =
+ (ThemeSelectorPreference)findPreference(
+ FileManagerSettings.SETTINGS_THEME.getId());
+ this.mThemeSelector.setOnPreferenceChangeListener(this.mOnChangeListener);
+ }
+ }
+
+ /**
+ * Method that applies the current theme to the activity
+ * @hide
+ */
+ void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this);
+ theme.setBaseTheme(this, false);
+
+ //- ActionBar
+ theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$
+ View v = getActionBar().getCustomView().findViewById(R.id.customtitle_title);
+ theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$
+ // -View
+ theme.setBackgroundDrawable(
+ this,
+ this.getWindow().getDecorView(),
+ "background_drawable"); //$NON-NLS-1$
+ }
+
}
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.List;
viewHolder.mIvIcon = (ImageView)v.findViewById(RESOURCE_ITEM_ICON);
viewHolder.mTvName = (TextView)v.findViewById(RESOURCE_ITEM_NAME);
v.setTag(viewHolder);
+
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(getContext(), v, "selection_drawable"); //$NON-NLS-1$
+ theme.setTextColor(getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
}
//Retrieve data holder
import com.cyanogenmod.filemanager.model.Bookmark;
import com.cyanogenmod.filemanager.model.Bookmark.BOOKMARK_TYPE;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.BookmarksHelper;
import java.util.List;
if (bookmark.mType.compareTo(BOOKMARK_TYPE.HOME) == 0) {
this.mData[i].mDwAction =
this.mIconHolder.getDrawable(
- getContext(), R.drawable.ic_holo_light_config);
+ getContext(), "ic_config_drawable"); //$NON-NLS-1$
this.mData[i].mActionCd =
getContext().getString(R.string.bookmarks_button_config_cd);
} else if (bookmark.mType.compareTo(BOOKMARK_TYPE.USER_DEFINED) == 0) {
this.mData[i].mDwAction =
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_holo_light_close);
+ this.mIconHolder.getDrawable(getContext(),
+ "ic_close_drawable"); //$NON-NLS-1$
this.mData[i].mActionCd =
getContext().getString(R.string.bookmarks_button_remove_bookmark_cd);
}
viewHolder.mBtAction = (ImageButton)v.findViewById(RESOURCE_ITEM_ACTION);
viewHolder.mBtAction.setTag(Integer.valueOf(position));
v.setTag(viewHolder);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvPath, "text_color"); //$NON-NLS-1$
}
//Retrieve data holder
return v;
}
+ /**
+ * Method that should be invoked when the theme of the app was changed
+ */
+ public void notifyThemeChanged() {
+ // Empty icon holder
+ this.mIconHolder = new IconHolder();
+ }
}
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.List;
if (v == null) {
//Create the view holder
LayoutInflater li =
- (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = li.inflate(R.layout.option_list_item, parent, false);
ViewHolder viewHolder = new CheckableListAdapter.ViewHolder();
viewHolder.mTvTitle = (TextView)v.findViewById(RESOURCE_ITEM_NAME);
viewHolder.mDwCheck = (ImageView)v.findViewById(RESOURCE_ITEM_CHECK);
v.setTag(viewHolder);
+
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v,
+ "menu_checkable_selector_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvTitle, "text_color"); //$NON-NLS-1$
+ theme.setImageDrawable(
+ getContext(), viewHolder.mDwCheck,
+ "popup_checkable_selector_drawable"); //$NON-NLS-1$
}
//Retrieve the item
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.model.ParentDirectory;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
* Method that loads the default icons (known icons and more common icons).
*/
private void loadDefaultIcons() {
- this.mIconHolder.getDrawable(getContext(), R.drawable.btn_holo_light_check_on_normal);
- this.mIconHolder.getDrawable(getContext(), R.drawable.btn_holo_light_check_off_normal);
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_default);
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_folder);
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_folder_drawable"); //$NON-NLS-1$
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_default_drawable"); //$NON-NLS-1$
}
/**
* Method that process the data before use {@link #getView} method.
*/
private void processData() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
Resources res = getContext().getResources();
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
this.mData = new DataHolder[getCount()];
//Build the data holder
this.mData[i] = new FileSystemObjectAdapter.DataHolder();
this.mData[i].mSelected = this.mSelectedItems.contains(fso);
- this.mData[i].mDwCheck = (this.mData[i].mSelected)
- ? this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_on_normal)
- : this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_off_normal);
+ if (this.mData[i].mSelected) {
+ this.mData[i].mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_selected_drawable"); //$NON-NLS-1$
+ } else {
+ this.mData[i].mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_deselected_drawable"); //$NON-NLS-1$
+ }
this.mData[i].mDwIcon = this.mIconHolder.getDrawable(
getContext(),
MimeTypeHelper.getIcon(getContext(), fso));
//Retrieve the view holder
ViewHolder viewHolder = (ViewHolder)v.getTag();
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ if (viewHolder.mTvSummary != null) {
+ theme.setTextColor(
+ getContext(), viewHolder.mTvSummary, "text_color"); //$NON-NLS-1$
+ }
+ if (viewHolder.mTvSize != null) {
+ theme.setTextColor(
+ getContext(), viewHolder.mTvSize, "text_color"); //$NON-NLS-1$
+ }
+
//Set the data
viewHolder.mIvIcon.setImageDrawable(dataHolder.mDwIcon);
viewHolder.mTvName.setText(dataHolder.mName);
FileHelper.PARENT_DIRECTORY) == 0 ? View.INVISIBLE : View.VISIBLE);
viewHolder.mBtCheck.setImageDrawable(dataHolder.mDwCheck);
viewHolder.mBtCheck.setTag(Integer.valueOf(position));
- v.setBackgroundResource(
- dataHolder.mSelected
- ? R.drawable.holo_list_selector_selected
- : R.drawable.holo_list_selector_deseleted);
+
+ // Apply theme
+ if (dataHolder.mSelected) {
+ theme.setBackgroundDrawable(
+ getContext(), v, "selectors_selected_drawable"); //$NON-NLS-1$
+ } else {
+ theme.setBackgroundDrawable(
+ getContext(), v, "selectors_deselected_drawable"); //$NON-NLS-1$
+ }
}
//Return the view
*/
private void toggleSelection(View v, FileSystemObject fso) {
if (this.mData != null) {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
int cc = this.mData.length;
for (int i = 0; i < cc; i++) {
DataHolder data = this.mData[i];
if (v != null) {
((View)v.getParent()).setSelected(data.mSelected);
}
- data.mDwCheck = data.mSelected
- ? this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_on_normal)
- : this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_off_normal);
+ if (data.mSelected) {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_selected_drawable"); //$NON-NLS-1$
+ } else {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(),
+ "checkbox_deselected_drawable"); //$NON-NLS-1$
+ }
if (v != null) {
((ImageView)v).setImageDrawable(data.mDwCheck);
- ((View)v.getParent()).setBackgroundResource(
- data.mSelected
- ? R.drawable.holo_list_selector_selected
- : R.drawable.holo_list_selector_deseleted);
+ if (data.mSelected) {
+ theme.setBackgroundDrawable(
+ getContext(),
+ (View)v.getParent(),
+ "selectors_selected_drawable"); //$NON-NLS-1$
+ } else {
+ theme.setBackgroundDrawable(
+ getContext(),
+ (View)v.getParent(),
+ "selectors_deselected_drawable"); //$NON-NLS-1$
+ }
}
//Add or remove from the global selected items
*/
private void doSelectDeselectAllVisibleItems(boolean select) {
if (this.mData != null && this.mData.length > 0) {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
int cc = this.mData.length;
for (int i = 0; i < cc; i++) {
DataHolder data = this.mData[i];
continue;
}
data.mSelected = select;
- data.mDwCheck = data.mSelected
- ? this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_on_normal)
- : this.mIconHolder.getDrawable(
- getContext(), R.drawable.btn_holo_light_check_off_normal);
+ if (data.mSelected) {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_selected_drawable"); //$NON-NLS-1$
+ } else {
+ data.mDwCheck =
+ theme.getDrawable(
+ getContext(), "checkbox_deselected_drawable"); //$NON-NLS-1$
+ }
//Add or remove from the global selected items
FileSystemObject fso = getItem(i);
}
}
+ /**
+ * Method that should be invoked when the theme of the app was changed
+ */
+ public void notifyThemeChanged() {
+ // Empty icon holder
+ this.mIconHolder = new IconHolder();
+ }
}
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
/**
* An implementation of {@link SimpleMenuListAdapter} with highlighted text
// Highlight the text
View v = super.getView(position, convertView, parent);
if (v != null) {
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
TextView tvText = (TextView)v.findViewById(R.id.menu_item_text);
if (tvText != null) {
tvText.setTextAppearance(this.mContext, R.style.primary_text_appearance);
+ theme.setTextColor(this.mContext, tvText, "text_color"); //$NON-NLS-1$
}
}
//Return the view
import com.cyanogenmod.filemanager.parcelables.NavigationViewInfoParcelable;
import com.cyanogenmod.filemanager.parcelables.SearchInfoParcelable;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.List;
this.mData[i] = new HistoryAdapter.DataHolder();
if (history.getItem() instanceof NavigationViewInfoParcelable) {
this.mData[i].mDwIcon =
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_folder);
+ this.mIconHolder.getDrawable(
+ getContext(), "ic_fso_folder_drawable"); //$NON-NLS-1$
} else if (history.getItem() instanceof SearchInfoParcelable) {
this.mData[i].mDwIcon =
this.mIconHolder.getDrawable(
- getContext(), R.drawable.ic_holo_light_history_search);
+ getContext(), "ic_history_search_drawable"); //$NON-NLS-1$
}
this.mData[i].mName = history.getItem().getTitle();
if (this.mData[i].mName == null || this.mData[i].mName.trim().length() == 0) {
viewHolder.mTvDirectory = (TextView)v.findViewById(RESOURCE_ITEM_DIRECTORY);
viewHolder.mTvPosition = (TextView)v.findViewById(RESOURCE_ITEM_POSITION);
v.setTag(viewHolder);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvDirectory, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvPosition, "text_color"); //$NON-NLS-1$
}
//Retrieve data holder
return v;
}
+ /**
+ * Method that should be invoked when the theme of the app was changed
+ */
+ public void notifyThemeChanged() {
+ // Empty icon holder
+ this.mIconHolder = new IconHolder();
+ }
+
}
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.ui.IconHolder;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.RelevanceView;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
import com.cyanogenmod.filemanager.util.SearchHelper;
* Method that loads the default icons (known icons and more common icons).
*/
private void loadDefaultIcons() {
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_default);
- this.mIconHolder.getDrawable(getContext(), R.drawable.ic_fso_folder);
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_folder_drawable"); //$NON-NLS-1$
+ this.mIconHolder.getDrawable(getContext(), "ic_fso_default_drawable"); //$NON-NLS-1$
}
/**
* Method that process the data before use {@link #getView} method.
*/
private void processData() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ int highlightedColor =
+ theme.getColor(getContext(), "search_highlight_color"); //$NON-NLS-1$
+
this.mData = new DataHolder[getCount()];
int cc = getCount();
for (int i = 0; i < cc; i++) {
this.mIconHolder.getDrawable(
getContext(), MimeTypeHelper.getIcon(getContext(), result.getFso()));
if (this.mHighlightTerms) {
- this.mData[i].mName = SearchHelper.getHighlightedName(result, this.mQueries);
+ this.mData[i].mName =
+ SearchHelper.getHighlightedName(result, this.mQueries, highlightedColor);
} else {
this.mData[i].mName = SearchHelper.getNonHighlightedName(result);
}
viewHolder.mTvParentDir = (TextView)v.findViewById(RESOURCE_ITEM_PARENT_DIR);
viewHolder.mWgRelevance = (RelevanceView)v.findViewById(RESOURCE_ITEM_RELEVANCE);
v.setTag(viewHolder);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(
+ getContext(), v, "selectors_deselected_drawable"); //$NON-NLS-1$
+ theme.setTextColor(
+ getContext(), viewHolder.mTvName, "text_color"); //$NON-NLS-1$
+ if (viewHolder.mTvParentDir != null) {
+ theme.setTextColor(
+ getContext(), viewHolder.mTvParentDir, "text_color"); //$NON-NLS-1$
+ }
}
//Retrieve data holder
import com.android.internal.view.menu.MenuBuilder;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
/**
* An implementation of {@link BaseAdapter} that is associated with a
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//Recovers the menu item
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
MenuItem menuItem = getItem(position);
//Is a separator?
} else {
v = this.mInflater.inflate(R.layout.menu_item, parent, false);
}
+ theme.setBackgroundDrawable(
+ this.mContext, v,
+ "menu_checkable_selector_drawable"); //$NON-NLS-1$
//Set the text if has title
if (menuItem.getTitle() != null && menuItem.getTitle().length() > 0) {
TextView tvText = (TextView)v.findViewById(R.id.menu_item_text);
tvText.setText(menuItem.getTitle());
+ theme.setTextColor(this.mContext, tvText, "text_color"); //$NON-NLS-1$
}
v.setEnabled(menuItem.isEnabled());
v.setVisibility(menuItem.isVisible() ? View.VISIBLE : View.GONE);
import android.widget.TextView;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
/**
* An implementation of {@link SimpleMenuListAdapter} for showing
private OnItemClickListener mOnItemClickListener;
private OnItemLongClickListener mOnItemLongClickListener;
+ private final Context mContext;
+
/**
* Constructor of <code>TwoColumnsMenuListAdapter</code>.
*
*/
public TwoColumnsMenuListAdapter(Context context, int menuResourceId) {
super(context, menuResourceId);
+ this.mContext = context;
//Separators are not support in this kind of adapter
removeSeparators();
* @param menuResourceId The resource identifier
* @param menuGroupResourceId The menu group resource identifier
*/
- public TwoColumnsMenuListAdapter(Context context, int menuResourceId, int menuGroupResourceId) {
+ public TwoColumnsMenuListAdapter(
+ Context context, int menuResourceId, int menuGroupResourceId) {
super(context, menuResourceId, menuGroupResourceId);
+ this.mContext = context;
//Separators are not support in this kind of adapter
removeSeparators();
tvText2.setOnLongClickListener(null);
}
+ // Divider
+ TextView divider = (TextView)((ViewGroup)v).getChildAt(1);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(this.mContext, v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(this.mContext, tvText1, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(this.mContext, tvText2, "text_color"); //$NON-NLS-1$
+ theme.setBackgroundDrawable(this.mContext, divider, "vertical_divider_drawable"); //$NON-NLS-1$
+
//Return the view
return v;
}
sb = new StringBuffer(ShellConsole.this.mSbIn.toString());
if (async) {
synchronized (ShellConsole.this.mPartialSync) {
- ((AsyncResultProgram)ShellConsole.
- this.mActiveCommand).
- onRequestStartParsePartialResult();
+ AsyncResultProgram p =
+ ((AsyncResultProgram)ShellConsole.
+ this.mActiveCommand);
+ if (p != null) {
+ p.onRequestStartParsePartialResult();
+ }
}
}
} else {
AsyncResultProgram program =
((AsyncResultProgram)ShellConsole.this.mActiveCommand);
String partial = sb.toString();
- program.onRequestParsePartialResult(partial);
+ if (program != null) {
+ program.onRequestParsePartialResult(partial);
+ }
ShellConsole.this.toStdIn(partial);
// Reset the temp buffer
if (ShellConsole.this.mStarted && async) {
AsyncResultProgram program =
((AsyncResultProgram)ShellConsole.this.mActiveCommand);
- program.parsePartialErrResult(new String(new char[]{(char)r}));
+ if (program != null) {
+ program.parsePartialErrResult(new String(new char[]{(char)r}));
+ }
}
toStdErr(sb.toString());
if (async) {
AsyncResultProgram program =
((AsyncResultProgram)ShellConsole.this.mActiveCommand);
- program.parsePartialErrResult(s);
+ if (program != null) {
+ program.parsePartialErrResult(s);
+ }
}
toStdErr(s);
* When to show debug traces
* @hide
*/
- SETTINGS_SHOW_TRACES("cm_filemanager_show_debug_traces", Boolean.FALSE); //$NON-NLS-1$
-
+ SETTINGS_SHOW_TRACES("cm_filemanager_show_debug_traces", Boolean.FALSE), //$NON-NLS-1$
+ /**
+ * The current theme to use in the app
+ * @hide
+ */
+ SETTINGS_THEME("cm_filemanager_theme", //$NON-NLS-1$
+ "com.cyanogenmod.filemanager:light"); //$NON-NLS-1$
/**
* A broadcast intent that is sent when a setting was changed
"com.cyanogenmod.filemanager.INTENT_SETTING_CHANGED"; //$NON-NLS-1$
/**
+ * A broadcast intent that is sent when a theme was changed
+ */
+ public final static String INTENT_THEME_CHANGED =
+ "com.cyanogenmod.filemanager.INTENT_THEME_CHANGED"; //$NON-NLS-1$
+
+ /**
* A broadcast intent that is sent when a file was changed
*/
public final static String INTENT_FILE_CHANGED =
*/
public final static String EXTRA_FILE_CHANGED_KEY = "file"; //$NON-NLS-1$
+ /**
+ * The extra key with the file key that was changed
+ */
+ public final static String EXTRA_THEME_PACKAGE = "package"; //$NON-NLS-1$
+
+ /**
+ * The extra key with the identifier of theme that was changed
+ */
+ public final static String EXTRA_THEME_ID = "id"; //$NON-NLS-1$
+
package com.cyanogenmod.filemanager.tasks;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.os.AsyncTask;
import android.widget.ImageView;
import android.widget.ProgressBar;
-import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.DiskUsage;
import com.cyanogenmod.filemanager.model.MountPoint;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.MountPointHelper;
/**
/**
* @hide
*/
+ final Context mContext;
+ /**
+ * @hide
+ */
final ImageView mMountPointInfo;
/**
* @hide
* @hide
*/
static int sColorFilterNormal;
- /**
- * @hide
- */
- static int sColorFilterWarning;
/**
* Constructor of <code>FilesystemAsyncTask</code>.
Context context, ImageView mountPointInfo,
ProgressBar diskUsageInfo, int freeDiskSpaceWarningLevel) {
super();
+ this.mContext = context;
this.mMountPointInfo = mountPointInfo;
this.mDiskUsageInfo = diskUsageInfo;
this.mFreeDiskSpaceWarningLevel = freeDiskSpaceWarningLevel;
this.mRunning = false;
-
- if (sColorFilterNormal == 0 || sColorFilterWarning == 0) {
- Resources res = context.getResources();
- sColorFilterNormal = res.getColor(R.color.disk_usage_color_filter_normal);
- sColorFilterWarning = res.getColor(R.color.disk_usage_color_filter_warning);
- }
-
}
/**
this.mMountPointInfo.post(new Runnable() {
@Override
public void run() {
- FilesystemAsyncTask.this.mMountPointInfo.setImageResource(
- R.drawable.ic_holo_light_fs_warning);
+ Theme theme = ThemeManager.getCurrentTheme(FilesystemAsyncTask.this.mContext);
+ theme.setImageDrawable(
+ FilesystemAsyncTask.this.mContext,
+ FilesystemAsyncTask.this.mMountPointInfo,
+ "filesystem_warning_drawable"); //$NON-NLS-1$
FilesystemAsyncTask.this.mMountPointInfo.setTag(null);
}
});
this.mMountPointInfo.post(new Runnable() {
@Override
public void run() {
- FilesystemAsyncTask.this.mMountPointInfo.setImageResource(
+ String resource =
MountPointHelper.isReadOnly(mp)
- ? R.drawable.ic_holo_light_fs_locked
- : R.drawable.ic_holo_light_fs_unlocked);
+ ? "filesystem_locked_drawable" //$NON-NLS-1$
+ : "filesystem_unlocked_drawable"; //$NON-NLS-1$
+ Theme theme = ThemeManager.getCurrentTheme(FilesystemAsyncTask.this.mContext);
+ theme.setImageDrawable(
+ FilesystemAsyncTask.this.mContext,
+ FilesystemAsyncTask.this.mMountPointInfo,
+ resource);
FilesystemAsyncTask.this.mMountPointInfo.setTag(mp);
}
});
}
// Advise about diskusage (>=mFreeDiskSpaceWarningLevel) with other color
+ Theme theme = ThemeManager.getCurrentTheme(FilesystemAsyncTask.this.mContext);
int filter =
usage >= FilesystemAsyncTask.this.mFreeDiskSpaceWarningLevel ?
- sColorFilterWarning :
- sColorFilterNormal;
+ theme.getColor(
+ FilesystemAsyncTask.this.mContext,
+ "disk_usage_filter_warning_color") : //$NON-NLS-1$
+ theme.getColor(
+ FilesystemAsyncTask.this.mContext,
+ "disk_usage_filter_normal_color"); //$NON-NLS-1$
FilesystemAsyncTask.this.mDiskUsageInfo.
getProgressDrawable().setColorFilter(
new PorterDuffColorFilter(filter, Mode.MULTIPLY));
package com.cyanogenmod.filemanager.ui;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.drawable.Drawable;
-import android.util.SparseArray;
+
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+
+import java.util.HashMap;
+import java.util.Map;
/**
* A class that holds icons for a more efficient access.
*/
public class IconHolder {
- private final SparseArray<Drawable> mIcons;
+ private final Map<String, Drawable> mIcons;
/**
* Constructor of <code>IconHolder</code>.
*/
public IconHolder() {
super();
- this.mIcons = new SparseArray<Drawable>();
+ this.mIcons = new HashMap<String, Drawable>();
}
/**
* @param resid The resource identifier
* @return Drawable The drawable icon reference
*/
- public Drawable getDrawable(Context context, final int resid) {
+ public Drawable getDrawable(Context context, final String resid) {
//Check if the icon exists in the cache
- if (this.mIcons.indexOfKey(resid) > 0) {
+ if (this.mIcons.containsKey(resid)) {
return this.mIcons.get(resid);
}
//Load the drawable, cache and returns reference
- Resources res = context.getResources();
- Drawable dw = res.getDrawable(resid);
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ Drawable dw = theme.getDrawable(context, resid);
this.mIcons.put(resid, dw);
return dw;
}
--- /dev/null
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.filemanager.ui;
+
+import android.app.ActionBar;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A class that manage the use of themes inside the application.
+ */
+public final class ThemeManager {
+
+ private static final String TAG = "ThemeManager"; //$NON-NLS-1$
+
+ private static boolean DEBUG = false;
+
+ /**
+ * The permission that MUST have the activity that holds the themes
+ */
+ public static final String PERMISSION_READ_THEME =
+ "com.cyanogenmod.filemanager.permissions.READ_THEME"; //$NON-NLS-1$
+
+ /**
+ * The action that MUST have all app that want to register as a theme for this app
+ */
+ public static final String ACTION_MAIN_THEME =
+ "com.cyanogenmod.filemanager.actions.MAIN_THEME"; //$NON-NLS-1$
+
+ /**
+ * The category that MUST have all app that want to register as a theme for this app
+ */
+ public static final String CATEGORY_THEME =
+ "com.cyanogenmod.filemanager.categories.THEME"; //$NON-NLS-1$
+
+ private static final String RESOURCE_THEMES_IDS = "themes_ids"; //$NON-NLS-1$
+ private static final String RESOURCE_THEMES_NAMES = "themes_names"; //$NON-NLS-1$
+ private static final String RESOURCE_THEMES_DESCRIPTIONS = "themes_descriptions"; //$NON-NLS-1$
+ private static final String RESOURCE_THEMES_AUTHOR = "themes_author"; //$NON-NLS-1$
+
+ /**
+ * @hide
+ */
+ static Theme mDefaultTheme;
+ private static Theme mCurrentTheme;
+
+ /**
+ * Method that returns the current theme
+ *
+ * @param ctx The current context
+ * @return Theme The current theme
+ */
+ public static synchronized Theme getCurrentTheme(Context ctx) {
+ if (mCurrentTheme == null) {
+ // Use the default theme
+ mCurrentTheme = getDefaultTheme(ctx);
+ }
+ return mCurrentTheme;
+ }
+
+ /**
+ * Method that returns the default theme
+ *
+ * @param ctx The current context
+ * @return Theme The default theme
+ */
+ public static synchronized Theme getDefaultTheme(Context ctx) {
+ if (mDefaultTheme == null) {
+ // Use the default theme
+ mDefaultTheme = new Theme();
+ String themeSettings = (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue();
+ mDefaultTheme.mPackage =
+ themeSettings.substring(0, themeSettings.indexOf(":")); //$NON-NLS-1$
+ mDefaultTheme.mId =
+ themeSettings.substring(themeSettings.indexOf(":") + 1); //$NON-NLS-1$
+ mDefaultTheme.mName = ctx.getString(R.string.theme_default_name);
+ mDefaultTheme.mDescription = ctx.getString(R.string.theme_default_description);
+ mDefaultTheme.mAuthor = ctx.getString(R.string.themes_author);
+
+ mDefaultTheme.mContext = ctx;
+ mDefaultTheme.mResources = ctx.getResources();
+ }
+ return mDefaultTheme;
+ }
+
+ /**
+ * A method for set the current theme that should be applied to the UI.
+ *
+ * @param ctx The current context (of this application)
+ * @param theme The theme of the app (package:id)
+ * @return boolean If the theme was set
+ */
+ public static synchronized boolean setCurrentTheme(Context ctx, String theme) {
+ // Retrieve the available themes
+ List<Theme> themes = getAvailableThemes(ctx);
+ String themePackage = theme.substring(0, theme.indexOf(":")); //$NON-NLS-1$
+ String themeId = theme.substring(theme.indexOf(":") + 1); //$NON-NLS-1$
+ int cc = themes.size();
+ for (int i = 0; i < cc; i++) {
+ Theme t = themes.get(i);
+ if (t.mPackage.compareTo(themePackage) == 0 && t.mId.compareTo(themeId) == 0) {
+ // We have the theme. Save it and notify
+ mCurrentTheme = t;
+
+ Intent intent = new Intent(FileManagerSettings.INTENT_THEME_CHANGED);
+ intent.putExtra(FileManagerSettings.EXTRA_THEME_PACKAGE, t.mPackage);
+ intent.putExtra(FileManagerSettings.EXTRA_THEME_ID, t.mId);
+ ctx.sendBroadcast(intent);
+ return true;
+ }
+ }
+
+ // Not found
+ return false;
+ }
+
+ /**
+ * Method that returns the list of available themes for the file manager app.
+ *
+ * @param ctx The current context
+ * @return List<Theme> List of themes
+ */
+ public static List<Theme> getAvailableThemes(Context ctx) {
+ Intent intent = new Intent(ACTION_MAIN_THEME);
+ intent.addCategory(CATEGORY_THEME);
+ if (DEBUG) {
+ intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);
+ }
+
+ // Obtain the list of packages that matches with theme requirements for register as
+ // a file manager theme
+ PackageManager pm = ctx.getPackageManager();
+ List<ResolveInfo> result =
+ pm.queryIntentActivities(intent, 0);
+
+ // Read now the information about the themes
+ List<Theme> themes = new ArrayList<Theme>();
+ int cc = result.size();
+ for (int i = 0; i < cc; i++) {
+ try {
+ ResolveInfo info = result.get(i);
+ String appPackage = info.activityInfo.packageName;
+
+ // Check permission for read theme
+ String appPermission = info.activityInfo.permission;
+ if (appPermission == null || appPermission.compareTo(PERMISSION_READ_THEME) != 0) {
+ Log.w(TAG, String.format(
+ "\"%s\" hasn't READ_THEME permission. Ignored.", //$NON-NLS-1$
+ appPackage));
+ continue;
+ }
+
+ Resources appResources = pm.getResourcesForApplication(appPackage);
+ if (appResources != null) {
+ // We need the ids, names, descriptions and author of every
+ // theme in the application
+
+ //- Identifiers
+ int identifiers =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_IDS,
+ "array", //$NON-NLS-1$
+ appPackage);
+ if (identifiers == 0) continue;
+ String[] ids = appResources.getStringArray(identifiers);
+
+ //- Name
+ int namesId =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_NAMES,
+ "array", //$NON-NLS-1$
+ appPackage);
+ if (namesId == 0) continue;
+ String[] names = appResources.getStringArray(namesId);
+
+ //- Descriptions
+ int descriptionsId =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_DESCRIPTIONS,
+ "array", //$NON-NLS-1$
+ appPackage);
+ if (descriptionsId == 0) continue;
+ String[] descriptions = appResources.getStringArray(descriptionsId);
+
+ //- Author
+ int authorId =
+ appResources.getIdentifier(
+ RESOURCE_THEMES_AUTHOR,
+ "string", //$NON-NLS-1$
+ appPackage);
+ if (authorId == 0) continue;
+ String author = appResources.getString(authorId);
+
+ // Get the resources and the context
+ Context context = ctx.createPackageContext(
+ appPackage, Context.CONTEXT_RESTRICTED);
+ Resources resources = pm.getResourcesForApplication(appPackage);
+
+ // Add every theme found
+ for (int j = 0; j < names.length; j++) {
+ Theme theme = new Theme();
+ theme.mPackage = appPackage;
+ theme.mId = ids[j];
+ theme.mName = names[j];
+ theme.mDescription = descriptions[j];
+ theme.mAuthor = author;
+ theme.mContext = context;
+ theme.mResources = resources;
+ themes.add(theme);
+
+ if (DEBUG) {
+ Log.v(TAG, String.format("Found theme: %s", theme)); //$NON-NLS-1$
+ }
+ }
+ }
+
+ } catch (Exception e) {/**NON BLOCK**/}
+ }
+
+ // Return the themes found
+ themes.add(0, getDefaultTheme(ctx));
+ return themes;
+ }
+
+ /**
+ * Method that returns if the theme is the default theme
+ *
+ * @param theme The theme to check
+ * @return boolean Id the current theme is the default theme
+ */
+ public static boolean isDefaultTheme(Theme theme) {
+ String themeSettings = (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue();
+ String defaultPackage =
+ themeSettings.substring(0, themeSettings.indexOf(":")); //$NON-NLS-1$
+ String defaultId =
+ themeSettings.substring(themeSettings.indexOf(":") + 1); //$NON-NLS-1$
+ return theme.mPackage.compareTo(defaultPackage) == 0 &&
+ theme.mId.compareTo(defaultId) == 0;
+ }
+
+
+ /**
+ * A class that represents a theme for the file manager app.
+ */
+ public static class Theme implements Comparable<Theme> {
+
+ String mPackage;
+ String mId;
+ String mName;
+ String mDescription;
+ String mAuthor;
+
+ Context mContext;
+ Resources mResources;
+
+ /**
+ * Constructor of <code>Theme</code>
+ */
+ Theme() {
+ super();
+ }
+
+ /**
+ * Method that returns the composed identifier
+ *
+ * @return String The composed identifier
+ */
+ public String getComposedId() {
+ return String.format("%s:%s", this.mPackage, this.mId); //$NON-NLS-1$
+ }
+
+ /**
+ * Method that returns the package name of the apk that contains the theme
+ *
+ * @return String The package name of the apk that contains the theme
+ */
+ public String getPackage() {
+ return this.mPackage;
+ }
+
+ /**
+ * Method that returns the id of the theme inside the themes apk
+ *
+ * @return String The id of the theme inside the themes apk
+ */
+ public String getId() {
+ return this.mId;
+ }
+
+ /**
+ * Method that returns the name of the theme
+ *
+ * @return String The name of the theme
+ */
+ public String getName() {
+ return this.mName;
+ }
+
+ /**
+ * Method that returns the description of the theme
+ *
+ * @return String The description of the theme
+ */
+ public String getDescription() {
+ return this.mDescription;
+ }
+
+ /**
+ * Method that returns the author of the theme
+ *
+ * @return String The author of the theme
+ */
+ public String getAuthor() {
+ return this.mAuthor;
+ }
+
+ /**
+ * Method that returns the preview image of the current theme
+ *
+ * @param ctx The current context
+ * @return Drawable The drawable
+ */
+ public Drawable getPreviewImage(Context ctx) {
+ String resId = "theme_preview_drawable"; //$NON-NLS-1$
+ if (this.compareTo(ThemeManager.getDefaultTheme(ctx)) != 0) {
+ resId =
+ String.format(
+ "%s_%s", //$NON-NLS-1$
+ this.mId,
+ "theme_preview_drawable"); //$NON-NLS-1$
+ }
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getDrawable(id);
+ }
+ return null;
+ }
+
+ /**
+ * Method that returns the preview image of the current theme
+ *
+ * @param ctx The current context
+ * @return Drawable The drawable
+ */
+ public Drawable getNoPreviewImage(Context ctx) {
+ String resId =
+ String.format(
+ "%s_%s", //$NON-NLS-1$
+ this.mId,
+ "theme_no_preview_drawable"); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getDrawable(id);
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ "theme_no_preview_drawable", //$NON-NLS-1$
+ "drawable", //$NON-NLS-1$
+ mDefaultTheme.mPackage);
+ return mDefaultTheme.mResources.getDrawable(id);
+ }
+
+ /**
+ * Method that sets the base theme of the current context
+ *
+ * @param ctx The current context
+ * @param overlay Indicates if the theme should be the overlay one
+ */
+ public void setBaseTheme(Context ctx, boolean overlay) {
+ String resId =
+ String.format("%s_%s", this.mId, "base_theme"); //$NON-NLS-1$ //$NON-NLS-2$
+ int id = this.mResources.getIdentifier(resId, "string", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ String base = this.mResources.getString(id, "holo_light"); //$NON-NLS-1$
+ int themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo :
+ R.style.FileManager_Theme_Holo_Light;
+ if (overlay) {
+ themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo_Overlay :
+ R.style.FileManager_Theme_Holo_Light_Overlay;
+ }
+ ctx.setTheme(themeId);
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ "base_theme", "string", mDefaultTheme.mPackage); //$NON-NLS-1$ //$NON-NLS-2$
+ String base = this.mResources.getString(id, "holo_light"); //$NON-NLS-1$
+ int themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo :
+ R.style.FileManager_Theme_Holo_Light;
+ if (overlay) {
+ themeId = base.compareTo("holo") == 0 ? //$NON-NLS-1$
+ R.style.FileManager_Theme_Holo_Overlay :
+ R.style.FileManager_Theme_Holo_Light_Overlay;
+ }
+ ctx.setTheme(themeId);
+ }
+
+ /**
+ * Method that sets the titlebar drawable of an ActionBar
+ *
+ * @param ctx The current context
+ * @param actionBar The action bar
+ * @param resource The string resource
+ */
+ public void setTitlebarDrawable(Context ctx, ActionBar actionBar, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ actionBar.setBackgroundDrawable(this.mResources.getDrawable(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ actionBar.setBackgroundDrawable(mDefaultTheme.mResources.getDrawable(id));
+ }
+
+ /**
+ * Method that sets the background drawable of a View
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setBackgroundDrawable(Context ctx, View view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setBackground(this.mResources.getDrawable(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setBackground(mDefaultTheme.mResources.getDrawable(id));
+ }
+
+ /**
+ * Method that sets the image drawable of a ImageView
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setImageDrawable(Context ctx, ImageView view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setImageDrawable(this.mResources.getDrawable(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setImageDrawable(mDefaultTheme.mResources.getDrawable(id));
+ }
+
+ /**
+ * Method that returns an image drawable of the current theme
+ *
+ * @param ctx The current context
+ * @param resource The string resource
+ * @return Drawable The drawable
+ */
+ public Drawable getDrawable(Context ctx, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "drawable", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getDrawable(id);
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "drawable", mDefaultTheme.mPackage); //$NON-NLS-1$
+ return mDefaultTheme.mResources.getDrawable(id);
+ }
+
+ /**
+ * Method that sets the text color of a TextView
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setTextColor(Context ctx, TextView view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "color", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setTextColor(this.mResources.getColor(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "color", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setTextColor(mDefaultTheme.mResources.getColor(id));
+ }
+
+ /**
+ * Method that returns a color from the theme
+ *
+ * @param ctx The current context
+ * @param resource The string resource
+ * @return int The color reference
+ */
+ public int getColor(Context ctx, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "color", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ return this.mResources.getColor(id);
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "color", mDefaultTheme.mPackage); //$NON-NLS-1$
+ return mDefaultTheme.mResources.getColor(id);
+ }
+
+ /**
+ * Method that sets the background color of a View
+ *
+ * @param ctx The current context
+ * @param view The view which apply the style
+ * @param resource The string resource
+ */
+ public void setBackgroundColor(Context ctx, View view, String resource) {
+ String resId = String.format("%s_%s", this.mId, resource); //$NON-NLS-1$
+ int id = this.mResources.getIdentifier(resId, "color", this.mPackage); //$NON-NLS-1$
+ if (id != 0) {
+ view.setBackgroundColor(this.mResources.getColor(id));
+ return;
+ }
+
+ // Default theme
+ id = mDefaultTheme.mResources.getIdentifier(
+ resource, "color", mDefaultTheme.mPackage); //$NON-NLS-1$
+ view.setBackgroundColor(mDefaultTheme.mResources.getColor(id));
+ }
+
+ /**
+ * Method that set the style of the dialog.
+ *
+ * @param ctx The current context
+ * @param dialog The dialog which apply the style
+ */
+ @SuppressWarnings("deprecation")
+ public void setDialogStyle(Context ctx, AlertDialog dialog) {
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON1));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON2));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON3));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON_NEGATIVE));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON_NEUTRAL));
+ applyButtonStyle(ctx, dialog.getButton(DialogInterface.BUTTON_POSITIVE));
+ }
+
+ /**
+ * Method that apply the current style to a button
+ *
+ * @param ctx The current context
+ * @param button The button which apply the style
+ */
+ private void applyButtonStyle(Context ctx, Button button) {
+ if (button != null) {
+ setBackgroundDrawable(ctx, button, "selectors_button_drawable"); //$NON-NLS-1$
+ setTextColor(ctx, button, "text_color"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return "Theme [Package=" + this.mPackage + //$NON-NLS-1$
+ ", Id=" + this.mId + //$NON-NLS-1$
+ ", Name=" + this.mName //$NON-NLS-1$
+ + ", Description=" + this.mDescription //$NON-NLS-1$
+ + ", Author=" + this.mAuthor + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int compareTo(Theme another) {
+ return getComposedId().compareTo(another.getComposedId());
+ }
+ }
+
+}
import com.cyanogenmod.filemanager.model.FileSystemObject;
import com.cyanogenmod.filemanager.model.SystemFile;
import com.cyanogenmod.filemanager.preferences.AccessMode;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.BookmarksActionPolicy;
import com.cyanogenmod.filemanager.ui.policy.CompressActionPolicy;
import com.cyanogenmod.filemanager.ui.policy.CopyMoveActionPolicy;
this.mListView.setLayoutParams(params);
this.mListView.setAdapter(adapter);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, this.mListView, "background_drawable"); //$NON-NLS-1$
+ this.mListView.setDivider(
+ theme.getDrawable(context, "horizontal_divider_drawable")); //$NON-NLS-1$
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
TwoColumnsMenuListAdapter adapter =
(TwoColumnsMenuListAdapter)this.mListView.getAdapter();
configureMenu(adapter.getMenu());
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
@Override
public void onCancel(DialogInterface dialog) {
//Show the menu again
- ActionsDialog.this.mDialog.show();
+ DialogHelper.delegateDialogShow(
+ ActionsDialog.this.mContext, ActionsDialog.this.mDialog);
}
});
inputNameDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onCancel(DialogInterface dialog) {
//Show the menu again
- ActionsDialog.this.mDialog.show();
+ DialogHelper.delegateDialogShow(
+ ActionsDialog.this.mContext, ActionsDialog.this.mDialog);
}
});
inputNameDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
import android.widget.ListAdapter;
import android.widget.Toast;
-import com.cyanogenmod.filemanager.FileManagerApplication;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.adapters.AssociationsAdapter;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.IntentsActionPolicy;
+import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.ExceptionUtil;
private void init(int icon, String title, String action,
OnCancelListener onCancelListener, OnDismissListener onDismissListener) {
boolean isPlatformSigned =
- FileManagerApplication.isAppPlatformSignature(this.mContext);
+ AndroidHelper.isAppPlatformSignature(this.mContext);
//Create the layout, and retrieve the views
LayoutInflater li =
dialogTitle = this.mContext.getString(R.string.associations_dialog_title);
}
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(this.mContext, v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(this.mContext, this.mRemember, "text_color"); //$NON-NLS-1$
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
this.mContext,
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
// Set user preferences
this.mDialog.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(false);
// Ignore it if the preferred can be saved. Only notify the user and open the
// intent
boolean isPlatformSigned =
- FileManagerApplication.isAppPlatformSignature(this.mContext);
+ AndroidHelper.isAppPlatformSignature(this.mContext);
if (isPlatformSigned && this.mAllowPreferred) {
if (filter != null && !isPreferredSelected()) {
try {
import android.text.Layout;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
+import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.cyanogenmod.filemanager.commands.AsyncResultExecutable;
import com.cyanogenmod.filemanager.commands.ExecExecutable;
import com.cyanogenmod.filemanager.model.FileSystemObject;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.FixedQueue;
import com.cyanogenmod.filemanager.util.FixedQueue.EmptyQueueException;
LayoutInflater li =
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup layout = (ViewGroup)li.inflate(R.layout.execution_dialog, null);
+ View tvScriptNameLabel = layout.findViewById(R.id.execution_script_name_label);
TextView tvScriptName = (TextView)layout.findViewById(R.id.execution_script_name);
tvScriptName.setText(fso.getFullPath());
+ View tvTimeLabel = layout.findViewById(R.id.execution_time_label);
this.mTvTime = (TextView)layout.findViewById(R.id.execution_time);
this.mTvTime.setText("-"); //$NON-NLS-1$
+ View tvExitCodeLabel = layout.findViewById(R.id.execution_exitcode_label);
this.mTvExitCode = (TextView)layout.findViewById(R.id.execution_exitcode);
this.mTvExitCode.setText("-"); //$NON-NLS-1$
this.mTvOutput = (TextView)layout.findViewById(R.id.execution_output);
this.mTvOutput.setMovementMethod(new ScrollingMovementMethod());
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, layout, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)tvScriptNameLabel, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, tvScriptName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)tvTimeLabel, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mTvTime, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)tvExitCodeLabel, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mTvExitCode, "text_color"); //$NON-NLS-1$
+ theme.setBackgroundColor(context, this.mTvOutput, "console_bg_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mTvOutput, "console_fg_color"); //$NON-NLS-1$
+
//Create the dialog
String title = context.getString(R.string.execution_console_title);
this.mDialog = DialogHelper.createDialog(
this.mDialog.setButton(
DialogInterface.BUTTON_NEUTRAL, context.getString(android.R.string.cancel), this);
- // Is cancellable
- this.mDialog.setCancelable(false);
- this.mTvOutput.post(new Runnable() {
- @Override
- public void run() {
- ExecutionDialog.this.mDialog.getButton(
- DialogInterface.BUTTON_NEUTRAL).setEnabled(false);
- }
- });
-
// Start the drawing task
this.mConsoleDrawTask.execute();
}
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
+ this.mDialog.setCancelable(false);
+ this.mDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setEnabled(false);
}
/**
import com.cyanogenmod.filemanager.preferences.AccessMode;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.DiskUsageGraph;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
private final Context mContext;
private final AlertDialog mDialog;
+ private final View mContentView;
private View mInfoViewTab;
private View mDiskUsageViewTab;
private View mInfoView;
//Inflate the content
LayoutInflater li =
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View contentView = li.inflate(R.layout.filesystem_info_dialog, null);
+ this.mContentView = li.inflate(R.layout.filesystem_info_dialog, null);
+
+ // Apply the current theme
+ applyTheme();
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
0,
R.string.filesystem_info_dialog_title,
- contentView);
+ this.mContentView);
this.mDialog.setButton(
DialogInterface.BUTTON_NEGATIVE,
this.mContext.getString(android.R.string.cancel),
(DialogInterface.OnClickListener)null);
//Fill the dialog
- fillData(contentView);
+ fillData(this.mContentView);
}
/**
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
this.mContext, R.style.secondary_text_appearance);
this.mInfoView.setVisibility(View.VISIBLE);
this.mDiskUsageView.setVisibility(View.GONE);
+
+ // Apply theme
+ applyTabTheme();
}
this.mInfoMsgView.setVisibility(
this.mIsMountAllowed || !this.mIsAdvancedMode ? View.GONE : View.VISIBLE);
this.mContext, R.style.primary_text_appearance);
this.mInfoView.setVisibility(View.GONE);
this.mDiskUsageView.setVisibility(View.VISIBLE);
+
+ // Apply theme
+ applyTabTheme();
}
this.mDiskUsageGraph.post(new Runnable() {
@Override
}
}
+ /**
+ * Method that applies the current theme to the activity
+ */
+ private void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(
+ this.mContext, this.mContentView, "background_drawable"); //$NON-NLS-1$
+ applyTabTheme();
+ View v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_divider1);
+ theme.setBackgroundColor(this.mContext, v, "horizontal_divider_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_divider2);
+ theme.setBackgroundColor(this.mContext, v, "vertical_divider_color"); //$NON-NLS-1$
+
+ v = this.mContentView.findViewById(R.id.filesystem_info_status_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_status);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_mount_point_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_mount_point);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_device_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_device);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_type_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_type);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_options_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_options);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dump_pass_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dump_pass);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_msg);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ ((TextView)v).setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+
+ v = this.mContentView.findViewById(R.id.filesystem_info_total_disk_usage_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_total_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_used_disk_usage_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_used_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_free_disk_usage_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_free_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
+ /**
+ * Method that applies the current theme to the tab host
+ */
+ private void applyTabTheme() {
+ // Apply the theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ View v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_info);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.filesystem_info_dialog_tab_disk_usage);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
}
import com.cyanogenmod.filemanager.preferences.AccessMode;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.AIDHelper;
import com.cyanogenmod.filemanager.util.CommandHelper;
import com.cyanogenmod.filemanager.util.DialogHelper;
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.mContentView = li.inflate(R.layout.fso_properties_dialog, null);
+ // Apply current theme
+ applyTheme();
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
this.mContext, R.style.secondary_text_appearance);
this.mInfoView.setVisibility(View.VISIBLE);
this.mPermissionsView.setVisibility(View.GONE);
+
+ // Apply the them
+ applyTabTheme();
}
break;
this.mInfoView.setVisibility(View.GONE);
this.mPermissionsView.setVisibility(View.VISIBLE);
+ // Apply the them
+ applyTabTheme();
+
// Adjust the size of the spinners
adjustSpinnerSize(this.mSpnOwner);
adjustSpinnerSize(this.mSpnGroup);
String msg = null;
try {
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setTextColor(
+ this.mContext, ((TextView) parent.getChildAt(0)), "text_color"); //$NON-NLS-1$
+
String row = parent.getItemAtPosition(position).toString();
int uid = Integer.parseInt(row.substring(0, row.indexOf(AID_SEPARATOR)));
String name = row.substring(row.indexOf(AID_SEPARATOR) + 3);
});
}
+ /**
+ * Method that applies the current theme to the activity
+ */
+ private void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ theme.setBackgroundDrawable(
+ this.mContext, this.mContentView, "background_drawable"); //$NON-NLS-1$
+ applyTabTheme();
+ View v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_divider1);
+ theme.setBackgroundColor(this.mContext, v, "horizontal_divider_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_divider2);
+ theme.setBackgroundColor(this.mContext, v, "vertical_divider_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_divider3);
+ theme.setBackgroundColor(this.mContext, v, "vertical_divider_color"); //$NON-NLS-1$
+
+ v = this.mContentView.findViewById(R.id.fso_properties_name_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_name);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_parent_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_parent);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_type_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_type);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_category_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_category);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_link_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_link);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_size_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_size);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_contains_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_contains);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_date_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_date);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+
+ v = this.mContentView.findViewById(R.id.fso_properties_owner_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_group_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_special_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_read_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_write_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_execute_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_owner_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_group_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_permissions_others_label);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_info_msg);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ ((TextView)v).setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+ }
+
+ /**
+ * Method that applies the current theme to the tab host
+ */
+ private void applyTabTheme() {
+ // Apply the theme
+ Theme theme = ThemeManager.getCurrentTheme(this.mContext);
+ View v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_info);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ v = this.mContentView.findViewById(R.id.fso_properties_dialog_tab_permissions);
+ theme.setTextColor(this.mContext, (TextView)v, "text_color"); //$NON-NLS-1$
+ }
+
}
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
+import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.preferences.FileManagerSettings;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.widgets.DirectoryInlineAutocompleteTextView;
import com.cyanogenmod.filemanager.util.DialogHelper;
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout layout = (LinearLayout)li.inflate(R.layout.initial_directory, null);
final View msgView = layout.findViewById(R.id.initial_directory_info_msg);
+ final TextView labelView = (TextView)layout.findViewById(R.id.initial_directory_label);
this.mAutocomplete =
(DirectoryInlineAutocompleteTextView)layout.findViewById(
R.id.initial_directory_edittext);
});
this.mAutocomplete.setText(value);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, layout, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, labelView, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, (TextView)msgView, "text_color"); //$NON-NLS-1$
+ ((TextView)msgView).setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+ this.mAutocomplete.applyTheme();
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.FileSystemObject;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import com.cyanogenmod.filemanager.util.FileHelper;
this.mEditText.addTextChangedListener(this);
this.mMsg = (TextView)v.findViewById(R.id.input_name_dialog_message);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, v, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, title, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mMsg, "text_color"); //$NON-NLS-1$
+ this.mMsg.setCompoundDrawablesWithIntrinsicBounds(
+ theme.getDrawable(this.mContext, "filesystem_warning_drawable"), //$NON-NLS-1$
+ null, null, null);
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
/**
labelView.setText(labelMsg);
this.mProgress = (TextView)layout.findViewById(R.id.message_progress_dialog_progress);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, layout, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, labelView, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(context, this.mProgress, "text_color"); //$NON-NLS-1$
+
//Create the dialog
this.mDialog = DialogHelper.createDialog(
context,
* Method that shows the dialog.
*/
public void show() {
- this.mDialog.show();
+ DialogHelper.delegateDialogShow(this.mContext, this.mDialog);
}
/**
@Override
public void onNoSelectChoice() {/**NON BLOCK**/}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
}
}
@Override
public void onNoSelectChoice() {/**NON BLOCK**/}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
}
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
} else {
// Execute background task
task.execute(task);
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
} else {
// Execute background task
task.execute(task);
DialogHelper.createErrorDialog(ctx,
R.string.error_title,
R.string.msgs_illegal_argument);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
// 2.- All the destination files must have the same parent and it must be currentDirectory,
DialogHelper.createErrorDialog(ctx,
R.string.error_title,
R.string.msgs_illegal_argument);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
if (linkedRes.mDst.getParent() == null ||
DialogHelper.createErrorDialog(ctx,
R.string.error_title,
R.string.msgs_illegal_argument);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
}
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return;
}
}
ctx,
R.string.error_title,
R.string.msgs_unresolved_inconsistencies);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return false;
}
ctx,
R.string.error_title,
R.string.msgs_operation_not_allowed_in_current_directory);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return false;
}
}
}
}
});
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
}
/**
ctx,
R.string.warning_title,
R.string.msgs_unresolved_inconsistencies);
- dialog.show();
+ DialogHelper.delegateDialogShow(ctx, dialog);
return false;
}
}
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper.MimeTypeCategory;
+import com.cyanogenmod.filemanager.util.ResourcesHelper;
import java.io.File;
import java.util.ArrayList;
}
shortcutIntent.putExtra(ShortcutActivity.EXTRA_FSO, fso.getFullPath());
+ // Obtain the icon drawable (don't use here the themeable drawable)
+ String resid = MimeTypeHelper.getIcon(ctx, fso);
+ int dwid =
+ ResourcesHelper.getIdentifier(
+ ctx.getResources(), "string", resid); //$NON-NLS-1$
+
// The intent to send to broadcast for register the shortcut intent
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, fso.getName());
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
- Intent.ShortcutIconResource.fromContext(
- ctx, MimeTypeHelper.getIcon(ctx, fso)));
+ Intent.ShortcutIconResource.fromContext(ctx, dwid));
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); //$NON-NLS-1$
ctx.sendBroadcast(intent);
--- /dev/null
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.filemanager.ui.preferences;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Paint;
+import android.graphics.Point;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.Display;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.HorizontalScrollView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+
+import java.util.List;
+
+/**
+ * A view that allow view all installed themes by scrolling horizontally.
+ */
+public class ThemeRoulette extends HorizontalScrollView {
+
+ /**
+ * An interface for raise theme selection events
+ */
+ public interface OnThemeScrollSelectionListener {
+ /**
+ * Method invoked when the scroll selection of a theme start
+ */
+ void onScrollSelectionStart();
+ /**
+ * Method invoked when a new scroll selection of a theme was made
+ *
+ * @param theme The new theme
+ */
+ void onScrollSelectionChanged(Theme theme);
+ }
+
+ /**
+ * @hide
+ */
+ ViewGroup mRouletteLayout;
+ private View mSpacer1;
+ private View mSpacer2;
+
+ /**
+ * @hide
+ */
+ int mSpacerWidth;
+ /**
+ * @hide
+ */
+ int mThemeWidth;
+
+ /**
+ * @hide
+ */
+ int mCurrentThemePosition;
+
+ /**
+ * @hide
+ */
+ OnThemeScrollSelectionListener mOnThemeScrollSelectionListener;
+
+ /**
+ * Constructor of <code>ThemeRoulette</code>.
+ *
+ * @param context The current context
+ */
+ public ThemeRoulette(Context context) {
+ super(context);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeRoulette</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ */
+ public ThemeRoulette(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeRoulette</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ * @param defStyle The default style to apply to this view. If 0, no style
+ * will be applied (beyond what is included in the theme). This may
+ * either be an attribute resource, whose value will be retrieved
+ * from the current theme, or an explicit style resource.
+ */
+ public ThemeRoulette(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init();
+ }
+
+ /**
+ * Method that initializes the view
+ */
+ private void init() {
+ this.mRouletteLayout = (ViewGroup)inflate(getContext(), R.layout.theme_roulette, null);
+ this.mRouletteLayout.setLayoutParams(
+ new LinearLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ this.mSpacer1 = this.mRouletteLayout.findViewById(R.id.spacer1);
+ this.mSpacer2 = this.mRouletteLayout.findViewById(R.id.spacer2);
+ addView(this.mRouletteLayout);
+
+ this.mCurrentThemePosition = -1;
+
+ setSmoothScrollingEnabled(false);
+ }
+
+ /**
+ * Method that sets the listener where return theme scroll selection changes
+ *
+ * @param onThemeScrollSelectionListener The listener
+ */
+ public void setOnThemeScrollSelectionListener(
+ OnThemeScrollSelectionListener onThemeScrollSelectionListener) {
+ this.mOnThemeScrollSelectionListener = onThemeScrollSelectionListener;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
+ int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
+ this.setMeasuredDimension(parentWidth, parentHeight);
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+
+ int mw = (int)getResources().getDimension(R.dimen.theme_max_width);
+ int w = (int)(getWidth() / 1.5);
+ this.mSpacerWidth = (getWidth() - Math.min(w, mw)) / 2;
+ this.mSpacer1.getLayoutParams().width = this.mSpacerWidth;
+ this.mSpacer2.getLayoutParams().width = this.mSpacerWidth;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean onTouchEvent(MotionEvent ev) {
+
+ // Detect the motion
+ int action = ev.getAction();
+ switch (action & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_DOWN:
+ break;
+
+ case MotionEvent.ACTION_MOVE:
+ if (this.mOnThemeScrollSelectionListener != null) {
+ this.mOnThemeScrollSelectionListener.onScrollSelectionStart();
+ }
+ break;
+
+ case MotionEvent.ACTION_CANCEL:
+ case MotionEvent.ACTION_UP:
+ post(new Runnable() {
+ @Override
+ public void run() {
+ int themeViewPosition = getVisibleThemeViewPosition();
+ if (themeViewPosition >= 1) {
+ ThemeRoulette.this.mCurrentThemePosition = themeViewPosition;
+ scrollToThemePosition(themeViewPosition, true);
+ }
+ }
+ });
+ break;
+ }
+ return super.onTouchEvent(ev);
+ }
+
+ /**
+ * Method that sets the themes of this roulette
+ *
+ * @param themes The themes of this roulette
+ * @param currentTheme The current theme
+ * @param scrollTo The theme to scroll to
+ */
+ public void setThemes(List<Theme> themes, Theme currentTheme, final int scrollTo) {
+ int cc = themes.size();
+ int pos = -1;
+ for (int i = 0; i < cc; i++) {
+ Theme theme = themes.get(i);
+ addTheme(this.mRouletteLayout, theme);
+ if (theme.compareTo(currentTheme) == 0) {
+ pos = i + 1;
+ }
+ }
+
+ // If the theme is found
+ if (pos != -1) {
+ final int childPos = pos;
+ post(new Runnable() {
+ @Override
+ public void run() {
+ ThemeRoulette.this.mCurrentThemePosition =
+ (scrollTo > 0) ? scrollTo : childPos;
+ scrollToThemePosition(ThemeRoulette.this.mCurrentThemePosition, false);
+ markThemeAsDefault(childPos);
+ }
+ });
+ }
+ }
+
+ /**
+ * Method that adds a theme to the roulette
+ *
+ * @param root The root view
+ * @param theme The theme to add
+ */
+ private void addTheme(ViewGroup root, Theme theme) {
+ // Create the layout and assign its theme
+ ThemeView v = (ThemeView)inflate(getContext(), R.layout.theme_view, null);
+ int mw = (int)getResources().getDimension(R.dimen.theme_max_width);
+ int w = (int)(getWidth() / 1.5);
+ this.mThemeWidth = Math.min(w, mw);
+ v.setLayoutParams(
+ new LinearLayout.LayoutParams(
+ this.mThemeWidth,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ v.setTag(theme);
+
+ // Set the view info
+ TextView name = (TextView)v.findViewById(R.id.theme_name);
+ name.setText(theme.getName());
+ TextView author = (TextView)v.findViewById(R.id.theme_author);
+ author.setText(theme.getAuthor());
+ TextView desc = (TextView)v.findViewById(R.id.theme_desc);
+ desc.setText(theme.getDescription());
+ ImageView preview = (ImageView)v.findViewById(R.id.theme_preview);
+ preview.setContentDescription(theme.getName());
+ Drawable dw = theme.getPreviewImage(getContext());
+ if (dw != null) {
+ preview.setImageDrawable(dw);
+ } else {
+ dw = theme.getNoPreviewImage(getContext());
+ preview.setImageDrawable(dw);
+ }
+
+ // Add to the end of the roulette
+ root.addView(v, root.getChildCount()-1);
+ }
+
+ /**
+ * Method that returns the visible theme view position, based on the position
+ * on the screen (the most centered is the current view)
+ *
+ * @return int The visible theme view position
+ * @hide
+ */
+ int getVisibleThemeViewPosition() {
+ Display display = ((Activity)getContext()).getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ display.getSize(size);
+
+ int x = size.x / 2;
+ int width = 0;
+
+ int[] location = new int[2];
+ int cc = this.mRouletteLayout.getChildCount()-1;
+ for (int i = 1; i < cc; i++) {
+ View v = this.mRouletteLayout.getChildAt(i);
+ if (v instanceof ThemeView) {
+ v.getLocationOnScreen(location);
+ width = v.getWidth();
+ if (location[0] <= x && x <= (location[0] + width)) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Method that scroll to the theme position
+ *
+ * @param position The position where to scroll
+ * @param smooth Use a smooth scroll to position
+ * @hide
+ */
+ void scrollToThemePosition(int position, boolean smooth) {
+ if (position <= 0) return;
+ int x = 0;
+ if (position > 1) {
+ x += ThemeRoulette.this.mThemeWidth * (position - 1);
+ }
+ if (smooth) {
+ smoothScrollTo(x, 0);
+ } else {
+ scrollTo(x, 0);
+ }
+
+ // Notify the change
+ if (ThemeRoulette.this.mOnThemeScrollSelectionListener != null) {
+ ThemeView v =
+ (ThemeView)ThemeRoulette.this.mRouletteLayout.
+ getChildAt(position);
+ ThemeRoulette.this.
+ mOnThemeScrollSelectionListener.
+ onScrollSelectionChanged((Theme)v.getTag());
+ }
+ }
+
+ /**
+ * Method that mark the current visible theme as the default
+ */
+ void markCurrentVisibleThemeAsDefault() {
+ int position = getVisibleThemeViewPosition();
+ if (position >= 1) {
+ markThemeAsDefault(position);
+ }
+ }
+
+ /**
+ * Method that mark the theme as the default
+ *
+ * @param position The position of the theme
+ */
+ void markThemeAsDefault(int position) {
+ int cc = this.mRouletteLayout.getChildCount()-1;
+ for (int i = 1; i < cc; i++) {
+ ThemeView v =
+ (ThemeView)ThemeRoulette.this.mRouletteLayout.
+ getChildAt(i);
+ if (i == position) {
+ v.getName().setPaintFlags(
+ v.getName().getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
+ } else {
+ v.getName().setPaintFlags(
+ v.getName().getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.filemanager.ui.preferences;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Point;
+import android.os.AsyncTask;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.preference.Preference;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Display;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+import com.cyanogenmod.filemanager.ui.preferences.ThemeRoulette.OnThemeScrollSelectionListener;
+import com.cyanogenmod.filemanager.util.DialogHelper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A preference implementation for the selection of a theme.
+ */
+public class ThemeSelectorPreference extends Preference implements OnClickListener {
+
+ private static final String TAG = "ThemeSelectorPreference"; //$NON-NLS-1$
+
+ /**
+ * @hide
+ */
+ final AsyncTask<Void, Integer, List<Theme>> mThemeTask =
+ new AsyncTask<Void, Integer, List<Theme>>() {
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected List<Theme> doInBackground(Void... params) {
+ List<Theme> themes = new ArrayList<Theme>();
+ themes.addAll(ThemeManager.getAvailableThemes(getContext()));
+ return themes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onPostExecute(List<Theme> result) {
+ ThemeSelectorPreference.this.mRoulette.setThemes(
+ result,
+ ThemeManager.getCurrentTheme(getContext()),
+ ThemeSelectorPreference.this.mScrollTo);
+ ThemeSelectorPreference.this.mWaiting.setVisibility(View.GONE);
+ }
+ };
+
+
+ private View mRootView;
+ /**
+ * @hide
+ */
+ Button mButton;
+ /**
+ * @hide
+ */
+ ThemeRoulette mRoulette;
+ /**
+ * @hide
+ */
+ ProgressBar mWaiting;
+
+ // The visible theme, selected by scrolling. This may not be the current theme.
+ /**
+ * @hide
+ */
+ Theme mSelectedTheme;
+
+ /**
+ * @hide
+ */
+ int mScrollTo = -1;
+
+ /**
+ * Constructor of <code>ThemeSelectorPreference</code>.
+ *
+ * @param context The current context
+ */
+ public ThemeSelectorPreference(Context context) {
+ super(context);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeSelectorPreference</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ */
+ public ThemeSelectorPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ /**
+ * Constructor of <code>ThemeSelectorPreference</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ * @param defStyle The default style to apply to this view. If 0, no style
+ * will be applied (beyond what is included in the theme). This may
+ * either be an attribute resource, whose value will be retrieved
+ * from the current theme, or an explicit style resource.
+ */
+ public ThemeSelectorPreference(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init();
+ }
+
+ /**
+ * Method that initializes the preference
+ */
+ private void init() {
+ setLayoutResource(R.layout.theme_selector_preference);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected View onCreateView(ViewGroup parent) {
+ this.mRootView = super.onCreateView(parent);
+ this.mButton = (Button)this.mRootView.findViewById(R.id.theme_button);
+ this.mButton.setOnClickListener(this);
+ this.mRoulette = (ThemeRoulette)this.mRootView.findViewById(R.id.theme_roulette);
+ this.mRoulette.setOnThemeScrollSelectionListener(new OnThemeScrollSelectionListener() {
+ @Override
+ public void onScrollSelectionStart() {
+ ThemeSelectorPreference.this.mButton.setEnabled(false);
+ }
+
+ @Override
+ public void onScrollSelectionChanged(Theme theme) {
+ boolean enabled = ThemeManager.getCurrentTheme(getContext()).compareTo(theme) != 0;
+ ThemeSelectorPreference.this.mButton.setEnabled(enabled);
+ if (enabled) {
+ ThemeSelectorPreference.this.mSelectedTheme = theme;
+ }
+ }
+ });
+ this.mWaiting = (ProgressBar)this.mRootView.findViewById(R.id.theme_waiting);
+ return this.mRootView;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onBindView(final View view) {
+ super.onBindView(view);
+ view.post(new Runnable() {
+ @Override
+ public void run() {
+ Resources res = getContext().getResources();
+ Display display = ((Activity)getContext()).getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ display.getSize(size);
+
+ // Set the preference height
+ int rowHeight = (int)res.getDimension(R.dimen.extra_margin);
+ int[] window = new int[2];
+ view.getLocationInWindow(window);
+ view.getLayoutParams().height = size.y - window[1] - rowHeight;
+
+ // The button width
+ int minWidth = (int)res.getDimension(R.dimen.themes_min_width_button);
+ int w = ThemeSelectorPreference.this.mButton.getWidth();
+ ThemeSelectorPreference.this.mButton.setWidth(Math.max(minWidth, w));
+
+ // Now display the progress and load the themes in background
+ ThemeSelectorPreference.this.mWaiting.setVisibility(View.VISIBLE);
+ ThemeSelectorPreference.this.mThemeTask.execute();
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onClick(View v) {
+ String newValue = this.mSelectedTheme.getComposedId();
+ if (ThemeManager.setCurrentTheme(getContext(), newValue)) {
+ if (!persistString(newValue)) {
+ Log.w(TAG, "can't save theme preference"); //$NON-NLS-1$
+ }
+ this.mRoulette.markCurrentVisibleThemeAsDefault();
+ callChangeListener(newValue);
+
+ // Now we are in the current theme
+ ThemeSelectorPreference.this.mSelectedTheme =
+ ThemeManager.getCurrentTheme(getContext());
+ ThemeSelectorPreference.this.mButton.setEnabled(false);
+
+ // Display a confirmation
+ DialogHelper.showToast(
+ getContext(), R.string.pref_themes_confirmation, Toast.LENGTH_SHORT);
+ } else {
+ // The theme was not found
+ DialogHelper.showToast(
+ getContext(), R.string.pref_themes_not_found, Toast.LENGTH_SHORT);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Parcelable onSaveInstanceState() {
+ final Parcelable superState = super.onSaveInstanceState();
+ final SavedState myState = new SavedState(superState);
+ myState.mPosition = this.mRoulette.mCurrentThemePosition;
+ return myState;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onRestoreInstanceState(Parcelable state) {
+ if (state == null || !state.getClass().equals(SavedState.class)) {
+ // Didn't save state for us in onSaveInstanceState
+ super.onRestoreInstanceState(state);
+ return;
+ }
+
+ SavedState myState = (SavedState) state;
+ super.onRestoreInstanceState(myState.getSuperState());
+ this.mScrollTo = myState.mPosition;
+ }
+
+ /**
+ * A saved state persistence class
+ */
+ static class SavedState extends BaseSavedState {
+ int mPosition;
+
+ /**
+ * Constructor of <code>SavedState</code>
+ *
+ * @param source The original parcel
+ */
+ public SavedState(Parcel source) {
+ super(source);
+ this.mPosition = source.readInt();
+ }
+
+ /**
+ * Constructor of <code>SavedState</code>
+ *
+ * @param superState The super state
+ */
+ public SavedState(Parcelable superState) {
+ super(superState);
+ this.mPosition = -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeInt(this.mPosition);
+ }
+
+ /**
+ * A class for create the saved state
+ */
+ @SuppressWarnings("hiding")
+ public static final Parcelable.Creator<SavedState> CREATOR =
+ new Parcelable.Creator<SavedState>() {
+ @Override
+ public SavedState createFromParcel(Parcel in) {
+ return new SavedState(in);
+ }
+
+ @Override
+ public SavedState[] newArray(int size) {
+ return new SavedState[size];
+ }
+ };
+ }
+}
--- /dev/null
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.filemanager.ui.preferences;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
+
+/**
+ * A view that display information about a {@link Theme}
+ */
+public class ThemeView extends RelativeLayout {
+
+ private TextView mName;
+ private TextView mAuthor;
+ private TextView mDescription;
+ private ImageView mPreview;
+
+ /**
+ * Constructor of <code>ThemeView</code>.
+ *
+ * @param context The current context
+ */
+ public ThemeView(Context context) {
+ super(context);
+ }
+
+ /**
+ * Constructor of <code>ThemeView</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ */
+ public ThemeView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ /**
+ * Constructor of <code>ThemeView</code>.
+ *
+ * @param context The current context
+ * @param attrs The attributes of the XML tag that is inflating the view.
+ * @param defStyle The default style to apply to this view. If 0, no style
+ * will be applied (beyond what is included in the theme). This may
+ * either be an attribute resource, whose value will be retrieved
+ * from the current theme, or an explicit style resource.
+ */
+ public ThemeView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+ this.mName = (TextView)findViewById(R.id.theme_name);
+ this.mAuthor = (TextView)findViewById(R.id.theme_author);
+ this.mDescription = (TextView)findViewById(R.id.theme_desc);
+ this.mPreview = (ImageView)findViewById(R.id.theme_preview);
+
+ // Apply current theme
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setTextColor(getContext(), this.mName, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(getContext(), this.mAuthor, "text_color"); //$NON-NLS-1$
+ theme.setTextColor(getContext(), this.mDescription, "text_color"); //$NON-NLS-1$
+ }
+
+ /**
+ * Method that return the view for the name of the theme
+ *
+ * @return TextView The view that holds the name of the theme
+ */
+ public TextView getName() {
+ return this.mName;
+ }
+
+ /**
+ * Method that return the view for the author of the theme
+ *
+ * @return TextView The view that holds the author of the theme
+ */
+ public TextView getAuthor() {
+ return this.mAuthor;
+ }
+
+ /**
+ * Method that return the view for the description of the theme
+ *
+ * @return TextView The view that holds the description of the theme
+ */
+ public TextView getDescription() {
+ return this.mDescription;
+ }
+
+ /**
+ * Method that return the view for the preview image of the theme
+ *
+ * @return TextView The view that holds the preview image of the theme
+ */
+ public ImageView getPreview() {
+ return this.mPreview;
+ }
+
+}
*/
DiskUsage getDiskUsageInfo();
+ /**
+ * Method that applies the current theme to the breadcrumb
+ */
+ void applyTheme();
}
package com.cyanogenmod.filemanager.ui.widgets;
import android.content.Context;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import com.cyanogenmod.filemanager.model.DiskUsage;
import com.cyanogenmod.filemanager.model.MountPoint;
import com.cyanogenmod.filemanager.tasks.FilesystemAsyncTask;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.StorageHelper;
this.mFilesystemInfo = (ImageView)findViewById(R.id.ab_filesystem_info);
this.mDiskUsageInfo = (ProgressBar)findViewById(R.id.breadcrumb_diskusage);
this.mLoading = findViewById(R.id.breadcrumb_loading);
+
+ // Change the image of filesystem (this is not called after a changeBreadcrumbPath call,
+ // so if need to be theme previously to protect from errors)
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setImageDrawable(
+ getContext(), this.mFilesystemInfo, "filesystem_warning_drawable"); //$NON-NLS-1$
}
/**
}
}
+ // Now apply the theme to the breadcrumb
+ applyTheme();
+
//Set scrollbar at the end
this.mScrollView.post(new Runnable() {
@Override
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+
+ //- Breadcrumb
+ if (this.mBreadcrumbBar != null) {
+ int cc = this.mBreadcrumbBar.getChildCount();
+ for (int i = 0; i < cc; i++) {
+ // There are 2 types: Breadcrumb items and separators
+ View v = this.mBreadcrumbBar.getChildAt(i);
+ if (v instanceof BreadcrumbItem) {
+ // Breadcrumb item
+ theme.setTextColor(
+ getContext(), (BreadcrumbItem)v, "text_color"); //$NON-NLS-1$
+ } else if (v instanceof ImageView) {
+ // Divider drawable
+ theme.setImageDrawable(
+ getContext(),
+ (ImageView)v, "breadcrumb_divider_drawable"); //$NON-NLS-1$
+ }
+ }
+ }
+ if (this.mDiskUsageInfo != null) {
+ Drawable dw = theme.getDrawable(getContext(), "horizontal_progress_bar"); //$NON-NLS-1$
+ this.mDiskUsageInfo.setProgressDrawable(dw);
+ }
+ }
}
package com.cyanogenmod.filemanager.ui.widgets;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
-import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.DiskUsage;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.ArrayList;
import java.util.Collections;
*/
public class DiskUsageGraph extends View {
- private static int sColorFilterNormal;
- private static int sColorFilterWarning;
-
/**
* @hide
*/
*/
public DiskUsageGraph(Context context) {
super(context);
- init();
}
/**
*/
public DiskUsageGraph(Context context, AttributeSet attrs) {
super(context, attrs);
- init();
}
/**
*/
public DiskUsageGraph(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- init();
- }
-
- /**
- * Method that initializes the widget
- */
- private void init() {
- if (sColorFilterNormal == 0 || sColorFilterWarning == 0) {
- Resources res = getContext().getResources();
- sColorFilterNormal = res.getColor(R.color.disk_usage_color_filter_normal);
- sColorFilterWarning = res.getColor(R.color.disk_usage_color_filter_warning);
- }
}
/**
if (this.mIndex == 0 && dwo == null) {
//Initialize the total arc circle
DiskUsageGraph.this.mDrawingObjects.add(
- createDrawingObject(rect, R.color.disk_usage_total, stroke));
+ createDrawingObject(
+ rect, "disk_usage_total_color", stroke)); //$NON-NLS-1$
continue;
}
if (this.mIndex == 1 && dwo == null) {
//Initialize the used arc circle
DiskUsageGraph.this.mDrawingObjects.add(
- createDrawingObject(rect, R.color.disk_usage_used, stroke));
+ createDrawingObject(
+ rect, "disk_usage_used_color", stroke)); //$NON-NLS-1$
continue;
}
if (this.mIndex == 1 && !disk_warning &&
dwo.mSweepAngle >= DiskUsageGraph.this.mDiskWarningAngle) {
- dwo.mPaint.setColor(getContext().
- getResources().getColor(R.color.disk_usage_used_warning));
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ dwo.mPaint.setColor(
+ theme.getColor(
+ getContext(),
+ "disk_usage_used_warning_color")); //$NON-NLS-1$
disk_warning = true;
}
* Method that creates the drawing object.
*
* @param rect The area of drawing
- * @param colorResourceId The resource identifier of the color
+ * @param colorResourceThemeId The theme resource identifier of the color
* @param stroke The stroke width
* @return DrawingObject The drawing object
*/
- private DrawingObject createDrawingObject(Rect rect, int colorResourceId, int stroke) {
+ private DrawingObject createDrawingObject(
+ Rect rect, String colorResourceThemeId, int stroke) {
DrawingObject out = new DrawingObject();
out.mSweepAngle = 0;
- out.mPaint.setColor(getContext().getResources().getColor(colorResourceId));
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ out.mPaint.setColor(theme.getColor(getContext(), colorResourceThemeId));
out.mPaint.setStrokeWidth(stroke);
out.mPaint.setAntiAlias(true);
out.mPaint.setStrokeCap(Paint.Cap.BUTT);
this.mOnItemFlingerListener = mOnItemFlingerListener;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public boolean onTouchEvent(MotionEvent ev) {
// If no flinger support is request, don't change the default behaviour
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.cyanogenmod.filemanager.R;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.DialogHelper;
import java.util.ArrayList;
button.setOnClickListener(this);
button.setOnLongClickListener(this);
+ // Apply the theme
+ applyTheme();
+
//Initialize text views
setText(""); //$NON-NLS-1$
}
}
}
+ /**
+ * Method that applies the current theme to the widget components
+ */
+ public void applyTheme() {
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ View v = findViewById(R.id.inline_autocomplete_bg_text);
+ theme.setTextColor(getContext(), (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.inline_autocomplete_fg_text);
+ theme.setTextColor(getContext(), (TextView)v, "text_color"); //$NON-NLS-1$
+ v = findViewById(R.id.inline_autocomplete_button_tab);
+ theme.setImageDrawable(
+ getContext(), (ImageView)v, "ab_tab_drawable"); //$NON-NLS-1$
+ }
+
}
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
+import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.cyanogenmod.filemanager.preferences.NavigationLayoutMode;
import com.cyanogenmod.filemanager.preferences.ObjectIdentifier;
import com.cyanogenmod.filemanager.preferences.Preferences;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.ui.policy.DeleteActionPolicy;
import com.cyanogenmod.filemanager.ui.policy.IntentsActionPolicy;
import com.cyanogenmod.filemanager.ui.widgets.FlingerListView.OnItemFlingerListener;
* Method that refresh the view data.
*/
public void refresh() {
+ refresh(false);
+ }
+
+ /**
+ * Method that refresh the view data.
+ *
+ * @param restore Restore previous position
+ */
+ public void refresh(boolean restore) {
FileSystemObject fso = null;
// Try to restore the previous scroll position
- try {
- if (this.mAdapterView != null && this.mAdapter != null) {
- int position = this.mAdapterView.getFirstVisiblePosition();
- fso = this.mAdapter.getItem(position);
- }
- } catch (Throwable _throw) {/**NON BLOCK**/}
+ if (restore) {
+ try {
+ if (this.mAdapterView != null && this.mAdapter != null) {
+ int position = this.mAdapterView.getFirstVisiblePosition();
+ fso = this.mAdapter.getItem(position);
+ }
+ } catch (Throwable _throw) {/**NON BLOCK**/}
+ }
refresh(fso);
}
return newDir;
}
+ /**
+ * Method that applies the current theme to the activity
+ */
+ public void applyTheme() {
+ //- Breadcrumb
+ if (getBreadcrumb() != null) {
+ getBreadcrumb().applyTheme();
+ }
+
+ //- Redraw the adapter view
+ Theme theme = ThemeManager.getCurrentTheme(getContext());
+ theme.setBackgroundDrawable(getContext(), this, "background_drawable"); //$NON-NLS-1$
+ if (this.mAdapter != null) {
+ this.mAdapter.notifyThemeChanged();
+ }
+ if (this.mAdapterView instanceof ListView) {
+ ((ListView)this.mAdapterView).setDivider(
+ theme.getDrawable(getContext(), "horizontal_divider_drawable")); //$NON-NLS-1$
+ }
+ refresh();
+ }
+
}
package com.cyanogenmod.filemanager.util;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.ViewConfiguration;
+import com.cyanogenmod.filemanager.R;
+
/**
* A helper class with useful methods for deal with android.
*/
* @param dp A value in dp (Device independent pixels) unit
* @return float A float value to represent Pixels equivalent to dp according to device
*/
- public static float convertDpToPixel(Context ctx, float dp){
+ public static float convertDpToPixel(Context ctx, float dp) {
Resources resources = ctx.getResources();
DisplayMetrics metrics = resources.getDisplayMetrics();
return dp * (metrics.densityDpi / 160f);
}
+ /**
+ * Method that check if the app is signed with the platform signature
+ *
+ * @param ctx The current context
+ * @return boolean If the app is signed with the platform signature
+ */
+ public static boolean isAppPlatformSignature(Context ctx) {
+ // TODO This need to be improved, checking if the app is really with the platform signature
+ try {
+ // For now only check that the app is installed in system directory
+ PackageManager pm = ctx.getPackageManager();
+ String appDir = pm.getApplicationInfo(ctx.getPackageName(), 0).sourceDir;
+ String systemDir = ctx.getString(R.string.system_dir);
+ return appDir.startsWith(systemDir);
+
+ } catch (Exception e) {
+ ExceptionUtil.translateException(ctx, e, true, false);
+ }
+ return false;
+ }
+
}
package com.cyanogenmod.filemanager.util;
-import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.model.Bookmark;
/**
* Method that returns the associated icon to the bookmark.
*
* @param bookmark The bookmark
- * @return The associated icon
+ * @return String The associated icon resource name
*/
- public static int getIcon(Bookmark bookmark) {
+ public static String getIcon(Bookmark bookmark) {
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.HOME) == 0) {
- return R.drawable.ic_holo_light_home;
+ return "ic_home_drawable"; //$NON-NLS-1$
}
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.FILESYSTEM) == 0) {
- return R.drawable.ic_holo_light_filesystem;
+ return "ic_filesystem_drawable"; //$NON-NLS-1$
}
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.SDCARD) == 0) {
- return R.drawable.ic_holo_light_sdcard;
+ return "ic_sdcard_drawable"; //$NON-NLS-1$
}
if (bookmark.mType.compareTo(Bookmark.BOOKMARK_TYPE.USB) == 0) {
- return R.drawable.ic_holo_light_usb;
+ return "ic_usb_drawable"; //$NON-NLS-1$
}
//Bookmark add by the user
- return R.drawable.ic_holo_light_user_defined_bookmark;
+ return "ic_user_defined_bookmark_drawable"; //$NON-NLS-1$
}
}
import com.cyanogenmod.filemanager.R;
import com.cyanogenmod.filemanager.adapters.CheckableListAdapter;
+import com.cyanogenmod.filemanager.ui.ThemeManager;
+import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import java.util.ArrayList;
import java.util.List;
listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
builder.setView(listView);
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, listView, "background_drawable"); //$NON-NLS-1$
+ listView.setDivider(
+ theme.getDrawable(context, "horizontal_divider_drawable")); //$NON-NLS-1$
+
builder.setNegativeButton(context.getString(R.string.cancel), new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
*/
public static AlertDialog createDialog(Context context, int icon, String title, View content) {
//Create the alert dialog
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ final AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCustomTitle(createTitle(context, icon, title, false));
builder.setView(content);
return builder.create();
vText.setFilters(new InputFilter[]{new InputFilter.AllCaps()});
}
vText.setText(title);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, lyTitle, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, vText, "dialog_text_color"); //$NON-NLS-1$
+
return lyTitle;
}
null);
TextView vMsg = (TextView)lyMessage.findViewById(R.id.dialog_message);
vMsg.setText(message);
+
+ // Apply the current theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setBackgroundDrawable(context, lyMessage, "background_drawable"); //$NON-NLS-1$
+ theme.setTextColor(context, vMsg, "text_color"); //$NON-NLS-1$
+
return lyMessage;
}
}
/**
+ * Method that delegates the display of a dialog. This method applies the style to the
+ * dialog, so all dialogs of the application MUST used this method to display the dialog.
+ *
+ * @param context The current context
+ * @param dialog The dialog to show
+ */
+ public static void delegateDialogShow(Context context, AlertDialog dialog) {
+ // Show the dialog
+ dialog.show();
+
+ // Apply theme
+ Theme theme = ThemeManager.getCurrentTheme(context);
+ theme.setDialogStyle(context, dialog);
+ }
+
+ /**
* Method that creates and display a toast dialog.
*
* @param context The context to use.
if (fToast) {
DialogHelper.showToast(context, fMsgResId, Toast.LENGTH_SHORT);
} else {
- DialogHelper.createErrorDialog(
- context, R.string.error_title, fMsgResId).show();
+ AlertDialog dialog =
+ DialogHelper.createErrorDialog(
+ context, R.string.error_title, fMsgResId);
+ DialogHelper.delegateDialogShow(context, dialog);
}
} catch (Exception e) {
Log.e(context.getClass().getSimpleName(),
}
}
});
- alert.show();
+ DialogHelper.delegateDialogShow(context, alert);
}
/**
import android.content.Context;
import android.content.res.Resources;
+import android.text.TextUtils;
import android.util.Log;
import com.cyanogenmod.filemanager.R;
*/
public static final String ALL_MIME_TYPES = "*/*"; //$NON-NLS-1$
- private static Map<String, Integer> sCachedIndentifiers;
private static Map<String, MimeTypeInfo> sMimeTypes;
/**
*
* @param context The current context
* @param fso The file system object
- * @return int The associated mime/type icon resource identifier
+ * @return String The associated mime/type icon resource identifier
*/
- public static final int getIcon(Context context, FileSystemObject fso) {
+ public static final String getIcon(Context context, FileSystemObject fso) {
//Ensure that mime types are loaded
if (sMimeTypes == null) {
loadMimeTypes(context);
//Check if the argument is a folder
if (fso instanceof Directory || FileHelper.isSymlinkRefDirectory(fso)) {
- return R.drawable.ic_fso_folder;
+ return "ic_fso_folder_drawable"; //$NON-NLS-1$
}
//Get the extension and delivery
if (ext != null) {
MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
if (mimeTypeInfo != null) {
- //Search the identifier in the cache
- int drawableId = 0;
- if (sCachedIndentifiers.containsKey(ext)) {
- // Try from cached resources
- drawableId = sCachedIndentifiers.get(ext).intValue();
- return drawableId;
- }
-
// Create a new drawable
- drawableId = ResourcesHelper.getIdentifier(
- context.getResources(), "drawable", //$NON-NLS-1$
- mimeTypeInfo.mDrawable);
- if (drawableId != 0) {
- sCachedIndentifiers.put(ext, Integer.valueOf(drawableId));
- return drawableId;
+ if (!TextUtils.isEmpty(mimeTypeInfo.mDrawable)) {
+ return mimeTypeInfo.mDrawable;
}
// Something was wrong here. The resource should exist, but it's not present.
"Something was wrong with the drawable of the fso:" + //$NON-NLS-1$
"%s, mime: %s", //$NON-NLS-1$
fso.toString(),
- mimeTypeInfo.toString()
- ));
+ mimeTypeInfo.toString()));
}
}
// Check system file
if (FileHelper.isSystemFile(fso)) {
- return R.drawable.fso_type_system;
+ return "fso_type_system_drawable"; //$NON-NLS-1$
}
// Check if the fso is executable (but not a symlink)
if (!(fso instanceof Symlink)) {
if (fso.getPermissions().getUser().isExecute() ||
fso.getPermissions().getGroup().isExecute() ||
fso.getPermissions().getOthers().isExecute()) {
- return R.drawable.fso_type_executable;
+ return "fso_type_executable_drawable"; //$NON-NLS-1$
}
}
- return R.drawable.ic_fso_default;
+ return "ic_fso_default_drawable"; //$NON-NLS-1$
}
/**
public static synchronized void loadMimeTypes(Context context) {
if (sMimeTypes == null) {
try {
- // Create a new icon holder
- sCachedIndentifiers = new HashMap<String, Integer>();
-
+ // Load the mime/type database
Properties mimeTypes = new Properties();
mimeTypes.load(context.getResources().openRawResource(R.raw.mime_types));
package com.cyanogenmod.filemanager.util;
-import android.graphics.Color;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
*
* @param result The result to highlight
* @param queries The list of queries that parameterized the search
+ * @param highlightedColor The highlight color
* @return CharSequence The name string highlighted
*/
- public static CharSequence getHighlightedName(SearchResult result, List<String> queries) {
+ public static CharSequence getHighlightedName(
+ SearchResult result, List<String> queries, int highlightedColor) {
String name = result.getFso().getName();
int cc = queries.size();
for (int i = 0; i < cc; i++) {
if (matcher.find()) {
//Highlight the match
span.setSpan(
- new BackgroundColorSpan(Color.YELLOW), matcher.start(), matcher.end(), 0);
+ new BackgroundColorSpan(highlightedColor),
+ matcher.start(), matcher.end(), 0);
span.setSpan(
new StyleSpan(Typeface.BOLD), matcher.start(), matcher.end(), 0);
return span;
--- /dev/null
+/.settings
+/bin
+/gen
+/.checkstyle
+/.classpath
+/.project
+/project.properties
+lint.xml
\ No newline at end of file
--- /dev/null
+#
+# 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := CMFileManagerThemes
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
--- /dev/null
+<?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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.cyanogenmod.filemanager.themes"
+ android:versionCode="100"
+ android:versionName="1.0.0">
+
+ <original-package android:name="com.cyanogenmod.filemanager.themes" />
+
+ <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16" />
+
+ <application
+ android:name=".ThemeActivity"
+ android:description="@string/app_description"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher">
+
+ <activity
+ android:name="ThemeActivity"
+ android:label="@string/app_name"
+ android:permission="com.cyanogenmod.filemanager.permissions.READ_THEME"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="com.cyanogenmod.filemanager.actions.MAIN_THEME" />
+ <category android:name="com.cyanogenmod.filemanager.categories.THEME" />
+ </intent-filter>
+ </activity>
+
+ </application>
+
+</manifest>
--- /dev/null
+# Copyright (C) 2007 The Android Open Source Project
+# 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.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
\ No newline at end of file
--- /dev/null
+CyanogenMod File Manager Themes
+===============================
+
+An application that contains extra themes for the CMFileManager application.
+
+This packages brings with the next themes:
+
+ - Dark theme
+
+For build new themes, developers should:
+
+ - Create a new package that contains an activity with:
+ * Permission: com.cyanogenmod.filemanager.permissions.READ_THEME
+ * Action: com.cyanogenmod.filemanager.actions.MAIN_THEME
+ * Category: com.cyanogenmod.filemanager.categories.THEME
+ - Define the themes_ids, themes_names and themes_descriptions arrays-strings
+ definitions for the themes that the package support.
+ - Create a xxx_theme.xml for every theme that the package support, where the
+ xxx is the id of the theme. Put your resources in this file, prefixing the
+ resource with the id of the theme (xxx_). For a list of all supported
+ resources see theme.xml in res/values of CMFileManager project.
+
+
+This source was released under the terms of
+[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license.
+
+Visit [CyanogenMod Github](https://github.com/CyanogenMod) and [CyanogenMod
+Code Review](http://review.cyanogenmod.com/) to get the source and patches.
+
+Copyright © 2012 The CyanogenMod Project
--- /dev/null
+#configuration
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+#keep common classes
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+
+#keep all classes that might be used in XML layouts
+-keep public class * extends android.view.View {
+ public <init>(android.content.Context);
+ public <init>(android.content.Context, android.util.AttributeSet);
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+ public void set*(...);
+}
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
\ No newline at end of file
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:drawable="@drawable/btn_holo_dark_check_on_normal_inverted"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@drawable/btn_holo_dark_check_off_normal"/>
+
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@drawable/dark_background"/>
+
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"/>
+
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@drawable/dark_popup_background"/>
+
+</selector>
--- /dev/null
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_light"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_focused="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_checked="true"/>
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_enabled="true"
+ android:state_selected="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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
+ 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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:id="@android:id/background"
+ android:drawable="@drawable/progress_bg_holo_dark" />
+
+ <item android:id="@android:id/secondaryProgress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_secondary_holo_dark" />
+ </item>
+
+ <item android:id="@android:id/progress">
+ <scale android:scaleWidth="100%"
+ android:drawable="@drawable/progress_primary_holo_dark" />
+ </item>
+
+</layer-list>
--- /dev/null
+<?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.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The identifiers of the themes that this app contains. All the resources
+ of every theme MUST be qualified with the identifier of the theme -->
+ <string-array name="themes_ids" translatable="false">
+ <item>dark</item>
+ </string-array>
+ <string-array name="themes_names" translatable="false">
+ <item>@string/dark_theme_name</item>
+ </string-array>
+ <string-array name="themes_descriptions" translatable="false">
+ <item>@string/dark_theme_desc</item>
+ </string-array>
+
+</resources>
--- /dev/null
+<?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.
+ -->
+
+<!--
+ A dark theme for CMFileManager.
+ -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The base theme used to customize some (non-themeables) widgets like dialogs
+ 2 possibles values:
+ * holo: @android:style/Theme.Holo
+ * holo_light: @android:style/Theme.Holo.Light
+ -->
+ <string name="dark_base_theme">holo</string>
+
+ <!-- The image preview -->
+ <drawable name="dark_theme_preview_drawable">@drawable/dark_theme_preview</drawable>
+
+ <!-- The drawable for the title bar -->
+ <drawable name="dark_titlebar_drawable">@drawable/dark_titlebar</drawable>
+
+ <!-- The background drawable -->
+ <drawable name="dark_background_drawable">@drawable/dark_background</drawable>
+
+ <!-- The drawable for the status bar -->
+ <drawable name="dark_statusbar_drawable">@drawable/dark_statusbar</drawable>
+
+ <!-- The drawable for the selection bar -->
+ <drawable name="dark_selectionbar_drawable">@drawable/dark_selectionbar</drawable>
+
+ <!-- The drawable for the overflow action bar button -->
+ <drawable name="dark_ab_overflow_drawable">@drawable/ic_holo_dark_overflow</drawable>
+ <!-- The drawable for the actions action bar button -->
+ <drawable name="dark_ab_actions_drawable">@drawable/ic_holo_dark_contextual_action</drawable>
+ <!-- The drawable for the search action bar button -->
+ <drawable name="dark_ab_search_drawable">@drawable/ic_holo_dark_search</drawable>
+ <!-- The drawable for the bookmarks action bar button -->
+ <drawable name="dark_ab_bookmarks_drawable">@drawable/ic_holo_dark_bookmarks</drawable>
+ <!-- The drawable for the history action bar button -->
+ <drawable name="dark_ab_history_drawable">@drawable/ic_holo_dark_history</drawable>
+ <!-- The drawable for the sort mode of expander bar -->
+ <drawable name="dark_ab_sort_mode_drawable">@drawable/ic_holo_dark_sort_alphabetically</drawable>
+ <!-- The drawable for the layout mode of expander bar -->
+ <drawable name="dark_ab_layout_mode_drawable">@drawable/ic_holo_dark_layout</drawable>
+ <!-- The drawable for the view options of expander bar -->
+ <drawable name="dark_ab_view_options_drawable">@drawable/ic_holo_dark_view</drawable>
+ <!-- The drawable for the selection done button -->
+ <drawable name="dark_ab_selection_done_drawable">@drawable/ic_holo_dark_accept</drawable>
+ <!-- The drawable for the save action bar button -->
+ <drawable name="dark_ab_save_drawable">@drawable/ic_holo_dark_save</drawable>
+ <!-- The drawable for the tab action bar button -->
+ <drawable name="dark_ab_tab_drawable">@drawable/ic_holo_dark_tab</drawable>
+
+ <!-- The close action drawable from the expander bar -->
+ <drawable name="dark_expander_close_drawable">@drawable/ic_holo_dark_expander_close</drawable>
+ <!-- The open action drawable from the expander bar -->
+ <drawable name="dark_expander_open_drawable">@drawable/ic_holo_dark_expander_open</drawable>
+
+ <!-- The text color of TextView controls -->
+ <color name="dark_text_color">#99ffffff</color>
+ <!-- The text color of Dialog
+ <color name="dialog_text_color">@null</color> -->
+
+ <!-- The highlight color for terms found in the search result -->
+ <color name="dark_search_highlight_color">#9933b5e5</color>
+
+ <!-- Breadcrumb divider drawable
+ <drawable name="dark_breadcrumb_divider_drawable">@null</drawable> -->
+
+ <!-- FileSystem locked drawable -->
+ <drawable name="dark_filesystem_locked_drawable">@drawable/ic_holo_dark_fs_locked</drawable>
+ <!-- FileSystem unlocked drawable -->
+ <drawable name="dark_filesystem_unlocked_drawable">@drawable/ic_holo_dark_fs_unlocked</drawable>
+ <!-- FileSystem warning drawable -->
+ <drawable name="dark_filesystem_warning_drawable">@drawable/ic_holo_dark_fs_warning</drawable>
+
+ <!-- The popup menu checkable selector drawable -->
+ <drawable name="dark_popup_checkable_selector_drawable">@drawable/dark_checkable_selector</drawable>
+ <!-- The menu checkable selector drawable -->
+ <drawable name="dark_menu_checkable_selector_drawable">@drawable/dark_holo_popup_selector</drawable>
+ <!-- The checkable item selector drawable -->
+ <drawable name="dark_selection_drawable">@drawable/dark_holo_selection</drawable>
+
+ <!-- Selectors -->
+ <drawable name="dark_selectors_deselected_drawable">@drawable/dark_holo_list_selector_deselected</drawable>
+ <drawable name="dark_selectors_selected_drawable">@drawable/dark_holo_list_selector_selected</drawable>
+ <drawable name="dark_selectors_button_drawable">@drawable/dark_holo_button_selector</drawable>
+
+ <!-- Checkboxes -->
+ <drawable name="dark_checkbox_deselected_drawable">@drawable/btn_holo_dark_check_off_normal</drawable>
+ <drawable name="dark_checkbox_selected_drawable">@drawable/btn_holo_dark_check_on_normal</drawable>
+
+ <!-- Dividers -->
+ <drawable name="dark_horizontal_divider_drawable">@drawable/divider_horizontal_dark_opaque</drawable>
+ <drawable name="dark_vertical_divider_drawable">@drawable/divider_vertical_dark_opaque</drawable>
+ <color name="dark_horizontal_divider_color">#99505050</color>
+ <color name="dark_vertical_divider_color">#99505050</color>
+
+ <!-- Icons -->
+ <drawable name="dark_ic_close_drawable">@drawable/ic_holo_dark_close</drawable>
+ <drawable name="dark_ic_config_drawable">@drawable/ic_holo_dark_config</drawable>
+ <drawable name="dark_ic_home_drawable">@drawable/ic_holo_dark_home</drawable>
+ <drawable name="dark_ic_filesystem_drawable">@drawable/ic_holo_dark_filesystem</drawable>
+ <drawable name="dark_ic_sdcard_drawable">@drawable/ic_holo_dark_sdcard</drawable>
+ <drawable name="dark_ic_usb_drawable">@drawable/ic_holo_dark_usb</drawable>
+ <drawable name="dark_ic_user_defined_bookmark_drawable">@drawable/ic_holo_dark_user_defined_bookmark</drawable>
+ <!--<drawable name="dark_ic_history_search_drawable">@null</drawable> -->
+
+ <!-- Disk usage graph -->
+ <color name="dark_disk_usage_total_color">#7ecccccc</color>
+ <color name="dark_disk_usage_used_color">#cc0099cc</color>
+ <color name="dark_disk_usage_used_warning_color">#99ff4444</color>
+
+ <!-- Disk usage filters
+ <color name="dark_disk_usage_filter_normal_color">@null</color>
+ <color name="dark_disk_usage_filter_warning_color">@null</color> -->
+
+ <!-- ProgressBar -->
+ <drawable name="dark_horizontal_progress_bar">@drawable/dark_progress_horizontal_holo</drawable>
+
+ <!-- Autocomplete -->
+ <color name="dark_autocomplete_fg_color">#99ffffff</color>
+ <color name="dark_autocomplete_bg_color">#aaa</color>
+
+ <!-- Console
+ <color name="dark_console_bg_color">@null</color>
+ <color name="dark_console_fg_color">@null</color> -->
+
+ <!-- Fso Icons
+ <drawable name="dark_ic_fso_folder_drawable">@null</drawable>
+ <drawable name="dark_ic_fso_default_drawable">@null</drawable>
+ <drawable name="dark_fso_type_app_drawable">@null</drawable>
+ <drawable name="dark_fso_type_audio_drawable">@null</drawable>
+ <drawable name="dark_fso_type_binary_drawable">@null</drawable>
+ <drawable name="dark_fso_type_calendar_drawable">@null</drawable>
+ <drawable name="dark_fso_type_cdimage_drawable">@null</drawable>
+ <drawable name="dark_fso_type_compress_drawable">@null</drawable>
+ <drawable name="dark_fso_type_contact_drawable">@null</drawable>
+ <drawable name="dark_fso_type_database_drawable">@null</drawable>
+ <drawable name="dark_fso_type_document_drawable">@null</drawable>
+ <drawable name="dark_fso_type_ebook_drawable">@null</drawable>
+ <drawable name="dark_fso_type_email_drawable">@null</drawable>
+ <drawable name="dark_fso_type_executable_drawable">@null</drawable>
+ <drawable name="dark_fso_type_feed_drawable">@null</drawable>
+ <drawable name="dark_fso_type_font_drawable">@null</drawable>
+ <drawable name="dark_fso_type_image_drawable">@null</drawable>
+ <drawable name="dark_fso_type_markup_document_drawable">@null</drawable>
+ <drawable name="dark_fso_type_pdf_drawable">@null</drawable>
+ <drawable name="dark_fso_type_presentation_drawable">@null</drawable>
+ <drawable name="dark_fso_type_security_drawable">@null</drawable>
+ <drawable name="dark_fso_type_shell_drawable">@null</drawable>
+ <drawable name="dark_fso_type_source_drawable">@null</drawable>
+ <drawable name="dark_fso_type_spreadsheet_drawable">@null</drawable>
+ <drawable name="dark_fso_type_system_drawable">@null</drawable>
+ <drawable name="dark_fso_type_text_drawable">@null</drawable>
+ <drawable name="dark_fso_type_video_drawable">@null</drawable> -->
+
+</resources>
--- /dev/null
+<?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.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- The name of the application -->
+ <string name="app_name">File Manager Themes</string>
+ <!-- The description of the application -->
+ <string name="app_description">Themes for CyanogenMod File Manager.</string>
+
+ <!-- The author of the themes -->
+ <string name="themes_author" translatable="false">CyanogenMod</string>
+
+ <!-- The dark theme name -->
+ <string name="dark_theme_name">Dark Theme</string>
+ <!-- The dark theme description -->
+ <string name="dark_theme_desc">A dark theme for CyanogenMod File Manager.</string>
+
+</resources>
--- /dev/null
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.filemanager.themes;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+/**
+ * A mock activity for allow to <code>File Manager</code> to find this themes.<br/>
+ * <br/>
+ * NOTE: This activity must define the next filters:<br/>
+ * <ul>
+ * <li>Permission: <b>com.cyanogenmod.filemanager.permissions.READ_THEME</b></li>
+ * <li>Action: <b>com.cyanogenmod.filemanager.actions.MAIN_THEME</b></li>
+ * <li>Category: <b>com.cyanogenmod.filemanager.categories.THEME</b></li>
+ * </ul>
+ */
+public class ThemeActivity extends Activity {
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void onCreate(Bundle state) {
+ //Save state
+ super.onCreate(state);
+ }
+}