[
  {
    "path": ".gitignore",
    "content": "# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Intellij project files\n*.iml\n.idea/\n\n.DS_Store\n\nbuild\n.gradle\nprojectFilesBackup"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 rongi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "Rotate Layout\n=============\n\nA custom layout that can rotate it's view\n\n[![Example](https://github.com/rongi/rotate-layout/raw/master/docs/screenshot5.png)](#Example)\n\nUsage\n=====\n\nIn your layout file add\n\n```xml \n<com.github.rongi.rotate_layout.layout.RotateLayout\n\txmlns:app=\"http://schemas.android.com/apk/res-auto\"\n\tandroid:layout_width=\"wrap_content\"\n\tandroid:layout_height=\"wrap_content\"\n\tapp:angle=\"90\">\t<!-- Specify rotate angle here -->\n\n\t<YourLayoutHere\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\">\n\t</YourLayoutHere>\n</com.github.rongi.rotate_layout.layout.RotateLayout>\n```\n\nVoila! Your layout will be rotated 90 degrees.\n\nDownload\n========\n\n```groovy\nimplementation 'rongi.rotate-layout:rotate-layout:3.0.0'\n```\n\nFeatures\n========\n\n1. The rotated view receives correct touch events.\n2. The bounding box is also rotated. This means that if the view was 100x50px before the rotation, then after 90 degrees rotation it will be 50x100px and can fit into another layout with this dimensions.\n\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.2.3'\n        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'\n        classpath 'com.github.dcendents:android-maven-plugin:1.2'\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n"
  },
  {
    "path": "examples/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tpackage=\"com.github.rongi.rotate_layout.example\"\n\t>\n\n\t<application\n\t\tandroid:allowBackup=\"true\"\n\t\tandroid:icon=\"@drawable/ic_launcher\"\n\t\tandroid:label=\"@string/app_name\"\n\t\tandroid:theme=\"@style/AppTheme\"\n\t\t >\n\t\t<activity\n\t\t\tandroid:name=\"com.github.rongi.rotate_layout.example.MainActivity\"\n\t\t\tandroid:label=\"@string/app_name\" >\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />\n\n\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />\n\t\t\t</intent-filter>\n\t\t</activity>\n\t</application>\n\n</manifest>\n"
  },
  {
    "path": "examples/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 22\n    buildToolsVersion '22.0.1'\n\n    sourceSets {\n        main {\n            manifest.srcFile 'AndroidManifest.xml'\n            java.srcDirs = ['src']\n//            resources.srcDirs = ['src']\n//            aidl.srcDirs = ['src']\n//            renderscript.srcDirs = ['src']\n            res.srcDirs = ['res']\n            assets.srcDirs = ['assets']\n        }\n\n        // Move the tests to tests/java, tests/res, etc...\n        instrumentTest.setRoot('tests')\n\n        // Move the build types to build-types/<type>\n        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...\n        // This moves them out of them default location under src/<type>/... which would\n        // conflict with src/ being used by the main source set.\n        // Adding new build types or product flavors should be accompanied\n        // by a similar customization.\n        debug.setRoot('build-types/debug')\n        release.setRoot('build-types/release')\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_7\n        targetCompatibility JavaVersion.VERSION_1_7\n    }\n\n    defaultConfig {\n        applicationId \"com.github.rongi.rotate_layout.example\"\n        minSdkVersion 19\n        targetSdkVersion 22\n        versionCode 1\n        versionName \"1\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile project(':rotate-layout')\n    compile 'com.jakewharton:butterknife:7.0.1'\n}\n"
  },
  {
    "path": "examples/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/dmitry/dev/android-sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "examples/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-19\nandroid.library.reference.1=../../../git/rotate-layout/library\n"
  },
  {
    "path": "examples/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"#ff0000\"/>\n    <solid android:color=\"@android:color/white\"/>\n</shape>"
  },
  {
    "path": "examples/res/layout/activity_main.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\">\n\n    <TextView\n        android:id=\"@+id/hint\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"10dp\"\n        android:text=\"@string/click_on_a_form_to_rotate_it\"\n        />\n\n    <com.github.rongi.rotate_layout.layout.RotateLayout\n        android:id=\"@+id/form1_container\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/hint\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"10dip\"\n        android:background=\"#BAE1FF\"\n        app:angle=\"0\">\n\n        <include\n            android:id=\"@+id/form1\"\n            layout=\"@layout/small_form\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:padding=\"5dip\"/>\n    </com.github.rongi.rotate_layout.layout.RotateLayout>\n\n    <com.github.rongi.rotate_layout.layout.RotateLayout\n        android:id=\"@+id/form2_container\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/form1_container\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"10dip\"\n        android:background=\"#BAE1FF\"\n        app:angle=\"75\">\n\n        <include\n            android:id=\"@+id/form2\"\n            layout=\"@layout/small_form\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:padding=\"5dip\"/>\n    </com.github.rongi.rotate_layout.layout.RotateLayout>\n\n    <com.github.rongi.rotate_layout.layout.RotateLayout\n        android:id=\"@+id/form3_container\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/form2_container\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"10dip\"\n        android:background=\"#BAE1FF\"\n        app:angle=\"180\">\n\n        <include\n            android:id=\"@+id/form3\"\n            layout=\"@layout/small_form\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:padding=\"5dip\"/>\n    </com.github.rongi.rotate_layout.layout.RotateLayout>\n\n</RelativeLayout>"
  },
  {
    "path": "examples/res/layout/small_form.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"@drawable/border\"\n                android:padding=\"5dip\">\n\n    <ImageView\n        android:id=\"@+id/image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerHorizontal=\"true\"\n        android:src=\"@drawable/ic_launcher\"/>\n\n    <Button\n        android:id=\"@+id/button2\"\n        android:layout_width=\"100dip\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/image\"\n        android:text=\"@android:string/cancel\"/>\n\n    <Button\n        android:id=\"@+id/button1\"\n        android:layout_width=\"100dip\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/image\"\n        android:layout_toRightOf=\"@+id/button2\"\n        android:text=\"@android:string/ok\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "examples/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n\t<string name=\"app_name\">Rotate Layout example</string>\n    <string name=\"click_on_a_form_to_rotate_it\">Click on a form to rotate it</string>\n\n</resources>\n"
  },
  {
    "path": "examples/res/values/styles.xml",
    "content": "<resources>\n\n\t<!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n\t-->\n\t<style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n\t\t<!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n\t\t-->\n\t</style>\n\n\t<!-- Application theme. -->\n\t<style name=\"AppTheme\" parent=\"AppBaseTheme\">\n\t\t<!-- All customizations that are NOT specific to a particular API-level can go here. -->\n\t</style>\n\n</resources>\n"
  },
  {
    "path": "examples/res/values-v14/styles.xml",
    "content": "<resources>\n\n\t<!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n\t-->\n\t<style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n\t\t<!-- API 14 theme customizations can go here. -->\n\t</style>\n\n</resources>\n"
  },
  {
    "path": "examples/src/com/github/rongi/rotate_layout/example/MainActivity.java",
    "content": "package com.github.rongi.rotate_layout.example;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\nimport com.github.rongi.rotate_layout.layout.RotateLayout;\n\nimport butterknife.Bind;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\n\npublic class MainActivity extends Activity {\n\n\t@Bind(R.id.form1_container) RotateLayout form1RotateLayout;\n\t@Bind(R.id.form2_container) RotateLayout form2RotateLayout;\n\t@Bind(R.id.form3_container) RotateLayout form3RotateLayout;\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t\tButterKnife.bind(this);\n\t}\n\n\t/**\n\t * Clicking on a form will rotate it\n\t */\n\t@OnClick({R.id.form1_container, R.id.form2_container, R.id.form3_container}) void onForm1ContainerClick(RotateLayout rotateLayout) {\n\t\tint newAngle = rotateLayout.getAngle() + 90;\n\t\trotateLayout.setAngle(newAngle);\n\t}\n\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Tue Feb 14 14:32:48 CET 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.2-all.zip\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "rotate-layout/AndroidManifest.xml",
    "content": "<manifest package=\"com.github.rongi.rotate_layout\"/>"
  },
  {
    "path": "rotate-layout/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\nversion = \"3.0.0\"\n\next {\n\n    // Bintray manual http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en\n    // To deploy:\n    // ./gradlew install\n    // ./gradlew bintrayUpload\n    bintrayRepo = 'maven'\n    bintrayName = 'rotate-layout'\n\n    publishedGroupId = 'rongi.rotate-layout'\n    libraryName = 'rotate-layout'\n    artifact = 'rotate-layout'\n\n    libraryDescription = 'Custom layout that can rotate it\\'s view'\n\n    siteUrl = 'https://github.com/rongi/rotate-layout'\n    gitUrl = 'https://github.com/rongi/rotate-layout.git'\n\n    libraryVersion = version\n\n    developerId = 'nickes'\n    developerName = 'nickes'\n    developerEmail = 'rongi@users.noreply.github.com'\n\n    licenseName = 'The MIT License (MIT)'\n    licenseUrl = 'https://github.com/rongi/rotate-layout/blob/master/LICENSE.md'\n    allLicenses = [\"MIT\"]\n}\n\nandroid {\n    compileSdkVersion 22\n    buildToolsVersion '22.0.1'\n\n    sourceSets {\n        main {\n            manifest.srcFile 'AndroidManifest.xml'\n            java.srcDirs = ['src']\n            res.srcDirs = ['res']\n            assets.srcDirs = ['assets']\n        }\n\n        // Move the tests to tests/java, tests/res, etc...\n        instrumentTest.setRoot('tests')\n\n        // Move the build types to build-types/<type>\n        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...\n        // This moves them out of them default location under src/<type>/... which would\n        // conflict with src/ being used by the main source set.\n        // Adding new build types or product flavors should be accompanied\n        // by a similar customization.\n        debug.setRoot('build-types/debug')\n        release.setRoot('build-types/release')\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_7\n        targetCompatibility JavaVersion.VERSION_1_7\n    }\n\n    defaultConfig {\n        minSdkVersion 1\n        targetSdkVersion 22\n        versionCode 1\n        versionName version\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\napply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'\napply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'\n"
  },
  {
    "path": "rotate-layout/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <declare-styleable name=\"RotateLayout\">\n        <!-- Child view of this layout will be rotated by this angle. -->\n        <attr name=\"angle\" format=\"integer\"/>\n    </declare-styleable>\n\n</resources>\n"
  },
  {
    "path": "rotate-layout/src/com/github/rongi/rotate_layout/layout/RotateLayout.java",
    "content": "package com.github.rongi.rotate_layout.layout;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Matrix;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.util.AttributeSet;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewParent;\n\nimport com.github.rongi.rotate_layout.R;\n\nimport static android.view.View.MeasureSpec.UNSPECIFIED;\nimport static java.lang.Math.PI;\nimport static java.lang.Math.abs;\nimport static java.lang.Math.ceil;\nimport static java.lang.Math.cos;\nimport static java.lang.Math.sin;\n\n/**\n * Rotates first view in this layout by specified angle.\n * <p>\n * This layout is supposed to have only one view. Behaviour of the views after the first one\n * is not defined.\n * <p>\n * XML attributes\n * See com.github.rongi.rotate_layout.R.styleable#RotateLayout RotateLayout Attributes,\n */\npublic class RotateLayout extends ViewGroup {\n\n  private int angle;\n\n  private final Matrix rotateMatrix = new Matrix();\n\n  private final Rect viewRectRotated = new Rect();\n\n  private final RectF tempRectF1 = new RectF();\n  private final RectF tempRectF2 = new RectF();\n\n  private final float[] viewTouchPoint = new float[2];\n  private final float[] childTouchPoint = new float[2];\n\n  private boolean angleChanged = true;\n\n  public RotateLayout(Context context) {\n    this(context, null);\n  }\n\n  public RotateLayout(Context context, AttributeSet attrs) {\n    this(context, attrs, 0);\n  }\n\n  public RotateLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n    super(context, attrs);\n\n    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RotateLayout);\n    angle = a.getInt(R.styleable.RotateLayout_angle, 0);\n    a.recycle();\n\n    setWillNotDraw(false);\n  }\n\n  /**\n   * Returns current angle of this layout\n   */\n  public int getAngle() {\n    return angle;\n  }\n\n  /**\n   * Sets current angle of this layout.\n   */\n  public void setAngle(int angle) {\n    if (this.angle != angle) {\n      this.angle = angle;\n      angleChanged = true;\n      requestLayout();\n      invalidate();\n    }\n  }\n\n  /**\n   * Returns this layout's child or null if there is no any\n   */\n  public View getView() {\n    if (getChildCount() > 0) {\n      return getChildAt(0);\n    } else {\n      return null;\n    }\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    final View child = getView();\n    if (child != null) {\n      if (abs(angle % 180) == 90) {\n        //noinspection SuspiciousNameCombination\n        measureChild(child, heightMeasureSpec, widthMeasureSpec);\n        setMeasuredDimension(\n          resolveSize(child.getMeasuredHeight(), widthMeasureSpec),\n          resolveSize(child.getMeasuredWidth(), heightMeasureSpec));\n      } else if (abs(angle % 180) == 0) {\n        measureChild(child, widthMeasureSpec, heightMeasureSpec);\n        setMeasuredDimension(\n          resolveSize(child.getMeasuredWidth(), widthMeasureSpec),\n          resolveSize(child.getMeasuredHeight(), heightMeasureSpec));\n      } else {\n        int childWithMeasureSpec = MeasureSpec.makeMeasureSpec(0, UNSPECIFIED);\n        int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, UNSPECIFIED);\n        measureChild(child, childWithMeasureSpec, childHeightMeasureSpec);\n\n        int measuredWidth = (int) ceil(child.getMeasuredWidth() * abs(cos(angle_c())) + child.getMeasuredHeight() * abs(sin(angle_c())));\n        int measuredHeight = (int) ceil(child.getMeasuredWidth() * abs(sin(angle_c())) + child.getMeasuredHeight() * abs(cos(angle_c())));\n\n        setMeasuredDimension(\n          resolveSize(measuredWidth, widthMeasureSpec),\n          resolveSize(measuredHeight, heightMeasureSpec));\n      }\n    } else {\n      super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int l, int t, int r, int b) {\n    int layoutWidth = r - l;\n    int layoutHeight = b - t;\n\n    if (angleChanged || changed) {\n      final RectF layoutRect = tempRectF1;\n      layoutRect.set(0, 0, layoutWidth, layoutHeight);\n      final RectF layoutRectRotated = tempRectF2;\n      rotateMatrix.setRotate(angle, layoutRect.centerX(), layoutRect.centerY());\n      rotateMatrix.mapRect(layoutRectRotated, layoutRect);\n      layoutRectRotated.round(viewRectRotated);\n      angleChanged = false;\n    }\n\n    final View child = getView();\n    if (child != null) {\n      int childLeft = (layoutWidth - child.getMeasuredWidth()) / 2;\n      int childTop = (layoutHeight - child.getMeasuredHeight()) / 2;\n      int childRight = childLeft + child.getMeasuredWidth();\n      int childBottom = childTop + child.getMeasuredHeight();\n      child.layout(childLeft, childTop, childRight, childBottom);\n    }\n  }\n\n  @Override\n  protected void dispatchDraw(Canvas canvas) {\n    canvas.save();\n    canvas.rotate(-angle, getWidth() / 2f, getHeight() / 2f);\n    super.dispatchDraw(canvas);\n    canvas.restore();\n  }\n\n  @Override\n  public ViewParent invalidateChildInParent(int[] location, Rect dirty) {\n    invalidate();\n    return super.invalidateChildInParent(location, dirty);\n  }\n\n  @Override\n  public boolean dispatchTouchEvent(MotionEvent event) {\n    viewTouchPoint[0] = event.getX();\n    viewTouchPoint[1] = event.getY();\n\n    rotateMatrix.mapPoints(childTouchPoint, viewTouchPoint);\n\n    event.setLocation(childTouchPoint[0], childTouchPoint[1]);\n    boolean result = super.dispatchTouchEvent(event);\n    event.setLocation(viewTouchPoint[0], viewTouchPoint[1]);\n\n    return result;\n  }\n\n  /**\n   * Circle angle, from 0 to TAU\n   */\n  private Double angle_c() {\n    // True circle constant, not that petty imposter known as \"PI\"\n    double TAU = 2 * PI;\n    return TAU * angle / 360;\n  }\n\n}\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':examples'\ninclude ':rotate-layout'"
  }
]