Repository: AhmadNemati/WindView
Branch: master
Commit: 7507cfc8b205
Files: 48
Total size: 80.9 KB
Directory structure:
gitextract__b55n19i/
├── .gitignore
├── .idea/
│ ├── compiler.xml
│ ├── copyright/
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── markdown-navigator/
│ │ └── profiles_settings.xml
│ ├── markdown-navigator.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── vcs.xml
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── demo.apk
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── com/
│ │ └── example/
│ │ └── windview/
│ │ └── ExampleInstrumentedTest.java
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── example/
│ │ │ └── windview/
│ │ │ ├── CustomRadioButton.java
│ │ │ └── MainActivity.java
│ │ └── res/
│ │ ├── layout/
│ │ │ ├── activity_main.xml
│ │ │ └── dropdown_item.xml
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-v21/
│ │ │ └── styles.xml
│ │ └── values-w820dp/
│ │ └── dimens.xml
│ └── test/
│ └── java/
│ └── com/
│ └── example/
│ └── windview/
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── windview/
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src/
├── androidTest/
│ └── java/
│ └── com/
│ └── github/
│ └── ahmadnemati/
│ └── wind/
│ └── ExampleInstrumentedTest.java
├── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── github/
│ │ └── ahmadnemati/
│ │ └── wind/
│ │ ├── WindView.java
│ │ └── enums/
│ │ └── TrendType.java
│ └── res/
│ └── values/
│ ├── attrs.xml
│ ├── colors.xml
│ └── strings.xml
└── test/
└── java/
└── com/
└── github/
└── ahmadnemati/
└── wind/
└── ExampleUnitTest.java
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
================================================
FILE: .idea/compiler.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
================================================
FILE: .idea/copyright/profiles_settings.xml
================================================
<component name="CopyrightManager">
<settings default="" />
</component>
================================================
FILE: .idea/encodings.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
================================================
FILE: .idea/gradle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/windview" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
================================================
FILE: .idea/markdown-navigator/profiles_settings.xml
================================================
<component name="MarkdownNavigator.ProfileManager">
<settings default="" />
</component>
================================================
FILE: .idea/markdown-navigator.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownProjectSettings">
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true">
<PanelProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
</PanelProvider>
</PreviewSettings>
<ParserSettings>
<PegdownExtensions>
<option name="ABBREVIATIONS" value="false" />
<option name="ANCHORLINKS" value="true" />
<option name="ATXHEADERSPACE" value="true" />
<option name="AUTOLINKS" value="true" />
<option name="DEFINITIONS" value="false" />
<option name="FENCED_CODE_BLOCKS" value="true" />
<option name="FOOTNOTES" value="false" />
<option name="FORCELISTITEMPARA" value="false" />
<option name="HARDWRAPS" value="false" />
<option name="QUOTES" value="false" />
<option name="RELAXEDHRULES" value="true" />
<option name="SMARTS" value="false" />
<option name="STRIKETHROUGH" value="true" />
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
<option name="SUPPRESS_INLINE_HTML" value="false" />
<option name="TABLES" value="true" />
<option name="TASKLISTITEMS" value="true" />
<option name="TOC" value="false" />
<option name="TRACE_PARSER" value="false" />
<option name="WIKILINKS" value="true" />
</PegdownExtensions>
<ParserOptions>
<option name="COMMONMARK_LISTS" value="false" />
<option name="DUMMY" value="false" />
<option name="EMOJI_SHORTCUTS" value="true" />
<option name="FLEXMARK_FRONT_MATTER" value="false" />
<option name="GFM_TABLE_RENDERING" value="true" />
<option name="GITBOOK_URL_ENCODING" value="false" />
<option name="GITHUB_EMOJI_URL" value="false" />
<option name="GITHUB_LISTS" value="true" />
<option name="GITHUB_WIKI_LINKS" value="true" />
<option name="JEKYLL_FRONT_MATTER" value="false" />
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
</ParserOptions>
</ParserSettings>
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
<GeneratorProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
</GeneratorProvider>
<headerTop />
<headerBottom />
<bodyTop />
<bodyBottom />
</HtmlSettings>
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
<StylesheetProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
</StylesheetProvider>
<ScriptProviders />
<cssText />
</CssSettings>
<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" />
<LinkMapSettings>
<textMaps />
</LinkMapSettings>
</component>
</project>
================================================
FILE: .idea/misc.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<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.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/WindView.iml" filepath="$PROJECT_DIR$/WindView.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/windview/windview.iml" filepath="$PROJECT_DIR$/windview/windview.iml" />
</modules>
</component>
</project>
================================================
FILE: .idea/runConfigurations.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
[](http://www.apache.org/licenses/LICENSE-2.0)


[](https://jitpack.io/#jitpack/android-example)
[](https://android-arsenal.com)
# WindView
WindView is an Android Library to show Weather's Wind & pressure Status
# Screenshot

# Demo
- [**demo.apk**](https://raw.githubusercontent.com/AhmadNemati/WindView/master/app/demo.apk)
# Setup
# Step 1: Add it as a Dependency in Your Root's `build.gradle` File
```gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
```
- add this to your app `build.gradle`:
```gradle
dependencies {
compile 'com.github.AhmadNemati:WindView:1.1.1'
}
```
# Step 2: Add it to your Layout
```xml
<com.github.ahmadnemati.wind.WindView
android:id="@+id/windview"
android:layout_width="match_parent"
android:layout_height="106dp"
app:barometerTickSpacing="9dp"
app:bigPoleX="38dp"
app:labelFontSize="12sp"
app:numericFontSize="25sp"
app:poleBottomY="98dp"
app:pressureLineY="73dp"
app:pressureTextX="12dp"
app:pressureTextY="4dp"
app:smallPoleX="75dp"
app:windTextX="10dp"
app:windTextY="29dp" />
```
# Step 3: Initialize WindView and Start it
```java
WindView windView= (WindView) findViewById(R.id.windview);
windView.setPressure(20);
windView.setPressureUnit("in Hg");
windView.setWindSpeed(1);
windView.setWindSpeedUnit(" km/h");
windView.setTrendType(TrendType.UP);
windView.start();
```
# Note
Graphical implementations are based on Yahoo Weather Service
# Developed By
* Ahmad Nemati
* [ahmadnemati.com](http://ahmadnemati.com) - <nematiprog@gmail.com>
# License
Copyright 2016 Ahmad Nemati
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.windview"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.mikepenz:materialize:1.0.0@aar'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
testImplementation 'junit:junit:4.12'
implementation project(':windview')
}
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: app/src/androidTest/java/com/example/windview/ExampleInstrumentedTest.java
================================================
package com.example.windview;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.windview", appContext.getPackageName());
}
}
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.windview">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:theme="@style/AppTheme.NoActionBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
================================================
FILE: app/src/main/java/com/example/windview/CustomRadioButton.java
================================================
package com.example.windview;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.widget.RadioButton;
/**
* Created by Ahmad Nemati on 12/25/2016.
*/
public class CustomRadioButton extends android.support.v7.widget.AppCompatRadioButton {
public CustomRadioButton(Context context) {
super(context);
}
public CustomRadioButton(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomRadioButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean isChecked() {
return super.isChecked();
}
@Override
public void setChecked(boolean checked) {
if (checked)
setTextColor(Color.WHITE);
else
setTextColor(Color.BLACK);
super.setChecked(checked);
}
}
================================================
FILE: app/src/main/java/com/example/windview/MainActivity.java
================================================
package com.example.windview;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatSpinner;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.RadioGroup;
import android.widget.SeekBar;
import com.github.ahmadnemati.wind.WindView;
import com.github.ahmadnemati.wind.enums.TrendType;
import com.mikepenz.materialize.MaterializeBuilder;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener, RadioGroup.OnCheckedChangeListener, View.OnClickListener {
@BindView(R.id.windview)
WindView windView;
@BindView(R.id.wind_speed)
SeekBar windSpeed;
@BindView(R.id.pressure)
SeekBar pressureSpeed;
@BindView(R.id.barometr_size)
SeekBar barometreSize;
@BindView(R.id.wind_unit)
AppCompatSpinner windUnit;
@BindView(R.id.radio_group)
RadioGroup radioGroup;
@BindView(R.id.pressure_unit)
AppCompatSpinner pressureUnit;
@BindView(R.id.animate)
Button animateBaroMeter;
@BindView(R.id.linebar)
SeekBar line;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
materialize();
setupWindView();
initSpinner();
initSeekBars();
initRadioButton();
}
private void initRadioButton() {
radioGroup.setOnCheckedChangeListener(this);
}
private void setupWindView() {
animateBaroMeter.setOnClickListener(this);
windView.setPressure(20);
windView.setPressureUnit("in Hg");
windView.setWindSpeed(1);
windView.setWindSpeedUnit(" km/h");
windView.setTrendType(TrendType.UP);
windView.start();
}
private void initSeekBars() {
windSpeed.setOnSeekBarChangeListener(this);
pressureSpeed.setOnSeekBarChangeListener(this);
barometreSize.setOnSeekBarChangeListener(this);
line.setOnSeekBarChangeListener(this);
}
private void materialize() {
new MaterializeBuilder()
.withActivity(this)
.withFullscreen(true)
.withTranslucentStatusBarProgrammatically(false)
.withTintedStatusBar(false).build();
}
private void initSpinner() {
List<String> windUnits = new ArrayList<>();
windUnits.add("km/h");
windUnits.add("ft/s");
windUnits.add("m/s");
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,
R.layout.dropdown_item, windUnits);
windUnit.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
windView.setWindSpeedUnit("" + adapterView.getAdapter().getItem(i).toString());
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
windUnit.setAdapter(arrayAdapter);
List<String> pressureUnits = new ArrayList<>();
pressureUnits.add("Hg");
pressureUnits.add("Pa");
pressureUnits.add("hPa");
ArrayAdapter<String> arrayAdapter2 = new ArrayAdapter<String>(this,
R.layout.dropdown_item, pressureUnits);
pressureUnit.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
windView.setPressureUnit("in " + adapterView.getAdapter().getItem(i).toString());
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
pressureUnit.setAdapter(arrayAdapter2);
}
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
switch (seekBar.getId()) {
case R.id.wind_speed:
windView.setWindSpeed(i);
break;
case R.id.pressure:
windView.setPressure(i);
break;
case R.id.barometr_size:
windView.setBarometerStrokeWidth(i);
break;
case R.id.linebar:
windView.setLineStrokeWidth(i);
break;
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
switch (radioGroup.getCheckedRadioButtonId()) {
case R.id.rv_up:
windView.setTrendType(TrendType.UP);
windView.start();
break;
case R.id.rv_down:
windView.setTrendType(TrendType.DOWN);
windView.start();
break;
case R.id.rv_none:
windView.setTrendType(TrendType.NONE);
windView.start();
break;
}
}
@Override
public void onClick(View view) {
Log.e("Click", "Clicked");
windView.animateBaroMeter();
}
@Override
protected void onPause() {
super.onPause();
windView.stop();
}
@Override
protected void onResume() {
super.onResume();
windView.start();
}
}
================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="25dp" />
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginTop="25dp"
app:cardBackgroundColor="#11607d8b"
app:cardCornerRadius="4dp"
app:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<com.github.ahmadnemati.wind.WindView
android:id="@+id/windview"
android:layout_width="match_parent"
android:layout_height="106dp"
app:barometerTickSpacing="9dp"
app:bigPoleX="38dp"
app:labelFontSize="12sp"
app:numericFontSize="25sp"
app:poleBottomY="98dp"
app:pressureLineY="73dp"
app:pressureTextX="12dp"
app:pressureTextY="4dp"
app:smallPoleX="75dp"
app:windTextX="10dp"
app:windTextY="29dp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="25dp"
app:cardBackgroundColor="#11607d8b"
app:cardCornerRadius="4dp"
app:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_weather_windy_black_36dp"
android:tint="#ffffff" />
<SeekBar
android:id="@+id/wind_speed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="35"
android:progress="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_chart_areaspline_black_36dp"
android:tint="#ffffff" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/wind_unit"
style="@style/Widget.AppCompat.DropDownItem.Spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_weather_windy_variant_black_36dp"
android:tint="#ffffff" />
<SeekBar
android:id="@+id/barometr_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="20"
android:progress="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_animation_black_36dp"
android:tint="#ffffff" />
<Button
android:id="@+id/animate"
style="@style/AppTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:text="Animate Barometer"
android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_trending_down_black_36dp"
android:tint="#ffffff" />
<RadioGroup
android:id="@+id/radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:orientation="horizontal">
<com.example.windview.CustomRadioButton
android:id="@+id/rv_up"
style="@style/Widget.AppCompat.CompoundButton.RadioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:gravity="center_vertical"
android:text="UP"
android:textColor="#424242" />
<com.example.windview.CustomRadioButton
android:id="@+id/rv_down"
style="@style/Widget.AppCompat.CompoundButton.RadioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="DOWN"
android:textColor="#424242" />
<com.example.windview.CustomRadioButton
android:id="@+id/rv_none"
style="@style/Base.Widget.AppCompat.CompoundButton.RadioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="NONE"
android:textColor="#424242" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_arrow_compress_black_36dp"
android:tint="#ffffff" />
<SeekBar
android:id="@+id/pressure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="100"
android:progress="20" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="@drawable/ic_arrow_compress_all_black_36dp"
android:tint="#ffffff" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/pressure_unit"
style="@style/Widget.AppCompat.DropDownItem.Spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/ic_dots_horizontal_black_36dp"
android:tint="#ffffff" />
<SeekBar
android:id="@+id/linebar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="15"
android:progress="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</android.support.v7.widget.CardView>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/dropdown_item.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/dropDownItemStyle"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:ellipsize="marquee"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
android:textColor="#000000" />
================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#ffffff</color>
</resources>
================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
</resources>
================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
<string name="app_name">WindView</string>
</resources>
================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">#ffffff</item>
<item name="colorButtonNormal">#ffffff</item>
<item name="colorControlHighlight">#9E9E9E</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
================================================
FILE: app/src/main/res/values-v21/styles.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
================================================
FILE: app/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
</resources>
================================================
FILE: app/src/test/java/com/example/windview/ExampleUnitTest.java
================================================
package com.example.windview;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Sat Aug 11 10:03:44 IRDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
================================================
FILE: gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: settings.gradle
================================================
include ':app', ':windview'
================================================
FILE: windview/.gitignore
================================================
/build
================================================
FILE: windview/build.gradle
================================================
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
group = 'com.github.AhmadNemati'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
}
================================================
FILE: windview/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: windview/src/androidTest/java/com/github/ahmadnemati/wind/ExampleInstrumentedTest.java
================================================
package com.github.ahmadnemati.wind;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.github.ahmadnemati.wind.test", appContext.getPackageName());
}
}
================================================
FILE: windview/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.ahmadnemati.wind">
<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">
</application>
</manifest>
================================================
FILE: windview/src/main/java/com/github/ahmadnemati/wind/WindView.java
================================================
package com.github.ahmadnemati.wind;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathEffect;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import com.github.ahmadnemati.wind.enums.TrendType;
import java.math.BigDecimal;
import java.text.NumberFormat;
/**
* Created by َAhmad Nemati on 12/19/2016.
*/
public class WindView extends View {
private static final String TAG = WindView.class.getSimpleName();
private Rect rect = new Rect();
private Path path;
private Matrix matrix;
private Paint paint;
private int textColor;
private String WindDirectionText;
private long startTime = 0;
private PathEffect pathEffect;
private Bitmap smallPoleBitmap;
private Bitmap bigPoleBitmap;
private Bitmap smallBladeBitmap;
private Bitmap bigBladeBitmap;
private Bitmap trendBitmap;
private float rotation;
private int bigPoleX;
private int smallPoleX;
private String windText = "Wind";
private String windName;
private String windSpeedText;
private String barometerText = "Barometer";
private int poleBottomY;
private int windTextX;
private int windTextY;
private float windSpeed;
private String windSpeedUnit;
private boolean animationEnable = true;
private boolean animationBaroMeterEnable = false;
private float pressurePaddingTop;
private double senterOfPressureLine;
private double pressureLineSize;
private int scale;
private float barometerTickSpacing;
private double lineSpace;
private float pressure;
private String pressureText;
private float lineSize;
private float curSize;
private int pressureTextY;
private String pressureUnit;
private int labelFontSize;
private int numericFontSize;
private Typeface typeface;
private String empty = "--";
private TrendType trendType = TrendType.UP;
private int lineColor = Color.WHITE;
private float lineStrokeWidth = 1f;
private int barometerColor = Color.WHITE;
private float barometerStrokeWidth = 2f;
public WindView(Context context) {
super(context);
setupView();
}
public WindView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
public WindView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(attrs);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public WindView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(attrs);
}
public static String getTAG() {
return TAG;
}
private void init(AttributeSet attrs) {
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attrs, R.styleable.WindView);
pressure = obtainStyledAttributes.getFloat(R.styleable.WindView_pressure, -1.0f);
windTextX = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_windTextX, 242);
windTextY = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_windTextY, 44);
pressureTextY = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_pressureTextY, 8);
labelFontSize = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_labelFontSize, 18);
numericFontSize = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_numericFontSize, 14);
barometerTickSpacing = (float) obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_barometerTickSpacing, 9);
bigPoleX = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_bigPoleX, 48);
smallPoleX = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_smallPoleX, 98);
poleBottomY = obtainStyledAttributes.getDimensionPixelSize(R.styleable.WindView_poleBottomY, 118);
scale = getScaleInPixel(20);
obtainStyledAttributes.recycle();
setupView();
}
private void setupView() {
Resources resources = getContext().getResources();
textColor = resources.getColor(R.color.text_color);
paint = new Paint();
paint.setAntiAlias(true);
paint.setTypeface(getTypeface());
paint.setStyle(Paint.Style.FILL);
smallPoleBitmap = BitmapFactory.decodeResource(resources, R.drawable.smallpole);
bigPoleBitmap = BitmapFactory.decodeResource(resources, R.drawable.bigpole);
smallBladeBitmap = BitmapFactory.decodeResource(resources, R.drawable.smallblade);
bigBladeBitmap = BitmapFactory.decodeResource(resources, R.drawable.bigblade);
matrix = new Matrix();
WindDirectionText = "";
lineColor = Color.parseColor("#8bece8e8");
rotation = 0.0f;
lineSpace = toPixel(1d);
pressureLineSize = lineSpace + (barometerTickSpacing);
senterOfPressureLine = (9d * pressureLineSize) + lineSpace;
pressurePaddingTop = getPaddingTop();
pathEffect = new DashPathEffect(new float[]{4f, 4f}, 0f);
}
public void start() {
animationEnable = true;
invalidate();
}
public void stop() {
animationEnable = false;
}
public void setWindSpeed(float f) {
windSpeed = f;
if (windSpeed >= 36.0f && animationEnable) {
if (smallBladeBitmap != null) {
smallBladeBitmap.recycle();
}
if (bigBladeBitmap != null) {
bigBladeBitmap.recycle();
}
smallBladeBitmap = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.blade_s_blur);
bigBladeBitmap = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.blade_big_blur);
}
windSpeedText = formatFloat(windSpeed);
initSpeedUnit();
invalidate();
}
public void setWindDirection(String str) {
WindDirectionText = str;
initSpeedUnit();
}
private void initSpeedUnit() {
StringBuilder stringBuilder = new StringBuilder();
if (windSpeed < 0.0f || windSpeedUnit == null) {
stringBuilder.append(empty);
} else {
stringBuilder.append(" ").append(windSpeedUnit).append(" ").append(WindDirectionText);
}
windName = stringBuilder.toString();
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
setupPressureLine(false);
}
@Override
protected void onDraw(Canvas canvas) {
initCanvas(canvas);
}
private void initCanvas(Canvas canvas) {
boolean enable = false;
if (bigPoleBitmap != null && smallBladeBitmap != null && bigBladeBitmap != null) {
paint.setColor(textColor);
paint.setTypeface(typeface);
canvas.drawBitmap(bigPoleBitmap, bigPoleX, (poleBottomY - bigPoleBitmap.getHeight()), paint);
canvas.drawBitmap(smallPoleBitmap, smallPoleX, (poleBottomY - smallPoleBitmap.getHeight()), paint);
if (animationEnable) {
startTimes();
}
int width = bigPoleX + (bigPoleBitmap.getWidth() / 2);
int height = (poleBottomY - bigPoleBitmap.getHeight()) - 4;
rect.left = width - (bigBladeBitmap.getWidth() / 2);
rect.top = height - (bigBladeBitmap.getHeight() / 2);
rect.bottom = (bigBladeBitmap.getHeight() / 2) + height;
matrix.reset();
matrix.setRotate(rotation, (bigBladeBitmap.getWidth()) / 2.0f, (bigBladeBitmap.getHeight()) / 2.0f);
matrix.postTranslate((width - (bigBladeBitmap.getWidth() / 2)), (height - (bigBladeBitmap.getHeight() / 2)));
canvas.drawBitmap(bigBladeBitmap, matrix, paint);
width = smallPoleX + (smallPoleBitmap.getWidth() / 2);
int height2 = (poleBottomY - smallPoleBitmap.getHeight()) - 4;
rect.right = (smallBladeBitmap.getWidth() / 2) + width;
rect.bottom = Math.max(rect.bottom, height + (smallBladeBitmap.getHeight() / 2));
matrix.reset();
matrix.setRotate(rotation, (smallBladeBitmap.getWidth()) / 2.0f, (smallBladeBitmap.getHeight()) / 2.0f);
matrix.postTranslate((width - (smallBladeBitmap.getWidth() / 2)), (height2 - (smallBladeBitmap.getHeight() / 2)));
canvas.drawBitmap(smallBladeBitmap, matrix, paint);
drawWind(canvas);
drawBarometer(canvas);
if (!animationEnable) {
curSize = lineSize;
}
drawLine(canvas);
drawPressure(canvas);
if (trendType == TrendType.DOWN && curSize < lineSize && animationBaroMeterEnable) {
curSize += 1.0f;
enable = true;
} else if (trendType == TrendType.UP && curSize > lineSize && animationBaroMeterEnable) {
curSize -= 1.0f;
enable = true;
} else {
animationBaroMeterEnable = false;
}
if ((animationEnable && windSpeed > 0.0f) || enable) {
invalidate();
}
}
}
private void drawLine(Canvas canvas) {
paint.setColor(lineColor);
paint.setStrokeWidth(lineStrokeWidth);
paint.setStyle(Paint.Style.STROKE);
paint.setPathEffect(pathEffect);
float width = (float) getWidth();
if (path == null) {
path = new Path();
} else {
path.reset();
}
path.moveTo(10.0f, curSize);
path.quadTo(width / 2.0f, curSize, width - 20.0f, curSize);
canvas.drawPath(path, paint);
paint.setStyle(Paint.Style.FILL);
paint.setPathEffect(null);
paint.setColor(textColor);
}
private void setupPressureLine(boolean z) {
int height = getHeight();
if (height > 0) {
if ((senterOfPressureLine + (getPaddingTop())) + (getPaddingBottom()) >= (height)) {
senterOfPressureLine = ((height - getPaddingTop()) - getPaddingBottom());
pressureLineSize = senterOfPressureLine / 10.0d;
}
pressurePaddingTop = (float) ((((height - getPaddingTop()) / 2)) - (senterOfPressureLine / 2.0d));
float f = (float) (((pressurePaddingTop) + (pressureLineSize * 5.0d)) + lineSpace);
if (z) {
lineSize = f;
curSize = lineSize;
} else if (trendType == TrendType.DOWN) {
lineSize = (float) (((pressurePaddingTop) + (pressureLineSize * 5.0d)) + lineSpace);
if (animationBaroMeterEnable) {
curSize = (float) (((pressurePaddingTop) + (pressureLineSize * 7.0d)) + lineSpace);
} else {
curSize = lineSize;
}
trendBitmap = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.trend_falling);
} else if (trendType == TrendType.UP) {
lineSize = (float) (((pressurePaddingTop) + (pressureLineSize * 5.0d)) + lineSpace);
if (animationBaroMeterEnable) {
curSize = (float) (((pressurePaddingTop) + (pressureLineSize * 7.0d)) + lineSpace);
} else {
curSize = lineSize;
}
trendBitmap = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.trend_rising);
} else {
lineSize = f;
curSize = lineSize;
if (trendBitmap != null) {
trendBitmap.recycle();
trendBitmap = null;
}
}
}
}
private void drawWind(Canvas canvas) {
paint.setTextSize(labelFontSize);
paint.setStyle(Paint.Style.FILL);
paint.setPathEffect(null);
float width = (((smallPoleX) + ((smallBladeBitmap.getWidth()) / 2.0f)) + windTextX);
canvas.drawText(windText, width, windTextY, paint);
if (windSpeed < 0.0f) {
paint.setTextSize(labelFontSize);
canvas.drawText(windName, width, (windTextY + labelFontSize), paint);
} else if (!stringValid(windSpeedText)) {
paint.setTextSize(numericFontSize);
canvas.drawText(windSpeedText, width, (windTextY + numericFontSize), paint);
if (!stringValid(windName)) {
paint.setTextSize(labelFontSize);
canvas.drawText(windName, width + (((windSpeedText.length() * numericFontSize)) / 2.0f), (windTextY + numericFontSize), paint);
}
}
}
private void drawPressure(Canvas canvas) {
float f = curSize + (pressureTextY);
int width = (getWidth() - 14) - scale;
paint.setTextSize(labelFontSize);
float measureText = (width - (paint.measureText(barometerText)));
f += labelFontSize;
canvas.drawText(barometerText, measureText, f, paint);
if (trendBitmap != null) {
canvas.drawBitmap(trendBitmap, (measureText - (trendBitmap.getWidth())) - 4.0f, f - ((labelFontSize / 2)), paint);
}
if (!TextUtils.isEmpty(pressureUnit)) {
paint.setTextSize((float) labelFontSize);
measureText = (float) (width - ((int) paint.measureText(pressureUnit)));
f += (float) numericFontSize;
canvas.drawText(pressureUnit, measureText, f, paint);
}
if (!TextUtils.isEmpty(pressureText)) {
paint.setTextSize((float) numericFontSize);
canvas.drawText(pressureText, measureText - ((((paint.measureText(pressureText)) + 4)) + ((paint.measureText(" ")))), f, paint);
}
}
private void startTimes() {
long nanoTime = System.nanoTime();
float f = ((float) (nanoTime - startTime)) / 1000000.0f;
startTime = nanoTime;
rotation = ((float) ((Math.sqrt((double) windSpeed) * (f)) / 20.0d)) + rotation;
rotation %= 360.0f;
}
private void drawBarometer(Canvas canvas) {
paint.setStrokeWidth(barometerStrokeWidth);
paint.setColor(barometerColor);
paint.setStyle(Paint.Style.FILL);
int width = getWidth();
float f = pressurePaddingTop;
for (int i = 0; i < 10; i++) {
canvas.drawLine((float) ((width) - toPixel(5d)), f, width, f, paint);
f = (float) ((f) + (lineSpace + (barometerTickSpacing)));
}
paint.setColor(textColor);
}
public void animateBaroMeter() {
if (!animationBaroMeterEnable) {
animationBaroMeterEnable = true;
setupPressureLine(false);
invalidate();
}
}
private int getScaleInPixel(int i) {
return (int) ((getContext().getResources().getDisplayMetrics().density * (i)) + 0.5f);
}
private int dpToPx(int dp) {
Resources r = getResources();
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics());
}
private double toPixel(double d) {
return (getContext().getResources().getDisplayMetrics().density) * d;
}
private String formatFloat(float f) {
try {
return NumberFormat.getInstance().format(f);
} catch (Exception e) {
return empty;
}
}
private float getscale(float f, int i) {
return new BigDecimal(Float.toString(f)).setScale(i, 4).floatValue();
}
private boolean stringValid(String str) {
return str == null || str.trim().length() == 0 || str.trim().equalsIgnoreCase("null");
}
public TrendType getTrendType() {
return trendType;
}
public void setTrendType(TrendType trendType) {
this.trendType = trendType;
setupPressureLine(false);
}
public Typeface getTypeface() {
if (typeface == null)
return Typeface.DEFAULT;
return typeface;
}
public void setTypeface(Typeface typeface) {
this.typeface = typeface;
}
public int getTextColor() {
return textColor;
}
public void setTextColor(int textColor) {
this.textColor = textColor;
}
public int getLineColor() {
return lineColor;
}
public void setLineColor(int lineColor) {
this.lineColor = lineColor;
}
public float getLineStrokeWidth() {
return lineStrokeWidth;
}
public void setLineStrokeWidth(float lineStrokeWidth) {
this.lineStrokeWidth = lineStrokeWidth;
}
public int getBarometerColor() {
return barometerColor;
}
public void setBarometerColor(int barometerColor) {
this.barometerColor = barometerColor;
}
public float getBarometerStrokeWidth() {
return barometerStrokeWidth;
}
public void setBarometerStrokeWidth(float barometerStrokeWidth) {
this.barometerStrokeWidth = barometerStrokeWidth;
}
public String getWindDirectionText() {
return WindDirectionText;
}
public void setWindDirectionText(String windDirectionText) {
WindDirectionText = windDirectionText;
}
public int getBigPoleX() {
return bigPoleX;
}
public void setBigPoleX(int bigPoleX) {
this.bigPoleX = bigPoleX;
}
public int getSmallPoleX() {
return smallPoleX;
}
public void setSmallPoleX(int smallPoleX) {
this.smallPoleX = smallPoleX;
}
public String getWindText() {
return windText;
}
public void setWindText(String windText) {
this.windText = windText;
}
public String getWindName() {
return windName;
}
public void setWindName(String windName) {
this.windName = windName;
}
public String getWindSpeedText() {
return windSpeedText;
}
public void setWindSpeedText(String windSpeedText) {
this.windSpeedText = windSpeedText;
}
public String getBarometerText() {
return barometerText;
}
public void setBarometerText(String barometerText) {
this.barometerText = barometerText;
}
public int getPoleBottomY() {
return poleBottomY;
}
public void setPoleBottomY(int poleBottomY) {
this.poleBottomY = poleBottomY;
}
public int getWindTextX() {
return windTextX;
}
public void setWindTextX(int windTextX) {
this.windTextX = windTextX;
}
public int getWindTextY() {
return windTextY;
}
public void setWindTextY(int windTextY) {
this.windTextY = windTextY;
}
public String getWindSpeedUnit() {
return windSpeedUnit;
}
public void setWindSpeedUnit(String str) {
windSpeedUnit = str;
initSpeedUnit();
}
public Rect getRect() {
return rect;
}
public void setRect(Rect rect) {
this.rect = rect;
}
public int getLabelFontSize() {
return labelFontSize;
}
public void setLabelFontSize(int labelFontSize) {
this.labelFontSize = labelFontSize;
}
public int getNumericFontSize() {
return numericFontSize;
}
public void setNumericFontSize(int numericFontSize) {
this.numericFontSize = numericFontSize;
}
public String getPressureUnit() {
return pressureUnit;
}
public void setPressureUnit(String str) {
pressureUnit = str;
}
public int getPressureTextY() {
return pressureTextY;
}
public void setPressureTextY(int pressureTextY) {
this.pressureTextY = pressureTextY;
}
public float getPressure() {
return pressure;
}
public void setPressure(float f) {
pressure = getscale(f, 2);
if (pressure < 0.0f) {
pressureText = empty;
} else {
pressureText = formatFloat(pressure);
}
}
public float getLineSize() {
return lineSize;
}
public void setLineSize(float lineSize) {
this.lineSize = lineSize;
}
public double getLineSpace() {
return lineSpace;
}
public void setLineSpace(double lineSpace) {
this.lineSpace = lineSpace;
}
}
================================================
FILE: windview/src/main/java/com/github/ahmadnemati/wind/enums/TrendType.java
================================================
package com.github.ahmadnemati.wind.enums;
/**
* Created by Ahmad Nemati on 12/21/2016.
*/
public enum TrendType {
UP, DOWN, NONE
}
================================================
FILE: windview/src/main/res/values/attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="WindView">
<attr name="windSpeed" format="float" />
<attr name="pressure" format="float" />
<attr name="numericFontSize" format="dimension" />
<attr name="barometerTickSpacing" format="dimension" />
<attr name="labelFontSize" format="dimension" />
<attr name="windTextX" format="dimension" />
<attr name="windTextY" format="dimension" />
<attr name="pressureTextX" format="dimension" />
<attr name="pressureTextY" format="dimension" />
<attr name="pressureLineY" format="dimension" />
<attr name="bigPoleX" format="dimension" />
<attr name="smallPoleX" format="dimension" />
<attr name="poleBottomY" format="dimension" />
<attr name="aspectRatio" format="float" />
</declare-styleable>
</resources>
================================================
FILE: windview/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="text_color">#ffffff</color>
</resources>
================================================
FILE: windview/src/main/res/values/strings.xml
================================================
<resources>
<string name="app_name">WindView</string>
</resources>
================================================
FILE: windview/src/test/java/com/github/ahmadnemati/wind/ExampleUnitTest.java
================================================
package com.github.ahmadnemati.wind;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
gitextract__b55n19i/
├── .gitignore
├── .idea/
│ ├── compiler.xml
│ ├── copyright/
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── markdown-navigator/
│ │ └── profiles_settings.xml
│ ├── markdown-navigator.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── vcs.xml
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── demo.apk
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── com/
│ │ └── example/
│ │ └── windview/
│ │ └── ExampleInstrumentedTest.java
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── example/
│ │ │ └── windview/
│ │ │ ├── CustomRadioButton.java
│ │ │ └── MainActivity.java
│ │ └── res/
│ │ ├── layout/
│ │ │ ├── activity_main.xml
│ │ │ └── dropdown_item.xml
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-v21/
│ │ │ └── styles.xml
│ │ └── values-w820dp/
│ │ └── dimens.xml
│ └── test/
│ └── java/
│ └── com/
│ └── example/
│ └── windview/
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── windview/
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src/
├── androidTest/
│ └── java/
│ └── com/
│ └── github/
│ └── ahmadnemati/
│ └── wind/
│ └── ExampleInstrumentedTest.java
├── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── github/
│ │ └── ahmadnemati/
│ │ └── wind/
│ │ ├── WindView.java
│ │ └── enums/
│ │ └── TrendType.java
│ └── res/
│ └── values/
│ ├── attrs.xml
│ ├── colors.xml
│ └── strings.xml
└── test/
└── java/
└── com/
└── github/
└── ahmadnemati/
└── wind/
└── ExampleUnitTest.java
SYMBOL INDEX (110 symbols across 8 files)
FILE: app/src/androidTest/java/com/example/windview/ExampleInstrumentedTest.java
class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
method useAppContext (line 19) | @Test
FILE: app/src/main/java/com/example/windview/CustomRadioButton.java
class CustomRadioButton (line 14) | public class CustomRadioButton extends android.support.v7.widget.AppComp...
method CustomRadioButton (line 15) | public CustomRadioButton(Context context) {
method CustomRadioButton (line 19) | public CustomRadioButton(Context context, AttributeSet attrs) {
method CustomRadioButton (line 23) | public CustomRadioButton(Context context, AttributeSet attrs, int defS...
method isChecked (line 27) | @Override
method setChecked (line 32) | @Override
FILE: app/src/main/java/com/example/windview/MainActivity.java
class MainActivity (line 24) | public class MainActivity extends AppCompatActivity implements SeekBar.O...
method onCreate (line 45) | @Override
method initRadioButton (line 59) | private void initRadioButton() {
method setupWindView (line 63) | private void setupWindView() {
method initSeekBars (line 75) | private void initSeekBars() {
method materialize (line 82) | private void materialize() {
method initSpinner (line 90) | private void initSpinner() {
method onProgressChanged (line 134) | @Override
method onStartTrackingTouch (line 152) | @Override
method onStopTrackingTouch (line 157) | @Override
method onCheckedChanged (line 163) | @Override
method onClick (line 182) | @Override
method onPause (line 188) | @Override
method onResume (line 194) | @Override
FILE: app/src/test/java/com/example/windview/ExampleUnitTest.java
class ExampleUnitTest (line 12) | public class ExampleUnitTest {
method addition_isCorrect (line 13) | @Test
FILE: windview/src/androidTest/java/com/github/ahmadnemati/wind/ExampleInstrumentedTest.java
class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
method useAppContext (line 19) | @Test
FILE: windview/src/main/java/com/github/ahmadnemati/wind/WindView.java
class WindView (line 33) | public class WindView extends View {
method WindView (line 85) | public WindView(Context context) {
method WindView (line 90) | public WindView(Context context, AttributeSet attrs) {
method WindView (line 95) | public WindView(Context context, AttributeSet attrs, int defStyleAttr) {
method WindView (line 100) | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
method getTAG (line 106) | public static String getTAG() {
method init (line 110) | private void init(AttributeSet attrs) {
method setupView (line 127) | private void setupView() {
method start (line 151) | public void start() {
method stop (line 156) | public void stop() {
method setWindSpeed (line 160) | public void setWindSpeed(float f) {
method setWindDirection (line 177) | public void setWindDirection(String str) {
method initSpeedUnit (line 182) | private void initSpeedUnit() {
method onSizeChanged (line 192) | @Override
method onDraw (line 198) | @Override
method initCanvas (line 203) | private void initCanvas(Canvas canvas) {
method drawLine (line 252) | private void drawLine(Canvas canvas) {
method setupPressureLine (line 271) | private void setupPressureLine(boolean z) {
method drawWind (line 310) | private void drawWind(Canvas canvas) {
method drawPressure (line 329) | private void drawPressure(Canvas canvas) {
method startTimes (line 351) | private void startTimes() {
method drawBarometer (line 359) | private void drawBarometer(Canvas canvas) {
method animateBaroMeter (line 372) | public void animateBaroMeter() {
method getScaleInPixel (line 380) | private int getScaleInPixel(int i) {
method dpToPx (line 384) | private int dpToPx(int dp) {
method toPixel (line 389) | private double toPixel(double d) {
method formatFloat (line 393) | private String formatFloat(float f) {
method getscale (line 401) | private float getscale(float f, int i) {
method stringValid (line 405) | private boolean stringValid(String str) {
method getTrendType (line 409) | public TrendType getTrendType() {
method setTrendType (line 413) | public void setTrendType(TrendType trendType) {
method getTypeface (line 419) | public Typeface getTypeface() {
method setTypeface (line 425) | public void setTypeface(Typeface typeface) {
method getTextColor (line 429) | public int getTextColor() {
method setTextColor (line 433) | public void setTextColor(int textColor) {
method getLineColor (line 437) | public int getLineColor() {
method setLineColor (line 441) | public void setLineColor(int lineColor) {
method getLineStrokeWidth (line 445) | public float getLineStrokeWidth() {
method setLineStrokeWidth (line 449) | public void setLineStrokeWidth(float lineStrokeWidth) {
method getBarometerColor (line 453) | public int getBarometerColor() {
method setBarometerColor (line 457) | public void setBarometerColor(int barometerColor) {
method getBarometerStrokeWidth (line 461) | public float getBarometerStrokeWidth() {
method setBarometerStrokeWidth (line 465) | public void setBarometerStrokeWidth(float barometerStrokeWidth) {
method getWindDirectionText (line 469) | public String getWindDirectionText() {
method setWindDirectionText (line 473) | public void setWindDirectionText(String windDirectionText) {
method getBigPoleX (line 477) | public int getBigPoleX() {
method setBigPoleX (line 481) | public void setBigPoleX(int bigPoleX) {
method getSmallPoleX (line 485) | public int getSmallPoleX() {
method setSmallPoleX (line 489) | public void setSmallPoleX(int smallPoleX) {
method getWindText (line 493) | public String getWindText() {
method setWindText (line 497) | public void setWindText(String windText) {
method getWindName (line 501) | public String getWindName() {
method setWindName (line 505) | public void setWindName(String windName) {
method getWindSpeedText (line 509) | public String getWindSpeedText() {
method setWindSpeedText (line 513) | public void setWindSpeedText(String windSpeedText) {
method getBarometerText (line 517) | public String getBarometerText() {
method setBarometerText (line 521) | public void setBarometerText(String barometerText) {
method getPoleBottomY (line 525) | public int getPoleBottomY() {
method setPoleBottomY (line 529) | public void setPoleBottomY(int poleBottomY) {
method getWindTextX (line 533) | public int getWindTextX() {
method setWindTextX (line 537) | public void setWindTextX(int windTextX) {
method getWindTextY (line 541) | public int getWindTextY() {
method setWindTextY (line 545) | public void setWindTextY(int windTextY) {
method getWindSpeedUnit (line 549) | public String getWindSpeedUnit() {
method setWindSpeedUnit (line 553) | public void setWindSpeedUnit(String str) {
method getRect (line 558) | public Rect getRect() {
method setRect (line 562) | public void setRect(Rect rect) {
method getLabelFontSize (line 566) | public int getLabelFontSize() {
method setLabelFontSize (line 570) | public void setLabelFontSize(int labelFontSize) {
method getNumericFontSize (line 574) | public int getNumericFontSize() {
method setNumericFontSize (line 578) | public void setNumericFontSize(int numericFontSize) {
method getPressureUnit (line 582) | public String getPressureUnit() {
method setPressureUnit (line 586) | public void setPressureUnit(String str) {
method getPressureTextY (line 590) | public int getPressureTextY() {
method setPressureTextY (line 594) | public void setPressureTextY(int pressureTextY) {
method getPressure (line 598) | public float getPressure() {
method setPressure (line 602) | public void setPressure(float f) {
method getLineSize (line 611) | public float getLineSize() {
method setLineSize (line 615) | public void setLineSize(float lineSize) {
method getLineSpace (line 619) | public double getLineSpace() {
method setLineSpace (line 623) | public void setLineSpace(double lineSpace) {
FILE: windview/src/main/java/com/github/ahmadnemati/wind/enums/TrendType.java
type TrendType (line 7) | public enum TrendType {
FILE: windview/src/test/java/com/github/ahmadnemati/wind/ExampleUnitTest.java
class ExampleUnitTest (line 12) | public class ExampleUnitTest {
method addition_isCorrect (line 13) | @Test
Condensed preview — 48 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (89K chars).
[
{
"path": ".gitignore",
"chars": 118,
"preview": "*.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",
"chars": 686,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"CompilerConfiguration\">\n <resourceExt"
},
{
"path": ".idea/copyright/profiles_settings.xml",
"chars": 74,
"preview": "<component name=\"CopyrightManager\">\n <settings default=\"\" />\n</component>"
},
{
"path": ".idea/encodings.xml",
"chars": 159,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"Encoding\">\n <file url=\"PROJECT\" chars"
},
{
"path": ".idea/gradle.xml",
"chars": 776,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"GradleSettings\">\n <option name=\"linke"
},
{
"path": ".idea/markdown-navigator/profiles_settings.xml",
"chars": 90,
"preview": "<component name=\"MarkdownNavigator.ProfileManager\">\n <settings default=\"\" />\n</component>"
},
{
"path": ".idea/markdown-navigator.xml",
"chars": 3726,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"MarkdownProjectSettings\">\n <PreviewSe"
},
{
"path": ".idea/misc.xml",
"chars": 2226,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"EntryPointsManager\">\n <entry_points v"
},
{
"path": ".idea/modules.xml",
"chars": 470,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectModuleManager\">\n <modules>\n "
},
{
"path": ".idea/runConfigurations.xml",
"chars": 564,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"RunConfigurationProducerService\">\n <o"
},
{
"path": ".idea/vcs.xml",
"chars": 180,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"VcsDirectoryMappings\">\n <mapping dire"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 2940,
"preview": "[](http://www.apache.org/lic"
},
{
"path": "app/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "app/build.gradle",
"chars": 1203,
"preview": "apply plugin: 'com.android.application'\n\nandroid {\n compileSdkVersion 27\n\n\n defaultConfig {\n applicationId "
},
{
"path": "app/proguard-rules.pro",
"chars": 645,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:"
},
{
"path": "app/src/androidTest/java/com/example/windview/ExampleInstrumentedTest.java",
"chars": 744,
"preview": "package com.example.windview;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimpo"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 741,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "app/src/main/java/com/example/windview/CustomRadioButton.java",
"chars": 1001,
"preview": "package com.example.windview;\n\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.os.Build;\ni"
},
{
"path": "app/src/main/java/com/example/windview/MainActivity.java",
"chars": 5762,
"preview": "package com.example.windview;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android"
},
{
"path": "app/src/main/res/layout/activity_main.xml",
"chars": 12432,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/dropdown_item.xml",
"chars": 457,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 208,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"colorPrimary\">#3F51B5</color>\n <color name=\"color"
},
{
"path": "app/src/main/res/values/dimens.xml",
"chars": 97,
"preview": "<resources>\n <!-- Default screen margins, per the Android Design guidelines. -->\n</resources>\n"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 71,
"preview": "<resources>\n <string name=\"app_name\">WindView</string>\n</resources>\n"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 810,
"preview": "<resources>\n\n <!-- Base application theme. -->\n <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">"
},
{
"path": "app/src/main/res/values-v21/styles.xml",
"chars": 364,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme.NoActionBar\">\n <item name=\"windowAct"
},
{
"path": "app/src/main/res/values-w820dp/dimens.xml",
"chars": 300,
"preview": "<resources>\n <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n (such as s"
},
{
"path": "app/src/test/java/com/example/windview/ExampleUnitTest.java",
"chars": 398,
"preview": "package com.example.windview;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test"
},
{
"path": "build.gradle",
"chars": 798,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n r"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 231,
"preview": "#Sat Aug 11 10:03:44 IRDT 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
},
{
"path": "gradle.properties",
"chars": 730,
"preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
},
{
"path": "gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "settings.gradle",
"chars": 28,
"preview": "include ':app', ':windview'\n"
},
{
"path": "windview/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "windview/build.gradle",
"chars": 912,
"preview": "apply plugin: 'com.android.library'\napply plugin: 'com.github.dcendents.android-maven'\n\nandroid {\n compileSdkVersion "
},
{
"path": "windview/proguard-rules.pro",
"chars": 645,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:"
},
{
"path": "windview/src/androidTest/java/com/github/ahmadnemati/wind/ExampleInstrumentedTest.java",
"chars": 763,
"preview": "package com.github.ahmadnemati.wind;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistr"
},
{
"path": "windview/src/main/AndroidManifest.xml",
"chars": 259,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.github.ahmadnemati.wind\">\n\n <ap"
},
{
"path": "windview/src/main/java/com/github/ahmadnemati/wind/WindView.java",
"chars": 20926,
"preview": "package com.github.ahmadnemati.wind;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport andro"
},
{
"path": "windview/src/main/java/com/github/ahmadnemati/wind/enums/TrendType.java",
"chars": 140,
"preview": "package com.github.ahmadnemati.wind.enums;\n\n/**\n * Created by Ahmad Nemati on 12/21/2016.\n */\n\npublic enum TrendType {\n "
},
{
"path": "windview/src/main/res/values/attrs.xml",
"chars": 894,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <declare-styleable name=\"WindView\">\n <attr name=\"windSpeed"
},
{
"path": "windview/src/main/res/values/colors.xml",
"chars": 108,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"text_color\">#ffffff</color>\n</resources>"
},
{
"path": "windview/src/main/res/values/strings.xml",
"chars": 71,
"preview": "<resources>\n <string name=\"app_name\">WindView</string>\n</resources>\n"
},
{
"path": "windview/src/test/java/com/github/ahmadnemati/wind/ExampleUnitTest.java",
"chars": 405,
"preview": "package com.github.ahmadnemati.wind;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local un"
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the AhmadNemati/WindView GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 48 files (80.9 KB), approximately 20.5k tokens, and a symbol index with 110 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.