diff --git a/.idea/misc.xml b/.idea/misc.xml index 1a3eaffb45f4870522a76374f46c26ae8571f727..a6f67c53ca4a6ecbf7e5e53c7800fe159521ffe6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ <ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Remove" /> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 23 Platform" project-jdk-type="Android SDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5b48cb8b1175a640e63917e399c30f61d5613ba7..0bc0d7d0a47c04070c02a72865e1ec49924b37b6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -10,22 +10,45 @@ </component> <component name="ChangeListManager"> <list default="true" id="465ea6dc-8a6c-4c2f-9b3c-de0cba274c5a" name="Default" comment=""> - <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_main.xml" afterPath="" /> - <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_wallpaper.xml" afterPath="" /> - <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_wallpaper_set.xml" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/bush_thumb.jpg" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/bush_thumb.jpg" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/clovers_thumb.jpg" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/clovers_thumb.jpg" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/daisy_thumb.jpg" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/daisy_thumb.jpg" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ivy_thumb.jpg" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ivy_thumb.jpg" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/rock_thumb.jpg" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/rock_thumb.jpg" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/wall_thumb.jpg" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/wall_thumb.jpg" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/LicenseActivity.java" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/bush.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/bush_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/clovers.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/clovers_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/daisy.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/daisy_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/foam.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/foam_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ivy.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ivy_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/menu_background.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/night.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/night_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/rock.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/rock_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/wall.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/wall_thumb.jpg" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/mipmap-hdpi/ic_launcher.png" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/mipmap-mdpi/ic_launcher.png" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/mipmap-xhdpi/ic_launcher.png" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/res/mipmap-xxhdpi/ic_launcher.png" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/build/intermediates/dex-cache/cache.xml" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_apply.png" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_apply.png" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_back.png" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_back.png" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_source_button.png" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_source_button.png" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_wallpaper_button.png" afterPath="$PROJECT_DIR$/app/src/main/res/drawable-nodpi/ic_wallpaper_button.png" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" afterPath="$PROJECT_DIR$/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ICEcons.iml" afterPath="$PROJECT_DIR$/ICEcons.iml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/app.iml" afterPath="$PROJECT_DIR$/app/app.iml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/build.gradle" afterPath="$PROJECT_DIR$/app/build.gradle" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" afterPath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/values/styles.xml" afterPath="$PROJECT_DIR$/app/src/main/res/values/styles.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/local.properties" afterPath="$PROJECT_DIR$/local.properties" /> </list> <ignored path="ICEcons.iws" /> <ignored path=".idea/workspace.xml" /> @@ -57,76 +80,76 @@ <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> - <caret line="33" column="71" selection-start-line="33" selection-start-column="71" selection-end-line="34" selection-end-column="47" /> - <folding /> + <caret line="11" column="29" selection-start-line="11" selection-start-column="29" selection-end-line="11" selection-end-column="29" /> + <folding> + <element signature="e#2612#2768#0" expanded="true" /> + <element signature="e#2767#2768#0" expanded="true" /> + <element signature="e#4304#4452#0" expanded="true" /> + <element signature="e#4451#4452#0" expanded="true" /> + <element signature="e#5933#6085#0" expanded="true" /> + <element signature="e#6084#6085#0" expanded="true" /> + </folding> </state> </provider> </entry> </file> - <file leaf-file-name="WallpaperActivity.java" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java"> + <file leaf-file-name="LicenseActivity.java" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/LicenseActivity.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> - <caret line="40" column="108" selection-start-line="40" selection-start-column="12" selection-end-line="40" selection-end-column="108" /> + <caret line="93" column="141" selection-start-line="93" selection-start-column="141" selection-end-line="93" selection-end-column="141" /> <folding> - <element signature="e#3437#3638#0" expanded="true" /> - <element signature="e#3637#3638#0" expanded="true" /> - <element signature="e#4180#4381#0" expanded="true" /> - <element signature="e#4380#4381#0" expanded="true" /> + <element signature="e#2484#2632#0" expanded="true" /> + <element signature="e#2631#2632#0" expanded="true" /> + <element signature="e#3835#3982#0" expanded="true" /> + <element signature="e#3981#3982#0" expanded="true" /> </folding> </state> </provider> </entry> </file> - <file leaf-file-name="WallpaperSetActivity.java" pinned="false" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java"> + <file leaf-file-name="WallpaperActivity.java" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.14900662"> - <caret line="5" column="37" selection-start-line="5" selection-start-column="37" selection-end-line="5" selection-end-column="37" /> + <state vertical-scroll-proportion="0.0"> + <caret line="67" column="0" selection-start-line="67" selection-start-column="0" selection-end-line="67" selection-end-column="0" /> <folding> - <element signature="e#3056#3200#0" expanded="true" /> - <element signature="e#3199#3200#0" expanded="true" /> + <element signature="imports" expanded="true" /> </folding> </state> </provider> </entry> </file> - <file leaf-file-name="AndroidManifest.xml" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/src/main/AndroidManifest.xml"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-6.6666665"> - <caret line="10" column="40" selection-start-line="10" selection-start-column="40" selection-end-line="10" selection-end-column="40" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="colors.xml" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/src/main/res/values/colors.xml"> + <file leaf-file-name="WallpaperSetActivity.java" pinned="false" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-1.3333334"> - <caret line="2" column="38" selection-start-line="2" selection-start-column="38" selection-end-line="2" selection-end-column="38" /> - <folding /> + <state vertical-scroll-proportion="0.22272727"> + <caret line="64" column="53" selection-start-line="64" selection-start-column="53" selection-end-line="64" selection-end-column="53" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> </state> </provider> </entry> </file> - <file leaf-file-name="appfilter.xml" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/appfilter.xml"> + <file leaf-file-name="IceScreenUtils.java" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-5.5185184"> - <caret line="472" column="107" selection-start-line="472" selection-start-column="107" selection-end-line="472" selection-end-column="107" /> + <state vertical-scroll-proportion="0.0"> + <caret line="23" column="8" selection-start-line="23" selection-start-column="8" selection-end-line="23" selection-end-column="70" /> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="theme_wallpapers.xml" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/theme_wallpapers.xml"> + <file leaf-file-name="IceImageUtils.java" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceImageUtils.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-9.333333"> - <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" /> - <folding /> + <state vertical-scroll-proportion="0.0"> + <caret line="13" column="51" selection-start-line="13" selection-start-column="51" selection-end-line="13" selection-end-column="51" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> </state> </provider> </entry> @@ -1357,7 +1380,7 @@ </option> <option name="modificationStamps"> <map> - <entry key="$PROJECT_DIR$" value="4381336586567" /> + <entry key="$PROJECT_DIR$" value="4382698451734" /> </map> </option> <option name="projectBuildClasspath"> @@ -1631,7 +1654,6 @@ <component name="IdeDocumentHistory"> <option name="CHANGED_PATHS"> <list> - <option value="$PROJECT_DIR$/app/build.gradle" /> <option value="$PROJECT_DIR$/app/src/main/res/xml/drawable.xml" /> <option value="$PROJECT_DIR$/app/src/main/res/values/iconpack.xml" /> <option value="$PROJECT_DIR$/app/src/main/res/xml/appfilter.xml" /> @@ -1641,10 +1663,16 @@ <option value="$PROJECT_DIR$/app/src/main/res/values/colors.xml" /> <option value="$PROJECT_DIR$/app/src/main/res/layout/activity_wallpaper.xml" /> <option value="$PROJECT_DIR$/app/src/main/res/values/styles.xml" /> - <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java" /> - <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java" /> <option value="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" /> <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/App.java" /> + <option value="$PROJECT_DIR$/app/src/main/res/IceImageUtils.java" /> + <option value="$PROJECT_DIR$/app/src/main/res/IceScreenUtils.java" /> + <option value="$PROJECT_DIR$/app/build.gradle" /> + <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java" /> + <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceImageUtils.java" /> + <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java" /> + <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java" /> + <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/LicenseActivity.java" /> <option value="$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java" /> </list> </option> @@ -1685,10 +1713,10 @@ <foldersAlwaysOnTop value="true" /> </navigator> <panes> + <pane id="Scratches" /> <pane id="Scope" /> - <pane id="PackagesPane" /> <pane id="ProjectPane" /> - <pane id="Scratches" /> + <pane id="PackagesPane" /> <pane id="AndroidView"> <subPane> <PATH> @@ -1756,10 +1784,6 @@ <option name="myItemId" value="app" /> <option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidModuleNode" /> </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="manifests" /> - <option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidManifestsGroupNode" /> - </PATH_ELEMENT> </PATH> </subPane> </pane> @@ -1776,6 +1800,10 @@ <property name="ExportApk.Flavors" value="" /> <property name="ExportApk.BuildType" value="release" /> <property name="device.picker.selection" value="ZY222VRTXP" /> + <property name="last_directory_selection" value="$PROJECT_DIR$/app/src/main/res" /> + <property name="android.sdk.path" value="$USER_HOME$/.androidsdk/Sdk" /> + <property name="android.project.structure.last.selected" value="SDK Location" /> + <property name="android.project.structure.proportion" value="0.15" /> </component> <component name="RecentsManager"> <key name="android.template.packageName"> @@ -2119,15 +2147,14 @@ </component> <component name="ToolWindowManager"> <frame x="0" y="0" width="1920" height="1047" extended-state="6" /> - <editor active="false" /> + <editor active="true" /> <layout> <window_info id="Palette	" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3289183" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" /> <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Android Monitor" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.30276242" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.5259096" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> @@ -2136,16 +2163,17 @@ <window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> - <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3281768" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32745314" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3289183" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24973376" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15388711" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.20773481" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32414553" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> + <window_info id="Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32928178" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> @@ -2169,38 +2197,10 @@ <watches-manager /> </component> <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="19" column="0" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" /> - <folding> - <element signature="e#3056#3200#0" expanded="true" /> - <element signature="e#3199#3200#0" expanded="true" /> - </folding> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/src/main/AndroidManifest.xml"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="4" column="71" selection-start-line="4" selection-start-column="71" selection-end-line="4" selection-end-column="71" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/appfilter.xml"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="472" column="107" selection-start-line="472" selection-start-column="107" selection-end-line="472" selection-end-column="107" /> - <folding /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/theme_wallpapers.xml"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2208,7 +2208,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="5" column="53" selection-start-line="5" selection-start-column="53" selection-end-line="5" selection-end-column="53" /> - <folding /> </state> </provider> </entry> @@ -2216,7 +2215,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="6" column="0" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2231,7 +2229,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="108" column="15" selection-start-line="108" selection-start-column="15" selection-end-line="108" selection-end-column="15" /> - <folding /> </state> </provider> </entry> @@ -2239,7 +2236,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="264" column="94" selection-start-line="264" selection-start-column="94" selection-end-line="264" selection-end-column="94" /> - <folding /> </state> </provider> </entry> @@ -2247,7 +2243,14 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" /> - <folding /> + <folding> + <element signature="e#2612#2768#0" expanded="true" /> + <element signature="e#2767#2768#0" expanded="true" /> + <element signature="e#4304#4452#0" expanded="true" /> + <element signature="e#4451#4452#0" expanded="true" /> + <element signature="e#5933#6085#0" expanded="true" /> + <element signature="e#6084#6085#0" expanded="true" /> + </folding> </state> </provider> </entry> @@ -2255,7 +2258,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2263,7 +2265,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="5" column="53" selection-start-line="5" selection-start-column="53" selection-end-line="5" selection-end-column="53" /> - <folding /> </state> </provider> </entry> @@ -2271,7 +2272,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="6" column="0" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2286,7 +2286,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="83" column="29" selection-start-line="83" selection-start-column="29" selection-end-line="83" selection-end-column="29" /> - <folding /> </state> </provider> </entry> @@ -2294,7 +2293,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="70" column="32" selection-start-line="70" selection-start-column="32" selection-end-line="70" selection-end-column="32" /> - <folding /> </state> </provider> </entry> @@ -2302,7 +2300,14 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="19" column="30" selection-start-line="19" selection-start-column="30" selection-end-line="19" selection-end-column="30" /> - <folding /> + <folding> + <element signature="e#2612#2768#0" expanded="true" /> + <element signature="e#2767#2768#0" expanded="true" /> + <element signature="e#4304#4452#0" expanded="true" /> + <element signature="e#4451#4452#0" expanded="true" /> + <element signature="e#5933#6085#0" expanded="true" /> + <element signature="e#6084#6085#0" expanded="true" /> + </folding> </state> </provider> </entry> @@ -2310,7 +2315,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2318,7 +2322,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="5" column="53" selection-start-line="5" selection-start-column="53" selection-end-line="5" selection-end-column="53" /> - <folding /> </state> </provider> </entry> @@ -2326,7 +2329,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="4" column="45" selection-start-line="4" selection-start-column="45" selection-end-line="4" selection-end-column="45" /> - <folding /> </state> </provider> </entry> @@ -2341,7 +2343,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="50" column="30" selection-start-line="50" selection-start-column="30" selection-end-line="50" selection-end-column="30" /> - <folding /> </state> </provider> </entry> @@ -2349,7 +2350,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2364,7 +2364,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="50" column="30" selection-start-line="50" selection-start-column="30" selection-end-line="50" selection-end-column="30" /> - <folding /> </state> </provider> </entry> @@ -2372,7 +2371,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2387,7 +2385,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="50" column="30" selection-start-line="50" selection-start-column="30" selection-end-line="50" selection-end-column="30" /> - <folding /> </state> </provider> </entry> @@ -2415,7 +2412,6 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> </state> </provider> </entry> @@ -2431,25 +2427,10 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/build.gradle"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/build.gradle"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.041002277"> - <caret line="2" column="9" selection-start-line="2" selection-start-column="9" selection-end-line="2" selection-end-column="9" /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/app/src/main/res/values/iconpack.xml"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> <caret line="143" column="18" selection-start-line="143" selection-start-column="18" selection-end-line="143" selection-end-column="18" /> - <folding /> </state> </provider> </entry> @@ -2471,70 +2452,139 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.24657534"> <caret line="7" column="23" selection-start-line="7" selection-start-column="23" selection-end-line="7" selection-end-column="23" /> - <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java"> + <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/theme_wallpapers.xml"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> - <caret line="33" column="71" selection-start-line="33" selection-start-column="71" selection-end-line="34" selection-end-column="47" /> - <folding /> + <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/theme_wallpapers.xml"> + <entry file="file://$PROJECT_DIR$/app/src/main/res/values/colors.xml"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-9.333333"> - <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" /> - <folding /> + <state vertical-scroll-proportion="0.0"> + <caret line="2" column="38" selection-start-line="2" selection-start-column="38" selection-end-line="2" selection-end-column="38" /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/app/src/main/res/values/colors.xml"> + <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/appfilter.xml"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-1.3333334"> - <caret line="2" column="38" selection-start-line="2" selection-start-column="38" selection-end-line="2" selection-end-column="38" /> + <state vertical-scroll-proportion="0.0"> + <caret line="472" column="107" selection-start-line="472" selection-start-column="107" selection-end-line="472" selection-end-column="107" /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/gradle.properties"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.20454545"> + <caret line="10" column="66" selection-start-line="10" selection-start-column="66" selection-end-line="10" selection-end-column="66" /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/settings.gradle"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/local.properties"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/app/build.gradle"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="8" column="24" selection-start-line="8" selection-start-column="24" selection-end-line="8" selection-end-column="24" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/app/src/main/AndroidManifest.xml"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-6.6666665"> + <state vertical-scroll-proportion="0.3125"> <caret line="10" column="40" selection-start-line="10" selection-start-column="40" selection-end-line="10" selection-end-column="40" /> + <folding> + <element signature="e#408#426#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/build.gradle"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/app/src/main/res/xml/appfilter.xml"> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceImageUtils.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="-5.5185184"> - <caret line="472" column="107" selection-start-line="472" selection-start-column="107" selection-end-line="472" selection-end-column="107" /> + <state vertical-scroll-proportion="0.0"> + <caret line="13" column="51" selection-start-line="13" selection-start-column="51" selection-end-line="13" selection-end-column="51" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="23" column="8" selection-start-line="23" selection-start-column="8" selection-end-line="23" selection-end-column="70" /> <folding /> </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/MainActivity.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="11" column="29" selection-start-line="11" selection-start-column="29" selection-end-line="11" selection-end-column="29" /> + <folding> + <element signature="e#2612#2768#0" expanded="true" /> + <element signature="e#2767#2768#0" expanded="true" /> + <element signature="e#4304#4452#0" expanded="true" /> + <element signature="e#4451#4452#0" expanded="true" /> + <element signature="e#5933#6085#0" expanded="true" /> + <element signature="e#6084#6085#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> - <caret line="40" column="108" selection-start-line="40" selection-start-column="12" selection-end-line="40" selection-end-column="108" /> + <caret line="67" column="0" selection-start-line="67" selection-start-column="0" selection-end-line="67" selection-end-column="0" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/LicenseActivity.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="93" column="141" selection-start-line="93" selection-start-column="141" selection-end-line="93" selection-end-column="141" /> <folding> - <element signature="e#3437#3638#0" expanded="true" /> - <element signature="e#3637#3638#0" expanded="true" /> - <element signature="e#4180#4381#0" expanded="true" /> - <element signature="e#4380#4381#0" expanded="true" /> + <element signature="e#2484#2632#0" expanded="true" /> + <element signature="e#2631#2632#0" expanded="true" /> + <element signature="e#3835#3982#0" expanded="true" /> + <element signature="e#3981#3982#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.14900662"> - <caret line="5" column="37" selection-start-line="5" selection-start-column="37" selection-end-line="5" selection-end-column="37" /> + <state vertical-scroll-proportion="0.22272727"> + <caret line="64" column="53" selection-start-line="64" selection-start-column="53" selection-end-line="64" selection-end-column="53" /> <folding> - <element signature="e#3056#3200#0" expanded="true" /> - <element signature="e#3199#3200#0" expanded="true" /> + <element signature="imports" expanded="true" /> </folding> </state> </provider> diff --git a/ICEcons.iml b/ICEcons.iml index 00377598aad375042916b91e84d301f5a5f210ee..60bb89c668b346e7292957b6d2fb2792077ce4ee 100644 --- a/ICEcons.iml +++ b/ICEcons.iml @@ -13,7 +13,7 @@ <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> </content> - <orderEntry type="inheritedJdk" /> + <orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" /> <orderEntry type="sourceFolder" forTests="false" /> </component> </module> \ No newline at end of file diff --git a/app/app.iml b/app/app.iml index f27c5b907eeb2d4ab99d704c89be05938c05098c..087373adec8d20765520b3a89b97a9779e4f592c 100644 --- a/app/app.iml +++ b/app/app.iml @@ -99,7 +99,7 @@ <excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> - <orderEntry type="jdk" jdkName="Android API 23 Platform (1)" jdkType="Android SDK" /> + <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" /> <orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" /> diff --git a/app/build.gradle b/app/build.gradle index e170b7e68da5cc80e92f67bab3469be1cc99c118..6176bdbd7043aefb6fc2f2577976db93156542ad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,7 +6,7 @@ android { defaultConfig { applicationId "ovh.ice.icecons" - minSdkVersion 14 + minSdkVersion 16 targetSdkVersion 23 versionCode 3 versionName "1.2" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 694983ea2d0f94d83071e5bbcae8f0caf9d6a2b9..7899e24dc6d8b7f9925ad41946758dd17ea42705 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -33,7 +33,8 @@ </intent-filter> </activity> <activity android:name=".WallpaperActivity" /> - <activity android:name=".WallpaperSetActivity"></activity> + <activity android:name=".WallpaperSetActivity" /> + <activity android:name=".LicenseActivity"></activity> </application> </manifest> \ No newline at end of file diff --git a/app/src/main/java/ovh/ice/icecons/IceImageUtils.java b/app/src/main/java/ovh/ice/icecons/IceImageUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..a5338874fc6b18fa52a5782eaaaa0576cf45d30f --- /dev/null +++ b/app/src/main/java/ovh/ice/icecons/IceImageUtils.java @@ -0,0 +1,145 @@ +package ovh.ice.icecons; + +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.AsyncTask; +import android.view.View; +import android.widget.ImageView; + +import java.lang.ref.WeakReference; + +public class IceImageUtils { + + public static void bitmapLoadAsync( ImageView imageView, Resources res, int resId, int width, int height ) { + + BitmapWorkerTask task = new BitmapWorkerTask( imageView ); + + task.res = res; + task.resId = resId; + task.width = width; + task.height = height; + + task.execute( resId ); + } + + public static Bitmap bitmapLoad( Resources res, int resId, int width, int height ) { + + // calc scale, load appropriately sampled bitmap from given resource + + BitmapFactory.Options resOptions = new BitmapFactory.Options(); + resOptions.inJustDecodeBounds = true; + BitmapFactory.decodeResource( res, resId, resOptions ); + + int resHeight = resOptions.outHeight; + int resWidth = resOptions.outWidth; + + float xScale = (float) width / (float) resWidth; + float yScale = (float) height / (float) resHeight; + float scale = Math.max( xScale, yScale ); + + if( width == 0 ) width = Math.round( resWidth / scale ); + else if( height == 0 ) height = Math.round( resHeight / scale ); + + resOptions.inSampleSize = sampleSize( scale ); + resWidth /= resOptions.inSampleSize; + resHeight /= resOptions.inSampleSize; + resOptions.inJustDecodeBounds = false; + + Bitmap rawBitmap = BitmapFactory.decodeResource( res, resId, resOptions ); + + // compare aspect ratio and crop + + rawBitmap = bitmapCrop( rawBitmap, width, height, resWidth, resHeight ); + + // scale to desired size + + return Bitmap.createScaledBitmap( rawBitmap, width, height, true ); + } + + // calc sample size for scaled resource loading + + private static int sampleSize( float scale ) { + + int size = 1; + + while( scale < 0.5f ) { + + size *= 2; + scale *= 2; + } + + return size; + } + + // crop bitmap to chosen aspect ratio + + private static Bitmap bitmapCrop( Bitmap rawBitmap, int width, int height, int resWidth, int resHeight ) { + + int cropX, cropY, cropWidth, cropHeight; + + float xScale = (float) width / (float) resWidth; + float yScale = (float) height / (float) resHeight; + float scale = Math.max( xScale, yScale ); + + if( xScale >= yScale ) { + cropWidth = Math.round( resWidth ); + cropX = 0; + cropHeight = Math.round( height / scale ); + cropY = ( resHeight - cropHeight ) / 2; + } + else { + cropWidth = Math.round( width / scale ); + cropX = ( resWidth - cropWidth ) / 2; + cropHeight = Math.round( resHeight ); + cropY = 0; + } + + return Bitmap.createBitmap( rawBitmap, cropX, cropY, cropWidth, cropHeight ); + } +} + +class BitmapWorkerTask extends AsyncTask< Integer, Void, Bitmap > { + + private final WeakReference< ImageView > imageViewReference; + + Resources res; + int resId, width, height; + + public BitmapWorkerTask( ImageView imageView ) { + + imageViewReference = new WeakReference<ImageView>(imageView); + } + + // Decode image in background + + @Override + protected Bitmap doInBackground( Integer... parameters ) { + + return IceImageUtils.bitmapLoad( res, resId, width, height ); + } + + // Check if image view still exists and set bitmap + + @Override + protected void onPostExecute( Bitmap bitmap ) { + + if ( imageViewReference != null && bitmap != null ) { + + final ImageView imageView = imageViewReference.get(); + + if ( imageView != null ) { + + imageView.setImageBitmap(bitmap); + + imageView.setAlpha( 0f ); + imageView.setVisibility( View.VISIBLE ); + + imageView.animate() + .alpha(1f) + .setDuration( res.getInteger( android.R.integer.config_mediumAnimTime ) ) + .setListener( null ); + } + } + } +} diff --git a/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java b/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..d9039f42649affb6c2d258ac678175624d073bdb --- /dev/null +++ b/app/src/main/java/ovh/ice/icecons/IceScreenUtils.java @@ -0,0 +1,26 @@ +package ovh.ice.icecons; + +import android.content.Context; + +public class IceScreenUtils { + + public static boolean isPortrait( Context context ) { + + return context.getResources().getDisplayMetrics().widthPixels < context.getResources().getDisplayMetrics().heightPixels; + } + + public static int width( Context context ) { + + return IceScreenUtils.isPortrait( context ) ? context.getResources().getDisplayMetrics().widthPixels : context.getResources().getDisplayMetrics().heightPixels; + } + + public static int height( Context context ) { + + return IceScreenUtils.isPortrait( context ) ? context.getResources().getDisplayMetrics().heightPixels : context.getResources().getDisplayMetrics().widthPixels; + } + + public static float densityScale( Context context ) { + + return ( context.getResources().getDisplayMetrics().density ); + } +} \ No newline at end of file diff --git a/app/src/main/java/ovh/ice/icecons/LicenseActivity.java b/app/src/main/java/ovh/ice/icecons/LicenseActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..a5451464dcaa939acd46fcddc1264b78b9e83acf --- /dev/null +++ b/app/src/main/java/ovh/ice/icecons/LicenseActivity.java @@ -0,0 +1,115 @@ +package ovh.ice.icecons; + +import android.content.Intent; +import android.graphics.drawable.BitmapDrawable; +import android.net.Uri; +import android.support.v4.content.ContextCompat; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +public class LicenseActivity extends AppCompatActivity { + + @Override + protected void onCreate( Bundle savedInstanceState ) { + + super.onCreate( savedInstanceState ); + createLayout(); + } + + private void createLayout() { + + // main centered layout + + LinearLayout.LayoutParams smallLayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f ); + float scale = IceScreenUtils.densityScale( getApplicationContext() ); + int padding = Math.round( 64 * scale ); + + LinearLayout frameLayout = new LinearLayout( this ); + frameLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); + frameLayout.setBackgroundColor( 0xffffffff ); + frameLayout.setGravity( Gravity.CENTER ); + setContentView( frameLayout ); + + LinearLayout baseLayout = new LinearLayout( this ); + baseLayout.setOrientation( LinearLayout.VERTICAL ); + baseLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); + baseLayout.setGravity( Gravity.LEFT ); + frameLayout.addView( baseLayout ); + + // gpl button + + LinearLayout sourceLayout = new LinearLayout( this ); + sourceLayout.setOrientation( LinearLayout.HORIZONTAL ); + sourceLayout.setLayoutParams( smallLayoutParams ); + sourceLayout.setGravity( Gravity.CENTER ); + baseLayout.addView( sourceLayout ); + + LinearLayout sourceClickLayout = new LinearLayout( this ); + sourceClickLayout.setOrientation( LinearLayout.HORIZONTAL ); + sourceClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); + sourceClickLayout.setGravity( Gravity.CENTER ); + sourceLayout.addView( sourceClickLayout ); + sourceClickLayout.setOnClickListener( new View.OnClickListener() { + @Override + public void onClick( View v ) { + gplLink( v ); + } + }); + + TextView sourceText = new TextView( this ); + sourceText.setText( "This program's source code is avaiable under the GNU General Public License v3." ); + sourceText.setTextSize( 24 ); + sourceText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); + sourceText.setPadding( padding, padding, padding, padding ); + sourceClickLayout.addView( sourceText ); + + // cc button + + LinearLayout imgLayout = new LinearLayout( this ); + imgLayout.setOrientation( LinearLayout.HORIZONTAL ); + imgLayout.setLayoutParams( smallLayoutParams ); + imgLayout.setGravity( Gravity.CENTER ); + imgLayout.setBackgroundColor( 0xff000000 ); + baseLayout.addView( imgLayout ); + + LinearLayout imgClickLayout = new LinearLayout( this ); + imgClickLayout.setOrientation( LinearLayout.HORIZONTAL ); + imgClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); + imgClickLayout.setGravity( Gravity.CENTER ); + imgLayout.addView( imgClickLayout ); + imgClickLayout.setOnClickListener( new View.OnClickListener() { + @Override + public void onClick( View v ) { + ccLink( v ); + } + }); + + TextView aboutText = new TextView( this ); + aboutText.setText( "All the images included in this program are avaiable under the Creative Commons Attribution Share Alike 4.0 license." ); + aboutText.setTextSize( 24 ); + aboutText.setTextColor( 0xffffffff ); + aboutText.setPadding( padding, padding, padding, padding ); + imgClickLayout.addView( aboutText ); + + } + + public void gplLink( View v ) { + + Uri uri = Uri.parse( "http://choosealicense.com/licenses/gpl-3.0/" ); + Intent intent = new Intent( Intent.ACTION_VIEW, uri ); + startActivity( intent ); + } + + public void ccLink( View v ) { + + Uri uri = Uri.parse( "http://choosealicense.com/licenses/cc-by-sa-4.0/" ); + Intent intent = new Intent( Intent.ACTION_VIEW, uri ); + startActivity( intent ); + } +} diff --git a/app/src/main/java/ovh/ice/icecons/MainActivity.java b/app/src/main/java/ovh/ice/icecons/MainActivity.java index 6e20646ce9884e565ec7e0431b40a68e6efb4a9c..9fd88f4540b938af42a8208676e87da49f952c52 100644 --- a/app/src/main/java/ovh/ice/icecons/MainActivity.java +++ b/app/src/main/java/ovh/ice/icecons/MainActivity.java @@ -1,8 +1,7 @@ package ovh.ice.icecons; import android.content.Intent; -import android.content.res.ColorStateList; -import android.content.res.Resources; +import android.graphics.drawable.BitmapDrawable; import android.net.Uri; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; @@ -25,63 +24,120 @@ public class MainActivity extends AppCompatActivity { private void createLayout() { + // main centered layout + LinearLayout.LayoutParams smallLayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f ); - ViewGroup.LayoutParams buttonParams = new ViewGroup.LayoutParams( 256, 256 ); + float scale = IceScreenUtils.densityScale( getApplicationContext() ); + ViewGroup.LayoutParams buttonParams = new ViewGroup.LayoutParams( Math.round( 48 * scale ), Math.round( 48 * scale ) ); + + LinearLayout frameLayout = new LinearLayout( this ); + frameLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); + frameLayout.setBackgroundColor( 0xffffffff ); + frameLayout.setGravity( Gravity.CENTER ); + setContentView( frameLayout ); LinearLayout baseLayout = new LinearLayout( this ); baseLayout.setOrientation( LinearLayout.VERTICAL ); - baseLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); - baseLayout.setBackgroundResource( R.drawable.menu_background ); - baseLayout.setPadding( 16, 36, 16, 0 ); - setContentView( baseLayout ); + baseLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); + baseLayout.setGravity( Gravity.LEFT ); + frameLayout.addView( baseLayout ); + + // wallpaper button LinearLayout wallpaperLayout = new LinearLayout( this ); wallpaperLayout.setOrientation( LinearLayout.HORIZONTAL ); wallpaperLayout.setLayoutParams( smallLayoutParams ); - wallpaperLayout.setGravity( Gravity.CENTER ); + wallpaperLayout.setGravity( Gravity.CENTER_VERTICAL ); baseLayout.addView( wallpaperLayout ); - Button wallpaperButton = new Button( this ); - wallpaperButton.setLayoutParams( buttonParams ); - wallpaperButton.setBackgroundResource( R.drawable.ic_wallpaper_button ); - wallpaperLayout.addView( wallpaperButton ); - wallpaperButton.setOnClickListener( new View.OnClickListener() { + LinearLayout wallpaperClickLayout = new LinearLayout( this ); + wallpaperClickLayout.setOrientation( LinearLayout.HORIZONTAL ); + wallpaperClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); + wallpaperClickLayout.setGravity( Gravity.CENTER ); + wallpaperLayout.addView( wallpaperClickLayout ); + wallpaperClickLayout.setOnClickListener( new View.OnClickListener() { @Override public void onClick( View v ) { wallpaperPicker( v ); } }); + Button wallpaperButton = new Button( this ); + wallpaperButton.setLayoutParams( buttonParams ); + wallpaperButton.setBackground( new BitmapDrawable( getResources(), IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_wallpaper_button, Math.round( 48 * scale ), Math.round( 48 * scale ) ) ) ); + wallpaperClickLayout.addView( wallpaperButton ); + TextView wallpaperText = new TextView( this ); wallpaperText.setText( "wallpapers" ); wallpaperText.setTextSize( 24 ); wallpaperText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); wallpaperText.setPadding( 64, 64, 64, 64 ); - wallpaperLayout.addView( wallpaperText ); + wallpaperClickLayout.addView( wallpaperText ); + + // source code button LinearLayout sourceLayout = new LinearLayout( this ); sourceLayout.setOrientation( LinearLayout.HORIZONTAL ); sourceLayout.setLayoutParams( smallLayoutParams ); - sourceLayout.setGravity( Gravity.CENTER ); + sourceLayout.setGravity( Gravity.CENTER_VERTICAL ); baseLayout.addView( sourceLayout ); + LinearLayout sourceClickLayout = new LinearLayout( this ); + sourceClickLayout.setOrientation( LinearLayout.HORIZONTAL ); + sourceClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); + sourceClickLayout.setGravity( Gravity.CENTER ); + sourceLayout.addView( sourceClickLayout ); + sourceClickLayout.setOnClickListener( new View.OnClickListener() { + @Override + public void onClick( View v ) { + gitLink( v ); + } + }); + + Button sourceButton = new Button( this ); + sourceButton.setLayoutParams( buttonParams ); + sourceButton.setBackground( new BitmapDrawable( getResources(), IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_source_button, Math.round( 48 * scale ), Math.round( 48 * scale ) ) ) ); + sourceClickLayout.addView( sourceButton ); + TextView sourceText = new TextView( this ); sourceText.setText( "source code" ); sourceText.setTextSize( 24 ); sourceText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); sourceText.setPadding(64, 64, 64, 64); - sourceLayout.addView( sourceText ); - - Button sourceButton = new Button( this ); - sourceButton.setLayoutParams( buttonParams ); - sourceButton.setBackgroundResource( R.drawable.ic_source_button ); - sourceLayout.addView( sourceButton ); - sourceButton.setOnClickListener( new View.OnClickListener() { + sourceClickLayout.addView( sourceText ); + + // license button + + LinearLayout aboutLayout = new LinearLayout( this ); + aboutLayout.setOrientation( LinearLayout.HORIZONTAL ); + aboutLayout.setLayoutParams( smallLayoutParams ); + aboutLayout.setGravity( Gravity.CENTER_VERTICAL ); + baseLayout.addView( aboutLayout ); + + LinearLayout aboutClickLayout = new LinearLayout( this ); + aboutClickLayout.setOrientation( LinearLayout.HORIZONTAL ); + aboutClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); + aboutClickLayout.setGravity( Gravity.CENTER ); + aboutLayout.addView( aboutClickLayout ); + aboutClickLayout.setOnClickListener( new View.OnClickListener() { @Override public void onClick( View v ) { - gitLink( v ); + licenseShow( v ); } }); + + Button aboutButton = new Button( this ); + aboutButton.setLayoutParams( buttonParams ); + aboutButton.setBackground( new BitmapDrawable( getResources(), IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_license_button, Math.round( 48 * scale ), Math.round( 48 * scale ) ) ) ); + aboutClickLayout.addView( aboutButton ); + + TextView aboutText = new TextView( this ); + aboutText.setText( "license" ); + aboutText.setTextSize( 24 ); + aboutText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); + aboutText.setPadding(64, 64, 64, 64); + aboutClickLayout.addView( aboutText ); + } public void gitLink( View v ) { @@ -96,4 +152,10 @@ public class MainActivity extends AppCompatActivity { Intent intent = new Intent( this, WallpaperActivity.class ); startActivity( intent ); } + + public void licenseShow( View v ) { + + Intent intent = new Intent( this, LicenseActivity.class ); + startActivity( intent ); + } } diff --git a/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java b/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java index a0b942440d968bfc226994e5e80225fb9661b391..7d7d7a3c73e8cbb23c21d3547ede1eae23c9314d 100644 --- a/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java +++ b/app/src/main/java/ovh/ice/icecons/WallpaperActivity.java @@ -1,11 +1,9 @@ package ovh.ice.icecons; import android.content.Intent; -import android.content.res.Configuration; -import android.graphics.Bitmap; +import android.graphics.Rect; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; -import android.util.Config; import android.view.Gravity; import android.view.View; import android.widget.ImageView; @@ -17,17 +15,12 @@ import java.util.ArrayList; public class WallpaperActivity extends AppCompatActivity { private Integer[] mImages = { - R.drawable.bush, R.drawable.clovers, - R.drawable.daisy, R.drawable.ivy, - R.drawable.rock, R.drawable.wall, - R.drawable.foam, R.drawable.night - }; - - private Integer[] mThumbnails = { - R.drawable.bush_thumb, R.drawable.clovers_thumb, - R.drawable.daisy_thumb, R.drawable.ivy_thumb, - R.drawable.rock_thumb, R.drawable.wall_thumb, - R.drawable.foam_thumb, R.drawable.night_thumb + R.drawable.wall_1, R.drawable.wall_2, + R.drawable.wall_3, R.drawable.wall_4, + R.drawable.wall_5, R.drawable.wall_6, + R.drawable.wall_7, R.drawable.wall_8, + R.drawable.wall_9, R.drawable.wall_10, + R.drawable.wall_11, R.drawable.wall_12 }; private ArrayList<LinearLayout> layoutList = new ArrayList<>(); @@ -38,78 +31,73 @@ public class WallpaperActivity extends AppCompatActivity { super.onCreate( savedInstanceState ); - if( getResources().getDisplayMetrics().widthPixels > getResources().getDisplayMetrics().heightPixels ) { - createLayout(3); - } else { - createLayout(2); + if( IceScreenUtils.isPortrait( getApplicationContext() ) ) + createLayout( 2 ); + else { + createLayout( 3 ); } } private void createLayout( int width ) { + float scale = IceScreenUtils.densityScale( getApplicationContext() ); + int margin = 16 * Math.round( scale ); + LinearLayout.LayoutParams baseParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ); - LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT ); + LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT ); LinearLayout.LayoutParams containerParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ); - LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1f ); + LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f ); ScrollView baseScroller = new ScrollView( this ); baseScroller.setLayoutParams( baseParams ); + baseScroller.setBackgroundColor( 0xffffffff ); setContentView( baseScroller ); + baseScroller.setVisibility( View.VISIBLE ); + + // display width hack + + Rect windowRect = new Rect(); + baseScroller.getWindowVisibleDisplayFrame(windowRect); + int windowWidth = windowRect.right - windowRect.left; LinearLayout baseLayout = new LinearLayout( this ); baseLayout.setOrientation( LinearLayout.VERTICAL ); baseLayout.setLayoutParams( layoutParams ); + baseLayout.setPadding( margin, margin, 0, 0 ); baseScroller.addView( baseLayout ); - for( int i =0; i < mThumbnails.length; i++ ) { + for( int i =0; i < mImages.length; i++ ) { if( ( i%width ) == 0 ) { - layoutList.add( ( i / width ), new LinearLayout( this ) ); - layoutList.get( i / width ).setOrientation( LinearLayout.HORIZONTAL ); - layoutList.get( i / width ).setGravity( Gravity.LEFT ); - layoutList.get( i / width ).setLayoutParams( containerParams ); - - baseLayout.addView( layoutList.get( i / width ) ); - - imageList.add( i, new ImageView( this ) ); - imageList.get(i).setLayoutParams( imageParams ); - imageList.get(i).setScaleType( ImageView.ScaleType.CENTER_CROP ); - imageList.get(i).setImageResource( mThumbnails[i] ); - imageList.get(i).setAdjustViewBounds( true ); - - final Integer tempId = mImages[i]; - imageList.get(i).setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View v ) { - wallpaperView( v, tempId); - } - }); - - layoutList.get( i / width ).addView( imageList.get(i) ); - - } else { - - imageList.add( i, new ImageView( this ) ); - imageList.get(i).setLayoutParams( imageParams ); - imageList.get(i).setScaleType( ImageView.ScaleType.CENTER_CROP ); - imageList.get(i).setImageResource( mThumbnails[i] ); - imageList.get(i).setAdjustViewBounds( true ); - - final Integer tempId = mImages[i]; - imageList.get(i).setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View v ) { - wallpaperView( v, tempId); - } - }); - - layoutList.get( ( i - ( i % width ) ) / width ).addView( imageList.get(i) ); + layoutList.add((i / width), new LinearLayout(this)); + layoutList.get(i / width).setOrientation(LinearLayout.HORIZONTAL); + layoutList.get(i / width).setGravity(Gravity.LEFT); + layoutList.get(i / width).setLayoutParams(containerParams); + + baseLayout.addView(layoutList.get(i / width)); } + + imageList.add( i, new ImageView( this ) ); + imageList.get(i).setLayoutParams( imageParams ); + imageList.get(i).setScaleType( ImageView.ScaleType.FIT_XY ); + imageList.get(i).setPadding( 0, 0, margin, margin ); + IceImageUtils.bitmapLoadAsync( imageList.get(i), getApplicationContext().getResources(), mImages[i], ( windowWidth / width ) - ( margin * width + margin ) / width, ( windowWidth / width ) - ( margin * width + margin ) / width ); + imageList.get(i).setAdjustViewBounds( true ); + + final Integer tempId = mImages[i]; + imageList.get(i).setOnClickListener( new View.OnClickListener() { + @Override + public void onClick( View v ) { + wallpaperView( tempId ); + } + }); + + layoutList.get( i / width ).addView( imageList.get(i) ); } } - public void wallpaperView( View v, Integer imageId ) { + public void wallpaperView( Integer imageId ) { Intent intent = new Intent( this, WallpaperSetActivity.class ); intent.putExtra( "image", imageId ); diff --git a/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java b/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java index e1455a0e88f2342a559b10cdfc3120a7185b2848..e7b4625b34aa40133de434b4dbb8c775f7209b99 100644 --- a/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java +++ b/app/src/main/java/ovh/ice/icecons/WallpaperSetActivity.java @@ -1,15 +1,11 @@ package ovh.ice.icecons; import android.app.WallpaperManager; -import android.content.Context; import android.content.Intent; -import android.content.res.Resources; import android.graphics.Bitmap; -import android.graphics.BitmapFactory; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; -import android.view.Display; import android.view.Gravity; import android.view.View; import android.widget.ImageView; @@ -21,9 +17,9 @@ import java.io.IOException; public class WallpaperSetActivity extends AppCompatActivity { private int imageId; - private boolean isPortrait; private int screenWidth; private int screenHeight; + float scale; Bitmap Wallpaper; @@ -36,10 +32,10 @@ public class WallpaperSetActivity extends AppCompatActivity { final Intent intent = getIntent(); imageId = intent.getIntExtra( "image", 0 ); - isPortrait = getResources().getDisplayMetrics().widthPixels < getResources().getDisplayMetrics().heightPixels; - screenWidth = isPortrait ? getResources().getDisplayMetrics().widthPixels : getResources().getDisplayMetrics().heightPixels; - screenHeight = isPortrait ? getResources().getDisplayMetrics().heightPixels : getResources().getDisplayMetrics().widthPixels; - Wallpaper = decodeSampledBitmapFromResource( getApplicationContext().getResources(), imageId, screenWidth, screenHeight ); + screenWidth = IceScreenUtils.width( getApplicationContext() ); + screenHeight = IceScreenUtils.height( getApplicationContext() ); + Wallpaper = IceImageUtils.bitmapLoad( getApplicationContext().getResources(), imageId, screenWidth, screenHeight ); + scale = IceScreenUtils.densityScale( getApplicationContext() ); createLayout(); } @@ -60,14 +56,15 @@ public class WallpaperSetActivity extends AppCompatActivity { LinearLayout buttonBar = new LinearLayout( this ); buttonBar.setOrientation( LinearLayout.HORIZONTAL ); - buttonBar.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, 256 ) ); + buttonBar.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, Math.round( 96 * scale ) ) ); baseLayout.setBackgroundColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimary ) ); buttonBar.setGravity( Gravity.CENTER ); + buttonBar.setBackgroundColor( 0xffffffff ); baseLayout.addView( buttonBar ); ImageView backButton = new ImageView( this ); - backButton.setLayoutParams( new LinearLayout.LayoutParams( 0, 192, 1 ) ); - backButton.setImageResource( R.drawable.ic_back ); + backButton.setLayoutParams( new LinearLayout.LayoutParams( 0, Math.round( 72 * scale ), 1 ) ); + backButton.setImageBitmap( IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_close, Math.round( 72 * scale ), Math.round( 72 * scale ) ) ); buttonBar.addView( backButton ); backButton.setOnClickListener( new View.OnClickListener() { @Override @@ -77,8 +74,8 @@ public class WallpaperSetActivity extends AppCompatActivity { }); ImageView applyButton = new ImageView( this ); - applyButton.setLayoutParams( new LinearLayout.LayoutParams( 0, 192, 1 ) ); - applyButton.setImageResource( R.drawable.ic_apply ); + applyButton.setLayoutParams( new LinearLayout.LayoutParams( 0, Math.round( 72 * scale ), 1 ) ); + applyButton.setImageBitmap( IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_apply, Math.round( 72 * scale ), Math.round( 72 * scale ) ) ); buttonBar.addView( applyButton ); applyButton.setOnClickListener( new View.OnClickListener() { @Override @@ -96,7 +93,7 @@ public class WallpaperSetActivity extends AppCompatActivity { wallpaperManager.setBitmap( Wallpaper ); - Toast toast = Toast.makeText( this, "Wallpaper Set", Toast.LENGTH_SHORT ); + Toast toast = Toast.makeText( this, "Wallpaper set", Toast.LENGTH_SHORT ); toast.setGravity( Gravity.CENTER, 0, 0 ); toast.show(); @@ -105,43 +102,5 @@ public class WallpaperSetActivity extends AppCompatActivity { e.printStackTrace(); } } - - private int calculateInSampleSize( BitmapFactory.Options options, int reqWidth, int reqHeight ) { - - // Raw height and width of image - final int height = options.outHeight; - final int width = options.outWidth; - int inSampleSize = 1; - - if (height > reqHeight || width > reqWidth) { - - final int halfHeight = height / 2; - final int halfWidth = width / 2; - - // Calculate the largest inSampleSize value that is a power of 2 and keeps both - // height and width larger than the requested height and width. - while ((halfHeight / inSampleSize) > reqHeight - && (halfWidth / inSampleSize) > reqWidth) { - inSampleSize *= 2; - } - } - - return inSampleSize; - } - - private Bitmap decodeSampledBitmapFromResource( Resources res, int resId, int reqWidth, int reqHeight ) { - - // First decode with inJustDecodeBounds=true to check dimensions - final BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - BitmapFactory.decodeResource( res, resId, options ); - - // Calculate inSampleSize - options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight); - - // Decode bitmap with inSampleSize set - options.inJustDecodeBounds = false; - return BitmapFactory.decodeResource( res, resId, options); - } } diff --git a/app/src/main/res/drawable-nodpi/bush.jpg b/app/src/main/res/drawable-nodpi/bush.jpg deleted file mode 100755 index 800681855b8bca62456b1554519f9a5aa5280377..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/bush.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/bush_thumb.jpg b/app/src/main/res/drawable-nodpi/bush_thumb.jpg deleted file mode 100644 index fb0f2ab9833543dbff449ca31bd15501380e34bc..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/bush_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/clovers.jpg b/app/src/main/res/drawable-nodpi/clovers.jpg deleted file mode 100755 index 78356d58891953468fd3023a9e5ac210a9721c01..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/clovers.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/clovers_thumb.jpg b/app/src/main/res/drawable-nodpi/clovers_thumb.jpg deleted file mode 100644 index 38b589733a458166535b94f3d7f727e34ce76133..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/clovers_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/daisy.jpg b/app/src/main/res/drawable-nodpi/daisy.jpg deleted file mode 100755 index d91df5938bf3a0f07de69b3f4d87b2ed0fe75ff0..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/daisy.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/daisy_thumb.jpg b/app/src/main/res/drawable-nodpi/daisy_thumb.jpg deleted file mode 100644 index 4a240cf076644046fc8cb1d63b24c803d42825c6..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/daisy_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/foam.jpg b/app/src/main/res/drawable-nodpi/foam.jpg deleted file mode 100644 index 0dea9781156bc15ff7ae945d36fd23bfe3a59cab..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/foam.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/foam_thumb.jpg b/app/src/main/res/drawable-nodpi/foam_thumb.jpg deleted file mode 100644 index 78bab80cf4f69094ad6232f922a2bfb8d5ae6489..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/foam_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/ic_apply.png b/app/src/main/res/drawable-nodpi/ic_apply.png index d59b3aeff10520eef558101c3624382a56978209..ec5522c63131c731b9f5e555bee16a7f6955a792 100644 Binary files a/app/src/main/res/drawable-nodpi/ic_apply.png and b/app/src/main/res/drawable-nodpi/ic_apply.png differ diff --git a/app/src/main/res/drawable-nodpi/ic_back.png b/app/src/main/res/drawable-nodpi/ic_back.png index 1f851fad93bce8ed2b9929e35a9708ded96ad05b..456ea8fc0eae4504ec8d23a317520e36b3b8baad 100644 Binary files a/app/src/main/res/drawable-nodpi/ic_back.png and b/app/src/main/res/drawable-nodpi/ic_back.png differ diff --git a/app/src/main/res/drawable-nodpi/ic_close.png b/app/src/main/res/drawable-nodpi/ic_close.png new file mode 100644 index 0000000000000000000000000000000000000000..c0158a091f6889bb57f759d5edff1233cd7bf6b4 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/ic_close.png differ diff --git a/app/src/main/res/drawable-nodpi/ic_license_button.png b/app/src/main/res/drawable-nodpi/ic_license_button.png new file mode 100644 index 0000000000000000000000000000000000000000..a30117577ce9f42e9df357abb6f594e48ff6b3d3 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/ic_license_button.png differ diff --git a/app/src/main/res/drawable-nodpi/ic_source_button.png b/app/src/main/res/drawable-nodpi/ic_source_button.png index 06307858d6b1119146d4a11fa5fbacfe006f9f48..82f37f0c0287f794b034f8a85df684b81dc59946 100644 Binary files a/app/src/main/res/drawable-nodpi/ic_source_button.png and b/app/src/main/res/drawable-nodpi/ic_source_button.png differ diff --git a/app/src/main/res/drawable-nodpi/ic_wallpaper_button.png b/app/src/main/res/drawable-nodpi/ic_wallpaper_button.png index 2d8bf3f56a02738bdf6591a1b1ecbd9c31ccb813..0979f1263177fb4d9dc83c676996818cd5d0d96b 100644 Binary files a/app/src/main/res/drawable-nodpi/ic_wallpaper_button.png and b/app/src/main/res/drawable-nodpi/ic_wallpaper_button.png differ diff --git a/app/src/main/res/drawable-nodpi/ivy.jpg b/app/src/main/res/drawable-nodpi/ivy.jpg deleted file mode 100755 index 376dc12c61cd00b3173a3d48c1c4b9cad8587b9b..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/ivy.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/ivy_thumb.jpg b/app/src/main/res/drawable-nodpi/ivy_thumb.jpg deleted file mode 100644 index 9993ec34f358202a8cee1780e5b3696279a27f45..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/ivy_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/menu_background.jpg b/app/src/main/res/drawable-nodpi/menu_background.jpg deleted file mode 100644 index 9cb185bdb9107e4139e242043126c88bb6afb787..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/menu_background.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/night.jpg b/app/src/main/res/drawable-nodpi/night.jpg deleted file mode 100644 index 082831f9bcf5e956ac94d655efe0a2bc57fb578c..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/night.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/night_thumb.jpg b/app/src/main/res/drawable-nodpi/night_thumb.jpg deleted file mode 100644 index b8d6019aa04a711e771c773907e09c6c0658efbd..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/night_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/rock.jpg b/app/src/main/res/drawable-nodpi/rock.jpg deleted file mode 100755 index 0b92f170228f1f6cb148d088bac84f84d0447d28..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/rock.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/rock_thumb.jpg b/app/src/main/res/drawable-nodpi/rock_thumb.jpg deleted file mode 100644 index 46dbe29b641f2908f8951b51354e355fdabc5bca..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/rock_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/wall.jpg b/app/src/main/res/drawable-nodpi/wall.jpg deleted file mode 100755 index 69deef708ea16777cb62665dc309c9da757f766d..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/wall.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/wall_1.jpg b/app/src/main/res/drawable-nodpi/wall_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..41ea07f67f1831e807eec9e7500f0d3ad200720e Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_1.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_10.jpg b/app/src/main/res/drawable-nodpi/wall_10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..896a91cf87be15c6ce47c2b98571fed71ddbffa3 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_10.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_11.jpg b/app/src/main/res/drawable-nodpi/wall_11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0467c842e3208f24d8547caa21515c8087a57091 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_11.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_12.jpg b/app/src/main/res/drawable-nodpi/wall_12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a5236219e492e1fe8dd4c348f4cb42e3a3973127 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_12.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_2.jpg b/app/src/main/res/drawable-nodpi/wall_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e84b972eed1612175b206a5892a7464ac40fce94 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_2.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_3.jpg b/app/src/main/res/drawable-nodpi/wall_3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b0af7ddd0c10a75018b98d9b1146918025648cc4 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_3.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_4.jpg b/app/src/main/res/drawable-nodpi/wall_4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7f3d1985061285eacc1f264a35829a9690db2b08 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_4.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_5.jpg b/app/src/main/res/drawable-nodpi/wall_5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c8347b30a7235c63d224932d6306fe2b169254d7 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_5.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_6.jpg b/app/src/main/res/drawable-nodpi/wall_6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..374e2c79eda7f6fef3775d97ab2e0225f4d1d2d2 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_6.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_7.jpg b/app/src/main/res/drawable-nodpi/wall_7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ebdf57d4b1f080f3842078c356f61cd558312514 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_7.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_8.jpg b/app/src/main/res/drawable-nodpi/wall_8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..75b8f340e2aabf194c2850be4dc778abfacfa4eb Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_8.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_9.jpg b/app/src/main/res/drawable-nodpi/wall_9.jpg new file mode 100644 index 0000000000000000000000000000000000000000..742889592382e297db20bc13430d5f8a915d39ac Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wall_9.jpg differ diff --git a/app/src/main/res/drawable-nodpi/wall_thumb.jpg b/app/src/main/res/drawable-nodpi/wall_thumb.jpg deleted file mode 100644 index d9974a8bf89b97b09c8dadda3d6f255ddf3b57eb..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-nodpi/wall_thumb.jpg and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 0b4c9837af59bcec966ca3f9e14c0c30e4898fc8..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 787ceb80d9dd3735b34555da1167bea9cba4cbc7..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index d5929e818f068396b31f47380299e267393a9147..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d82c0389cf889cf6ae9fd64f64277861690f45b7..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index a0d0cbc86adbdda9f37d2c66efeb4cee2d1d6b12..75fe0ddf081cb56b81e88bdaccc1947587286270 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/build/intermediates/dex-cache/cache.xml b/build/intermediates/dex-cache/cache.xml deleted file mode 100644 index fba8db89fe63019a522cb871f7d4ffd430d79e79..0000000000000000000000000000000000000000 --- a/build/intermediates/dex-cache/cache.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<items version="2" /> diff --git a/local.properties b/local.properties index e2babe2f71353e2c3eba4ca03e94256ab122dfb4..7e9b4b0c25dc5beb85ae38cf01e2584361951e52 100644 --- a/local.properties +++ b/local.properties @@ -1,10 +1,11 @@ ## This file is automatically generated by Android Studio. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # -# This file should *NOT* be checked into Version Control Systems, +# This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. # # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -sdk.dir=/home/riccardo/.androidsdk/Sdk \ No newline at end of file +#Thu Apr 28 18:20:52 CEST 2016 +sdk.dir=/home/riccardo/.androidsdk/Sdk