[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n      <entry name=\"!?*.aj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\">\n    <file url=\"PROJECT\" charset=\"UTF-8\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"LOCAL\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleHome\" value=\"$APPLICATION_HOME_DIR$/gradle/gradle-2.14.1\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/markdown-exported-files.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"MarkdownExportedFiles\">\n    <htmlFiles />\n    <imageFiles />\n    <otherFiles />\n  </component>\n</project>"
  },
  {
    "path": ".idea/markdown-navigator/profiles_settings.xml",
    "content": "<component name=\"MarkdownNavigator.ProfileManager\">\n  <settings default=\"\" pdf-export=\"\" />\n</component>"
  },
  {
    "path": ".idea/markdown-navigator.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"MarkdownProjectSettings\">\n    <PreviewSettings splitEditorLayout=\"SPLIT\" splitEditorPreview=\"PREVIEW\" useGrayscaleRendering=\"false\" zoomFactor=\"1.0\" maxImageWidth=\"0\" showGitHubPageIfSynced=\"false\" allowBrowsingInPreview=\"false\" synchronizePreviewPosition=\"true\" highlightPreviewType=\"LINE\" highlightFadeOut=\"5\" highlightOnTyping=\"true\" synchronizeSourcePosition=\"true\" verticallyAlignSourceAndPreviewSyncPosition=\"true\" showSearchHighlightsInPreview=\"true\" showSelectionInPreview=\"true\">\n      <PanelProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.panel\" providerName=\"Default - Swing\" />\n      </PanelProvider>\n    </PreviewSettings>\n    <ParserSettings gitHubSyntaxChange=\"false\">\n      <PegdownExtensions>\n        <option name=\"ABBREVIATIONS\" value=\"false\" />\n        <option name=\"ANCHORLINKS\" value=\"true\" />\n        <option name=\"ASIDE\" value=\"false\" />\n        <option name=\"ATXHEADERSPACE\" value=\"true\" />\n        <option name=\"AUTOLINKS\" value=\"true\" />\n        <option name=\"DEFINITIONS\" value=\"false\" />\n        <option name=\"DEFINITION_BREAK_DOUBLE_BLANK_LINE\" value=\"false\" />\n        <option name=\"FENCED_CODE_BLOCKS\" value=\"true\" />\n        <option name=\"FOOTNOTES\" value=\"false\" />\n        <option name=\"HARDWRAPS\" value=\"false\" />\n        <option name=\"HTML_DEEP_PARSER\" value=\"false\" />\n        <option name=\"INSERTED\" value=\"false\" />\n        <option name=\"QUOTES\" value=\"false\" />\n        <option name=\"RELAXEDHRULES\" value=\"true\" />\n        <option name=\"SMARTS\" value=\"false\" />\n        <option name=\"STRIKETHROUGH\" value=\"true\" />\n        <option name=\"SUBSCRIPT\" value=\"false\" />\n        <option name=\"SUPERSCRIPT\" value=\"false\" />\n        <option name=\"SUPPRESS_HTML_BLOCKS\" value=\"false\" />\n        <option name=\"SUPPRESS_INLINE_HTML\" value=\"false\" />\n        <option name=\"TABLES\" value=\"true\" />\n        <option name=\"TASKLISTITEMS\" value=\"true\" />\n        <option name=\"TOC\" value=\"false\" />\n        <option name=\"WIKILINKS\" value=\"true\" />\n      </PegdownExtensions>\n      <ParserOptions>\n        <option name=\"COMMONMARK_LISTS\" value=\"false\" />\n        <option name=\"DUMMY\" value=\"false\" />\n        <option name=\"EMOJI_SHORTCUTS\" value=\"true\" />\n        <option name=\"FLEXMARK_FRONT_MATTER\" value=\"false\" />\n        <option name=\"GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA\" value=\"false\" />\n        <option name=\"GFM_TABLE_RENDERING\" value=\"true\" />\n        <option name=\"GITBOOK_URL_ENCODING\" value=\"false\" />\n        <option name=\"GITHUB_EMOJI_URL\" value=\"false\" />\n        <option name=\"GITHUB_LISTS\" value=\"true\" />\n        <option name=\"GITHUB_WIKI_LINKS\" value=\"true\" />\n        <option name=\"JEKYLL_FRONT_MATTER\" value=\"false\" />\n        <option name=\"SIM_TOC_BLANK_LINE_SPACER\" value=\"true\" />\n      </ParserOptions>\n    </ParserSettings>\n    <HtmlSettings headerTopEnabled=\"false\" headerBottomEnabled=\"false\" bodyTopEnabled=\"false\" bodyBottomEnabled=\"false\" embedUrlContent=\"false\" addPageHeader=\"true\">\n      <GeneratorProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.generator\" providerName=\"Default Swing HTML Generator\" />\n      </GeneratorProvider>\n      <headerTop />\n      <headerBottom />\n      <bodyTop />\n      <bodyBottom />\n    </HtmlSettings>\n    <CssSettings previewScheme=\"UI_SCHEME\" cssUri=\"\" isCssUriEnabled=\"false\" isCssTextEnabled=\"false\" isDynamicPageWidth=\"true\">\n      <StylesheetProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.css\" providerName=\"Default Swing Stylesheet\" />\n      </StylesheetProvider>\n      <ScriptProviders />\n      <cssText />\n    </CssSettings>\n    <HtmlExportSettings updateOnSave=\"false\" parentDir=\"$ProjectFileDir$\" targetDir=\"$ProjectFileDir$\" cssDir=\"\" scriptDir=\"\" plainHtml=\"false\" imageDir=\"\" copyLinkedImages=\"false\" imageUniquifyType=\"0\" targetExt=\"\" useTargetExt=\"false\" noCssNoScripts=\"false\" linkToExportedHtml=\"true\" exportOnSettingsChange=\"true\" regenerateOnProjectOpen=\"false\" />\n    <LinkMapSettings>\n      <textMaps />\n    </LinkMapSettings>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" default=\"true\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n  <component name=\"masterDetails\">\n    <states>\n      <state key=\"ProjectJDKs.UI\">\n        <settings>\n          <last-edited>1.8</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"ScopeChooserConfigurable.UI\">\n        <settings>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n    </states>\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/AndroidFontMetrics.iml\" filepath=\"$PROJECT_DIR$/AndroidFontMetrics.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 suragch\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": "# Android FontMetrics\nAn Android app for measuring and testing FontMetrics\n\n![App preview](/Xi2UG.png?raw=true)\n\nThis app was originally created and used for these Stack Overflow questions:\n\n- http://stackoverflow.com/questions/27631736/meaning-of-top-ascent-baseline-descent-bottom-and-leading-in-androids-font\n- http://stackoverflow.com/a/42091739/\n\nI decided to put the project on GitHub to make it easier to experiment with, and also so that other people will improve it.\n\n## TODO\n\nIf you want to help, here are some improvements that are needed:\n- Color code the checkbox items and the lines in the custom view\n- Keyboard popping up when first entering app isn't necessary\n- Add a few custom (free) fonts and add an option to select different fonts.\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 25\n    buildToolsVersion \"25.0.2\"\n    defaultConfig {\n        applicationId \"net.studymongolian.fontmetrics\"\n        minSdkVersion 9\n        targetSdkVersion 25\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\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    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n    compile 'com.android.support:appcompat-v7:25.1.1'\n    testCompile 'junit:junit:4.12'\n}\n"
  },
  {
    "path": "app/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 /home/yonghu/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": "app/src/androidTest/java/net/studymongolian/fontmetrics/ExampleInstrumentedTest.java",
    "content": "package net.studymongolian.fontmetrics;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"net.studymongolian.fontmetrics\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"net.studymongolian.fontmetrics\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\" android:windowSoftInputMode=\"stateAlwaysHidden\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/net/studymongolian/fontmetrics/FontMetricsView.java",
    "content": "package net.studymongolian.fontmetrics;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.text.TextPaint;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.Toast;\n\n\npublic class FontMetricsView extends View {\n\n    public final static int DEFAULT_FONT_SIZE_PX = 200;\n    //private static final int PURPLE = Color.parseColor(\"#9315db\");\n    //private static final int ORANGE = Color.parseColor(\"#ff8a00\");\n    private static final float STROKE_WIDTH = 5.0f;\n\n    private String mText;\n    private int mTextSize;\n    private Paint mAscentPaint;\n    private Paint mTopPaint;\n    private Paint mBaselinePaint;\n    private Paint mDescentPaint;\n    private Paint mBottomPaint;\n    private Paint mMeasuredWidthPaint;\n    private Paint mTextBoundsPaint;\n    private TextPaint mTextPaint;\n    private Paint mLinePaint;\n    private Paint mRectPaint;\n    private Rect mBounds;\n    private boolean mIsTopVisible;\n    private boolean mIsAscentVisible;\n    private boolean mIsBaselineVisible;\n    private boolean mIsDescentVisible;\n    private boolean mIsBottomVisible;\n    private boolean mIsBoundsVisible;\n    private boolean mIsWidthVisible;\n\n\n    public FontMetricsView(Context context) {\n        super(context);\n        init();\n    }\n\n\n    public FontMetricsView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init();\n    }\n\n    private void init() {\n        mText = \"My text line\";\n        mTextSize = DEFAULT_FONT_SIZE_PX;\n        mTextPaint = new TextPaint();\n        mTextPaint.setAntiAlias(true);\n        mTextPaint.setTextSize(mTextSize);\n        mTextPaint.setColor(Color.BLACK);\n\n        mLinePaint = new Paint();\n        mLinePaint.setColor(Color.RED);\n        mLinePaint.setStrokeWidth(STROKE_WIDTH);\n\n        mAscentPaint = new Paint();\n        mAscentPaint.setColor(getResources().getColor(R.color.ascent));\n        mAscentPaint.setStrokeWidth(STROKE_WIDTH);\n\n        mTopPaint = new Paint();\n        mTopPaint.setColor(getResources().getColor(R.color.top));\n        mTopPaint.setStrokeWidth(STROKE_WIDTH);\n\n        mBaselinePaint = new Paint();\n        mBaselinePaint.setColor(getResources().getColor(R.color.baseline));\n        mBaselinePaint.setStrokeWidth(STROKE_WIDTH);\n\n        mBottomPaint = new Paint();\n        mBottomPaint.setColor(getResources().getColor(R.color.bottom));\n        mBottomPaint.setStrokeWidth(STROKE_WIDTH);\n\n        mDescentPaint = new Paint();\n        mDescentPaint.setColor(getResources().getColor(R.color.descent));\n        mDescentPaint.setStrokeWidth(STROKE_WIDTH);\n\n        mMeasuredWidthPaint = new Paint();\n        mMeasuredWidthPaint.setColor(getResources().getColor(R.color.measured_width));\n        mMeasuredWidthPaint.setStrokeWidth(STROKE_WIDTH);\n\n        mTextBoundsPaint = new Paint();\n        mTextBoundsPaint.setColor(getResources().getColor(R.color.text_bounds));\n        mTextBoundsPaint.setStrokeWidth(STROKE_WIDTH);\n        mTextBoundsPaint.setStyle(Paint.Style.STROKE);\n\n        mRectPaint = new Paint();\n        mRectPaint.setColor(Color.BLACK);\n        mRectPaint.setStrokeWidth(STROKE_WIDTH);\n        mRectPaint.setStyle(Paint.Style.STROKE);\n\n\n        mBounds = new Rect();\n\n        mIsTopVisible = true;\n        mIsAscentVisible = true;\n        mIsBaselineVisible = true;\n        mIsDescentVisible = true;\n        mIsBottomVisible = true;\n        mIsBoundsVisible = true;\n        mIsWidthVisible = true;\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n\n        // center the text baseline vertically\n        int verticalAdjustment = this.getHeight() / 2;\n        canvas.translate(0, verticalAdjustment);\n\n        float startX = getPaddingLeft();\n        float startY = 0;\n        float stopX = this.getMeasuredWidth();\n        float stopY = 0;\n\n        // draw text\n        canvas.drawText(mText, startX, startY, mTextPaint); // x=0, y=0\n\n        // draw lines\n        startX = 0;\n\n        if (mIsTopVisible) {\n            startY = mTextPaint.getFontMetrics().top;\n            stopY = startY;\n            canvas.drawLine(startX, startY, stopX, stopY, mTopPaint);\n        }\n\n        if (mIsAscentVisible) {\n            startY = mTextPaint.getFontMetrics().ascent;\n            stopY = startY;\n            //mLinePaint.setColor(Color.GREEN);\n            canvas.drawLine(startX, startY, stopX, stopY, mAscentPaint);\n        }\n\n        if (mIsBaselineVisible) {\n            startY = 0;\n            stopY = startY;\n            canvas.drawLine(startX, startY, stopX, stopY, mBaselinePaint);\n        }\n\n        if (mIsDescentVisible) {\n            startY = mTextPaint.getFontMetrics().descent;\n            stopY = startY;\n            //mLinePaint.setColor(Color.BLUE);\n            canvas.drawLine(startX, startY, stopX, stopY, mDescentPaint);\n        }\n\n        if (mIsBottomVisible) {\n            startY = mTextPaint.getFontMetrics().bottom;\n            stopY = startY;\n            // mLinePaint.setColor(ORANGE);\n            mLinePaint.setColor(Color.RED);\n            canvas.drawLine(startX, startY, stopX, stopY, mBaselinePaint);\n        }\n\n        if (mIsBoundsVisible) {\n\n            mTextPaint.getTextBounds(mText, 0, mText.length(), mBounds);\n            float dx = getPaddingLeft();\n            canvas.drawRect(mBounds.left + dx, mBounds.top, mBounds.right + dx, mBounds.bottom, mTextBoundsPaint);\n        }\n\n        if (mIsWidthVisible) {\n\n\n            // get measured width\n            float width = mTextPaint.measureText(mText);\n\n            // get bounding width so that we can compare them\n            mTextPaint.getTextBounds(mText, 0, mText.length(), mBounds);\n\n            // draw vertical line just before the left bounds\n            startX = getPaddingLeft() + mBounds.left - (width - mBounds.width()) / 2;\n            stopX = startX;\n            startY = -verticalAdjustment;\n            stopY = startY + this.getHeight();\n            canvas.drawLine(startX, startY, stopX, stopY, mMeasuredWidthPaint);\n\n            // draw vertical line just after the right bounds\n            startX = startX + width;\n            stopX = startX;\n            canvas.drawLine(startX, startY, stopX, stopY, mMeasuredWidthPaint);\n        }\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n        int width = 200;\n        int height = 200;\n\n        int widthMode = MeasureSpec.getMode(widthMeasureSpec);\n        int widthRequirement = MeasureSpec.getSize(widthMeasureSpec);\n        if (widthMode == MeasureSpec.EXACTLY) {\n            width = widthRequirement;\n        } else if (widthMode == MeasureSpec.AT_MOST && width > widthRequirement) {\n            width = widthRequirement;\n        }\n\n        int heightMode = MeasureSpec.getMode(heightMeasureSpec);\n        int heightRequirement = MeasureSpec.getSize(heightMeasureSpec);\n        if (heightMode == MeasureSpec.EXACTLY) {\n            height = heightRequirement;\n        } else if (heightMode == MeasureSpec.AT_MOST && width > heightRequirement) {\n            height = heightRequirement;\n        }\n\n        setMeasuredDimension(width, height);\n    }\n\n    // getters\n    public Paint.FontMetrics getFontMetrics() {\n        return mTextPaint.getFontMetrics();\n    }\n\n    public Rect getTextBounds() {\n        mTextPaint.getTextBounds(mText, 0, mText.length(), mBounds);\n        return mBounds;\n    }\n\n    public float getMeasuredTextWidth() {\n        return mTextPaint.measureText(mText);\n    }\n\n    // setters\n    public void setText(String text) {\n        mText = text;\n        invalidate();\n        requestLayout();\n    }\n\n    public void setTextSizeInPixels(int pixels) {\n        mTextSize = pixels;\n        mTextPaint.setTextSize(mTextSize);\n        invalidate();\n        requestLayout();\n    }\n\n    public void setTopVisible(boolean isVisible) {\n        mIsTopVisible = isVisible;\n        invalidate();\n    }\n\n    public void setAscentVisible(boolean isVisible) {\n        mIsAscentVisible = isVisible;\n        invalidate();\n    }\n\n    public void setBaselineVisible(boolean isVisible) {\n        mIsBaselineVisible = isVisible;\n        invalidate();\n    }\n\n    public void setDescentVisible(boolean isVisible) {\n        mIsDescentVisible = isVisible;\n        invalidate();\n    }\n\n    public void setBottomVisible(boolean isVisible) {\n        mIsBottomVisible = isVisible;\n        invalidate();\n    }\n\n    public void setBoundsVisible(boolean isVisible) {\n        mIsBoundsVisible = isVisible;\n        invalidate();\n    }\n\n    public void setWidthVisible(boolean isVisible) {\n        mIsWidthVisible = isVisible;\n        invalidate();\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/net/studymongolian/fontmetrics/MainActivity.java",
    "content": "package net.studymongolian.fontmetrics;\n\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.View;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.CheckBox;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\npublic class MainActivity extends AppCompatActivity implements View.OnClickListener{\n\n    FontMetricsView myFontMetricsView; // custom view\n    EditText mTextStringEditText;\n    EditText mFontSizeEditText;\n    CheckBox cbTop;\n    CheckBox cbAscent;\n    CheckBox cbBaseline;\n    CheckBox cbDescent;\n    CheckBox cbBottom;\n    CheckBox cbBounds;\n    CheckBox cbMeasuredWidth;\n\n    TextView tvTop;\n    TextView tvAscent;\n    TextView tvBaseline;\n    TextView tvDescent;\n    TextView tvBottom;\n    TextView tvBounds;\n    TextView tvMeasuredWidth;\n    TextView tvLeading;\n\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        myFontMetricsView = (FontMetricsView) findViewById(R.id.viewWindow);\n        mTextStringEditText = (EditText) findViewById(R.id.etTextString);\n        mFontSizeEditText = (EditText) findViewById(R.id.etFontSize);\n\n        mTextStringEditText.setText(\"My text line\");\n        mFontSizeEditText.setText(\"200\");\n\n\n        findViewById(R.id.updateButton).setOnClickListener(this);\n        cbTop = (CheckBox) findViewById(R.id.cbTop);\n        cbAscent = (CheckBox) findViewById(R.id.cbAscent);\n        cbBaseline = (CheckBox) findViewById(R.id.cbBaseline);\n        cbDescent = (CheckBox) findViewById(R.id.cbDescent);\n        cbBottom = (CheckBox) findViewById(R.id.cbBottom);\n        cbBounds = (CheckBox) findViewById(R.id.cbTextBounds);\n        cbMeasuredWidth = (CheckBox) findViewById(R.id.cbWidth);\n\n        cbTop.setOnClickListener(this);\n        cbAscent.setOnClickListener(this);\n        cbBaseline.setOnClickListener(this);\n        cbDescent.setOnClickListener(this);\n        cbBottom.setOnClickListener(this);\n        cbBounds.setOnClickListener(this);\n        cbMeasuredWidth.setOnClickListener(this);\n\n        tvTop = (TextView) findViewById(R.id.tvTop);\n        tvAscent = (TextView) findViewById(R.id.tvAscent);\n        tvBaseline = (TextView) findViewById(R.id.tvBaseline);\n        tvDescent = (TextView) findViewById(R.id.tvDescent);\n        tvBottom = (TextView) findViewById(R.id.tvBottom);\n        tvBounds = (TextView) findViewById(R.id.tvTextBounds);\n        tvMeasuredWidth = (TextView) findViewById(R.id.tvWidth);\n        tvLeading = (TextView) findViewById(R.id.tvLeadingValue);\n        updateTextViews();\n\n    }\n\n\n\n    @Override\n    public void onClick(View v) {\n\n        switch (v.getId()) {\n            case R.id.updateButton:\n                myFontMetricsView.setText(mTextStringEditText.getText().toString());\n                int fontSize;\n                try {\n                    fontSize = Integer.valueOf(mFontSizeEditText.getText().toString());\n                }catch (NumberFormatException e) {\n                    fontSize = FontMetricsView.DEFAULT_FONT_SIZE_PX;\n                }\n                myFontMetricsView.setTextSizeInPixels(fontSize);\n                updateTextViews();\n                hideKeyboard(getCurrentFocus());\n                break;\n            case R.id.cbTop:\n                myFontMetricsView.setTopVisible(cbTop.isChecked());\n                break;\n            case R.id.cbAscent:\n                myFontMetricsView.setAscentVisible(cbAscent.isChecked());\n                break;\n            case R.id.cbBaseline:\n                myFontMetricsView.setBaselineVisible(cbBaseline.isChecked());\n                break;\n            case R.id.cbDescent:\n                myFontMetricsView.setDescentVisible(cbDescent.isChecked());\n                break;\n            case R.id.cbBottom:\n                myFontMetricsView.setBottomVisible(cbBottom.isChecked());\n                break;\n            case R.id.cbTextBounds:\n                myFontMetricsView.setBoundsVisible(cbBounds.isChecked());\n                break;\n            case R.id.cbWidth:\n                myFontMetricsView.setWidthVisible(cbMeasuredWidth.isChecked());\n                break;\n        }\n\n\n    }\n\n    public void updateTextViews() {\n        tvTop.setText(String.valueOf(myFontMetricsView.getFontMetrics().top));\n        tvAscent.setText(String.valueOf(myFontMetricsView.getFontMetrics().ascent));\n        tvBaseline.setText(String.valueOf(0f));\n        tvDescent.setText(String.valueOf(myFontMetricsView.getFontMetrics().descent));\n        tvBottom.setText(String.valueOf(myFontMetricsView.getFontMetrics().bottom));\n        tvBounds.setText(\"w = \" + String.valueOf(myFontMetricsView.getTextBounds().width() +\n                \"     h = \" + String.valueOf(myFontMetricsView.getTextBounds().height())));\n        tvMeasuredWidth.setText(String.valueOf(myFontMetricsView.getMeasuredTextWidth()));\n        tvLeading.setText(String.valueOf(myFontMetricsView.getFontMetrics().leading));\n    }\n\n    private void hideKeyboard(View view) {\n        if (view != null) {\n            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n            imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/activity_main\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    tools:context=\"net.studymongolian.fontmetrics.MainActivity\">\n\n\n    <net.studymongolian.fontmetrics.FontMetricsView\n        android:id=\"@+id/viewWindow\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"150dp\"\n        android:background=\"@android:color/white\"\n        android:padding=\"20dp\"/>\n\n    <ScrollView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_below=\"@id/viewWindow\">\n\n        <RelativeLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\">\n\n            <LinearLayout\n                android:id=\"@+id/contentLayout\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"horizontal\">\n\n                <EditText\n                    android:id=\"@+id/etTextString\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginBottom=\"20dp\"\n                    android:layout_weight=\"0.5\"\n                    android:hint=\"My text line\"/>\n\n                <Button\n                    android:id=\"@+id/updateButton\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"0.25\"\n                    android:text=\"Update text\"/>\n\n                <EditText\n                    android:id=\"@+id/etFontSize\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"0.25\"\n                    android:hint=\"17\"\n                    android:inputType=\"number\"/>\n            </LinearLayout>\n\n\n            <CheckBox\n                android:id=\"@+id/cbTop\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/contentLayout\"\n                android:checked=\"true\"\n                android:text=\"Top\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n            <TextView\n                android:id=\"@+id/tvTop\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbTop\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <CheckBox\n                android:id=\"@+id/cbAscent\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbTop\"\n                android:checked=\"true\"\n                android:text=\"Ascent\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n\n                android:theme=\"@style/Theme.AppCompat.CheckBoxAscent\"/>\n\n            <TextView\n                android:id=\"@+id/tvAscent\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbAscent\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <CheckBox\n                android:id=\"@+id/cbBaseline\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbAscent\"\n                android:checked=\"true\"\n                android:text=\"Baseline\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:theme=\"@style/Theme.AppCompat.CheckboxBaseline\"/>\n\n            <TextView\n                android:id=\"@+id/tvBaseline\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbBaseline\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <CheckBox\n                android:id=\"@+id/cbDescent\"\n\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbBaseline\"\n                android:checked=\"true\"\n                android:text=\"Descent\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:theme=\"@style/Theme.AppCompat.CheckboxDescent\"/>\n\n            <TextView\n                android:id=\"@+id/tvDescent\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbDescent\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <CheckBox\n                android:id=\"@+id/cbBottom\"\n                android:theme=\"@style/Theme.AppCompat.CheckboxBottom\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbDescent\"\n                android:checked=\"true\"\n                android:text=\"Bottom\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n            <TextView\n                android:id=\"@+id/tvBottom\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbBottom\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <CheckBox\n                android:id=\"@+id/cbWidth\"\n                android:theme=\"@style/Theme.AppCompat.MeasuerdWidth\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbBottom\"\n                android:checked=\"true\"\n                android:text=\"Measured width\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n            <TextView\n                android:id=\"@+id/tvWidth\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbWidth\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <CheckBox\n                android:id=\"@+id/cbTextBounds\"\n                android:theme=\"@style/Theme.AppCompat.TextBounds\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbWidth\"\n                android:checked=\"true\"\n                android:text=\"Text bounds\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n            <TextView\n                android:id=\"@+id/tvTextBounds\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/cbTextBounds\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n\n            <TextView\n                android:id=\"@+id/tvLeadingLabel\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_below=\"@id/cbTextBounds\"\n                android:layout_marginLeft=\"33dp\"\n                android:layout_marginTop=\"10dp\"\n                android:text=\"Leading\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/white\"/>\n\n            <TextView\n                android:id=\"@+id/tvLeadingValue\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBaseline=\"@id/tvLeadingLabel\"\n                android:layout_marginLeft=\"110dp\"\n                android:layout_toRightOf=\"@id/cbTop\"\n                android:text=\"10\"\n                android:textAppearance=\"?android:attr/textAppearanceMedium\"\n                android:textColor=\"@android:color/darker_gray\"/>\n        </RelativeLayout>\n\n\n    </ScrollView>\n\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n\n    <!-- Font Metrics-->\n    <color name=\"ascent\">#21ff12</color>\n\n\n    <color name=\"top\">#ff1b01</color>\n    <color name=\"baseline\">#ac1230</color>\n    <color name=\"descent\">#04f</color>\n    <color name=\"bottom\">#78129f</color>\n    <color name=\"measured_width\">#bc12ff</color>\n    <color name=\"text_bounds\">#b17290</color>\n\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">FontMetrics</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n    \n    <style name=\"Theme.AppCompat.CheckBoxAscent\">\n        <item name=\"colorControlActivated\">@color/ascent</item>\n    </style>\n\n\n    <style name=\"Theme.AppCompat.CheckboxTop\">\n        <item name=\"colorControlActivated\">@color/top</item>\n    </style>\n    <style name=\"Theme.AppCompat.CheckboxBaseline\">\n        <item name=\"colorControlActivated\">@color/baseline</item>\n    </style>\n    <style name=\"Theme.AppCompat.CheckboxDescent\">\n        <item name=\"colorControlActivated\">@color/descent</item>\n    </style>\n    <style name=\"Theme.AppCompat.CheckboxBottom\">\n        <item name=\"colorControlActivated\">@color/bottom</item>\n    </style>\n    <style name=\"Theme.AppCompat.MeasuerdWidth\">\n        <item name=\"colorControlActivated\">@color/measured_width</item>\n    </style>\n    <style name=\"Theme.AppCompat.TextBounds\">\n        <item name=\"colorControlActivated\">@color/text_bounds</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/test/java/net/studymongolian/fontmetrics/ExampleUnitTest.java",
    "content": "package net.studymongolian.fontmetrics;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\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:2.3.3'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Thu Jul 27 06:31:54 CST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-3.3-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\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": "settings.gradle",
    "content": "include ':app'\n"
  }
]