Initial commit
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
.DS_Store
|
||||
/build
|
1
.idea/.name
Normal file
@ -0,0 +1 @@
|
||||
Myterio
|
23
.idea/compiler.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<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>
|
3
.idea/copyright/profiles_settings.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="" />
|
||||
</component>
|
18
.idea/gradle.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="1.8" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
52
.idea/misc.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points version="2.0" />
|
||||
</component>
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</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_6" 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>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="ProjectJDKs.UI">
|
||||
<settings>
|
||||
<last-edited>1.6</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ScopeChooserConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
9
.idea/modules.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Myterio.iml" filepath="$PROJECT_DIR$/Myterio.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
124
.idea/uiDesigner.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="" />
|
||||
</component>
|
||||
</project>
|
18
Myterio.iml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="Myterio" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="java-gradle" name="Java-Gradle">
|
||||
<configuration>
|
||||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
98
app/app.iml
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Myterio" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="android-gradle" name="Android-Gradle">
|
||||
<configuration>
|
||||
<option name="GRADLE_PROJECT_PATH" value=":app" />
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
|
||||
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
|
||||
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
|
||||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="gson-2.3.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="retrofit-1.9.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="floatingactionbutton-1.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
|
||||
</component>
|
||||
</module>
|
47
app/build.gradle
Normal file
@ -0,0 +1,47 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.1.1'
|
||||
}
|
||||
}
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "23.0.0 rc2"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.amine.myterio.app"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 22
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_6
|
||||
targetCompatibility JavaVersion.VERSION_1_6
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:+'
|
||||
compile 'com.android.support:cardview-v7:+'
|
||||
compile 'com.android.support:recyclerview-v7:+'
|
||||
compile "com.android.support:support-v4:+"
|
||||
compile 'com.melnykov:floatingactionbutton:+'
|
||||
compile 'com.squareup.retrofit:retrofit:+'
|
||||
}
|
17
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in C:/Users/Amine/Desktop/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 *;
|
||||
#}
|
@ -0,0 +1,13 @@
|
||||
package com.amine.myterio.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.test.ApplicationTestCase;
|
||||
|
||||
/**
|
||||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
|
||||
*/
|
||||
public class ApplicationTest extends ApplicationTestCase<Application> {
|
||||
public ApplicationTest() {
|
||||
super(Application.class);
|
||||
}
|
||||
}
|
21
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.amine.myterio.app" >
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
92
app/src/main/java/com/amine/myterio/app/CitiesAdapter.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.amine.myterio.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import com.amine.myterio.app.api.WeatherAdapters;
|
||||
import com.amine.myterio.app.api.WeatherApis;
|
||||
import com.amine.myterio.app.model.City;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CitiesAdapter extends RecyclerView.Adapter<CitiesAdapter.ViewHolder> {
|
||||
private static ArrayList<City> mDataset;
|
||||
private static Context c;
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements RecyclerView.OnClickListener{
|
||||
public View mCardView;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
mCardView = itemView;
|
||||
itemView.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// Go to details activity
|
||||
}
|
||||
}
|
||||
|
||||
public CitiesAdapter(ArrayList<City> cities, Context c) {
|
||||
mDataset = cities;
|
||||
this.c = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.city_card_view, parent, false);
|
||||
ViewHolder vh = new ViewHolder(v);
|
||||
return vh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
final City[] currentCity = {mDataset.get(position)};
|
||||
TextView name = (TextView) holder.mCardView.findViewById(R.id.name);
|
||||
name.setText(currentCity[0].getName());
|
||||
|
||||
WeatherAdapters adapters = new WeatherAdapters();
|
||||
WeatherApis.WeatherCityApi s = adapters.getWeatherCityAdapter();
|
||||
s.cityWeather(currentCity[0].getCityIdentifier(), new Callback<City>() {
|
||||
@Override
|
||||
public void success(City city, Response response) {
|
||||
currentCity[0] = city;
|
||||
// Update with found data
|
||||
|
||||
TextView maxTemp = (TextView) holder.mCardView.findViewById(R.id.max_temp);
|
||||
maxTemp.setText("" + city.getMain().getTemp_max());
|
||||
|
||||
TextView minTemp = (TextView) holder.mCardView.findViewById(R.id.temp_min);
|
||||
minTemp.setText("" + city.getMain().getTemp_min());
|
||||
|
||||
TextView wind = (TextView) holder.mCardView.findViewById(R.id.wind_speed);
|
||||
wind.setText("" + city.getWind().getSpeed());
|
||||
|
||||
TextView weatherName = (TextView) holder.mCardView.findViewById(R.id.weather_text);
|
||||
weatherName.setText(city.getWeather().get(0).getDescription());
|
||||
|
||||
ImageView image = (ImageView) holder.mCardView.findViewById(R.id.weather_image);
|
||||
image.setImageDrawable(city.getWeather().get(0).getIconDrawable(c, c.getPackageName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failure(RetrofitError error) {
|
||||
Toast.makeText(c, "Hello toast!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDataset.size();
|
||||
}
|
||||
}
|
105
app/src/main/java/com/amine/myterio/app/MainActivity.java
Normal file
@ -0,0 +1,105 @@
|
||||
package com.amine.myterio.app;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import com.amine.myterio.app.db.CityDAO;
|
||||
import com.amine.myterio.app.model.City;
|
||||
import com.melnykov.fab.FloatingActionButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private RecyclerView.Adapter mAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
handleView();
|
||||
|
||||
/* WeatherAdapters adapters = new WeatherAdapters();
|
||||
WeatherApis.WeatherDailyForecastApi s = adapters.getWeatherForecastAdapter();
|
||||
s.cityForecast(1851632, new Callback<Forecast>() {
|
||||
@Override
|
||||
public void success(Forecast forecast, Response response) {
|
||||
Toast.makeText(getApplicationContext(), "Hello toast!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failure(RetrofitError error) {
|
||||
Toast.makeText(getApplicationContext(), "Hello toast!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
private void handleView() {
|
||||
setContentView(R.layout.activity_main);
|
||||
mRecyclerView = (RecyclerView) findViewById(R.id.list);
|
||||
|
||||
|
||||
// Google way to test is tablet
|
||||
boolean isTablet = ((this.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE);
|
||||
|
||||
final RecyclerView.LayoutManager layoutManager;
|
||||
if (isTablet) {
|
||||
layoutManager = new GridLayoutManager(this, 2);
|
||||
}
|
||||
else {
|
||||
layoutManager = new LinearLayoutManager(this);
|
||||
}
|
||||
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
|
||||
ArrayList<City> cities = new ArrayList<City>();
|
||||
|
||||
CityDAO dao = CityDAO.getInstance(this);
|
||||
|
||||
City c = new City("Cairns", 2172797);
|
||||
City c1 = new City("Moscow", 524901);
|
||||
|
||||
dao.insertCity(c);
|
||||
dao.insertCity(c1);
|
||||
cities = dao.getAllCities();
|
||||
|
||||
mAdapter = new CitiesAdapter(cities, this);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.attachToRecyclerView(mRecyclerView);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.menu_main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.amine.myterio.app.api;
|
||||
|
||||
import retrofit.RestAdapter;
|
||||
|
||||
public class WeatherAdapters {
|
||||
RestAdapter restAdapter;
|
||||
|
||||
|
||||
public WeatherAdapters() {
|
||||
this.restAdapter = new RestAdapter.Builder()
|
||||
.setEndpoint("http://api.openweathermap.org")
|
||||
.build();
|
||||
}
|
||||
|
||||
public WeatherApis.WeatherLocationApi getWeatherLocationAdapter() {
|
||||
return restAdapter.create(WeatherApis.WeatherLocationApi.class);
|
||||
}
|
||||
|
||||
public WeatherApis.WeatherCityApi getWeatherCityAdapter() {
|
||||
return restAdapter.create(WeatherApis.WeatherCityApi.class);
|
||||
}
|
||||
|
||||
public WeatherApis.WeatherDailyForecastApi getWeatherForecastAdapter() {
|
||||
return restAdapter.create(WeatherApis.WeatherDailyForecastApi.class);
|
||||
}
|
||||
}
|
22
app/src/main/java/com/amine/myterio/app/api/WeatherApis.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.amine.myterio.app.api;
|
||||
|
||||
import com.amine.myterio.app.model.City;
|
||||
import com.amine.myterio.app.model.Forecast;
|
||||
import retrofit.Callback;
|
||||
import retrofit.http.GET;
|
||||
import retrofit.http.Query;
|
||||
|
||||
public class WeatherApis {
|
||||
public interface WeatherLocationApi {
|
||||
@GET("/data/2.5/weather")
|
||||
void locationWeather(@Query("q") String location, Callback<City> cb);
|
||||
}
|
||||
public interface WeatherCityApi {
|
||||
@GET("/data/2.5/weather")
|
||||
void cityWeather(@Query("id") int city, Callback<City> cb);
|
||||
}
|
||||
public interface WeatherDailyForecastApi {
|
||||
@GET("/data/2.5/forecast/daily?units=metric&cnt=7")
|
||||
void cityForecast(@Query("id") int city, Callback<Forecast> cb);
|
||||
}
|
||||
}
|
117
app/src/main/java/com/amine/myterio/app/db/CityDAO.java
Normal file
@ -0,0 +1,117 @@
|
||||
package com.amine.myterio.app.db;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import com.amine.myterio.app.model.City;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CityDAO {
|
||||
private static final int VERSION_BDD = 1;
|
||||
private static final String NOM_BDD = "cities.db";
|
||||
|
||||
private static final String TABLE_CITIES = "cities";
|
||||
private static final String COL_ID = "ID";
|
||||
private static final String COL_NAME = "Name";
|
||||
private static final String COL_CITY_ID = "CityId";
|
||||
|
||||
private static final int NUM_COL_ID = 0;
|
||||
private static final int NUM_COL_NAME = 1;
|
||||
private static final int NUM_COL_CITY_ID = 2;
|
||||
private static CityDAO instance = null;
|
||||
private final CityDB maBaseSQLite;
|
||||
private SQLiteDatabase bdd;
|
||||
|
||||
private CityDAO(Context context) {
|
||||
maBaseSQLite = new CityDB(context, NOM_BDD, null, VERSION_BDD);
|
||||
}
|
||||
|
||||
public static CityDAO getInstance(Context c) {
|
||||
if (instance == null) {
|
||||
instance = new CityDAO(c);
|
||||
return instance;
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
public void open() {
|
||||
bdd = maBaseSQLite.getWritableDatabase();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
bdd.close();
|
||||
}
|
||||
|
||||
public void insertCity(City city) {
|
||||
this.open();
|
||||
ContentValues values = getContentValues(city);
|
||||
bdd.insert(TABLE_CITIES, null, values);
|
||||
this.close();
|
||||
}
|
||||
|
||||
private ContentValues getContentValues(City city) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(COL_NAME, city.getName());
|
||||
values.put(COL_CITY_ID, city.getCityIdentifier());
|
||||
return values;
|
||||
}
|
||||
|
||||
public void updateCity(City city) {
|
||||
this.open();
|
||||
ContentValues values = getContentValues(city);
|
||||
bdd.update(TABLE_CITIES, values, COL_CITY_ID + " = " + city.getCityIdentifier(), null);
|
||||
this.close();
|
||||
}
|
||||
|
||||
public void deleteCity(City city) {
|
||||
this.open();
|
||||
bdd.delete(TABLE_CITIES, COL_CITY_ID + " = " + city.getCityIdentifier(), null);
|
||||
this.close();
|
||||
}
|
||||
|
||||
public City getCity(int identifier) {
|
||||
this.open();
|
||||
Cursor c = bdd.query(TABLE_CITIES, null, COL_CITY_ID + " = " + identifier, null, null, null, null);
|
||||
c.moveToFirst();
|
||||
City city = cursorToCity(c);
|
||||
c.close();
|
||||
this.close();
|
||||
return city;
|
||||
}
|
||||
|
||||
private City cursorToCity(Cursor c) {
|
||||
if (c.getCount() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
City city = new City();
|
||||
city.setName(c.getString(NUM_COL_NAME));
|
||||
city.setCityIdentifier(c.getInt(NUM_COL_CITY_ID));
|
||||
return city;
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<City> getAllCities() {
|
||||
this.open();
|
||||
Cursor c = bdd.rawQuery("SELECT * FROM " + TABLE_CITIES, null);
|
||||
ArrayList<City> cities = cursorToListeCities(c);
|
||||
this.close();
|
||||
return cities;
|
||||
}
|
||||
|
||||
private ArrayList<City> cursorToListeCities(Cursor cursor) {
|
||||
ArrayList<City> list = new ArrayList<City>();
|
||||
if (cursor.getCount() != 0) {
|
||||
if (cursor.moveToFirst()) {
|
||||
while (!cursor.isAfterLast()) {
|
||||
list.add(cursorToCity(cursor));
|
||||
cursor.moveToNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
return list;
|
||||
}
|
||||
}
|
33
app/src/main/java/com/amine/myterio/app/db/CityDB.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.amine.myterio.app.db;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
public class CityDB extends SQLiteOpenHelper {
|
||||
|
||||
private static final String TABLE_CITIES = "cities";
|
||||
private static final String COL_ID = "ID";
|
||||
private static final String COL_NAME = "Name";
|
||||
private static final String COL_CITY_ID = "CityId";
|
||||
|
||||
private static final String CREATE_BDD = "CREATE TABLE " + TABLE_CITIES + " (" +
|
||||
COL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
COL_NAME + " TEXT, " +
|
||||
COL_CITY_ID + " INTEGER);";
|
||||
|
||||
public CityDB(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
|
||||
super(context, name, factory, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
db.execSQL(CREATE_BDD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
}
|
||||
|
63
app/src/main/java/com/amine/myterio/app/model/City.java
Normal file
@ -0,0 +1,63 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class City {
|
||||
|
||||
public String name;
|
||||
public int id;
|
||||
public MainInfo main;
|
||||
public List<Weather> weather;
|
||||
public Wind wind;
|
||||
|
||||
public City(String name, int id) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public City() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getCityIdentifier() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setCityIdentifier(int cityIdentifier) {
|
||||
this.id = cityIdentifier;
|
||||
}
|
||||
|
||||
public MainInfo getMain() {
|
||||
return main;
|
||||
}
|
||||
|
||||
public void setMain(MainInfo main) {
|
||||
this.main = main;
|
||||
}
|
||||
|
||||
public List<Weather> getWeather() {
|
||||
return weather;
|
||||
}
|
||||
|
||||
public void setWeather(List<Weather> weather) {
|
||||
this.weather = weather;
|
||||
}
|
||||
|
||||
public Wind getWind() {
|
||||
return wind;
|
||||
}
|
||||
|
||||
public void setWind(Wind wind) {
|
||||
this.wind = wind;
|
||||
}
|
||||
}
|
24
app/src/main/java/com/amine/myterio/app/model/Forecast.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Forecast {
|
||||
public City city;
|
||||
public List<ForecastWeather> list;
|
||||
|
||||
public City getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(City city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public List<ForecastWeather> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<ForecastWeather> list) {
|
||||
this.list = list;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ForecastWeather {
|
||||
public TempInfo temp;
|
||||
public List<Weather> weather;
|
||||
public float speed;
|
||||
|
||||
public TempInfo getTemp() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
public void setTemp(TempInfo temp) {
|
||||
this.temp = temp;
|
||||
}
|
||||
|
||||
public List<Weather> getWeather() {
|
||||
return weather;
|
||||
}
|
||||
|
||||
public void setWeather(List<Weather> weather) {
|
||||
this.weather = weather;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
}
|
31
app/src/main/java/com/amine/myterio/app/model/MainInfo.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
public class MainInfo {
|
||||
public float temp;
|
||||
public float temp_max;
|
||||
public float temp_min;
|
||||
|
||||
public float getTemp() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
public void setTemp(float temp) {
|
||||
this.temp = temp;
|
||||
}
|
||||
|
||||
public float getTemp_max() {
|
||||
return temp_max;
|
||||
}
|
||||
|
||||
public void setTemp_max(float temp_max) {
|
||||
this.temp_max = temp_max;
|
||||
}
|
||||
|
||||
public float getTemp_min() {
|
||||
return temp_min;
|
||||
}
|
||||
|
||||
public void setTemp_min(float temp_min) {
|
||||
this.temp_min = temp_min;
|
||||
}
|
||||
}
|
58
app/src/main/java/com/amine/myterio/app/model/TempInfo.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
public class TempInfo {
|
||||
public float day;
|
||||
public float min;
|
||||
public float max;
|
||||
public float night;
|
||||
public float eve;
|
||||
public float morn;
|
||||
|
||||
public float getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
public void setDay(float day) {
|
||||
this.day = day;
|
||||
}
|
||||
|
||||
public float getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public void setMin(float min) {
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
public float getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public void setMax(float max) {
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public float getNight() {
|
||||
return night;
|
||||
}
|
||||
|
||||
public void setNight(float night) {
|
||||
this.night = night;
|
||||
}
|
||||
|
||||
public float getEve() {
|
||||
return eve;
|
||||
}
|
||||
|
||||
public void setEve(float eve) {
|
||||
this.eve = eve;
|
||||
}
|
||||
|
||||
public float getMorn() {
|
||||
return morn;
|
||||
}
|
||||
|
||||
public void setMorn(float morn) {
|
||||
this.morn = morn;
|
||||
}
|
||||
}
|
99
app/src/main/java/com/amine/myterio/app/model/Weather.java
Normal file
@ -0,0 +1,99 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class Weather {
|
||||
public String description;
|
||||
public String icon;
|
||||
public int id;
|
||||
public String main;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public Drawable getIconDrawable(Context c, String packageName) {
|
||||
String uri = "@mipmap/";
|
||||
|
||||
if (this.getIcon().equals("01d")) {
|
||||
// 01d => ic_sun
|
||||
uri += "ic_sun";
|
||||
}
|
||||
else if(this.getIcon().equals("01n")) {
|
||||
// 01n => ic_moon
|
||||
uri += "ic_moon";
|
||||
}
|
||||
else if(this.getIcon().equals("02d")) {
|
||||
// 02d => ic_sunny_cloud
|
||||
uri += "ic_sunny_cloud";
|
||||
}
|
||||
else if(this.getIcon().equals("02n")) {
|
||||
// 02n => ic_moony_cloud
|
||||
uri += "ic_moony_cloud";
|
||||
}
|
||||
else if(this.getIcon().equals("03d") || this.getIcon().equals("03n")) {
|
||||
// 03d/03n => ic_cloud
|
||||
uri += "ic_cloud";
|
||||
}
|
||||
else if(this.getIcon().equals("04d") || this.getIcon().equals("04n")) {
|
||||
// 04d/04n => ic_coud_grey
|
||||
uri += "ic_coud_grey";
|
||||
}
|
||||
else if(this.getIcon().equals("09d") || this.getIcon().equals("09n")) {
|
||||
// 09d/09n => ic_rainy_rain
|
||||
uri += "ic_rainy";
|
||||
}
|
||||
else if(this.getIcon().equals("10d")) {
|
||||
// 10d => ic_sunny_rain
|
||||
uri += "ic_sunny_rain";
|
||||
}
|
||||
else if(this.getIcon().equals("10n")) {
|
||||
// 10n => ic_moony_rain
|
||||
uri += "ic_moony_rain";
|
||||
}
|
||||
else if(this.getIcon().equals("11d") || this.getIcon().equals("11n")) {
|
||||
// 11d/11n => ic_thunder
|
||||
uri += "ic_thunder";
|
||||
}
|
||||
else if(this.getIcon().equals("13d") || this.getIcon().equals("13n")) {
|
||||
// 13d/13n => ic_snow
|
||||
uri += "ic_snow";
|
||||
}
|
||||
else if(this.getIcon().equals("50d") || this.getIcon().equals("50n")) {
|
||||
// 50d/50n => ic_mist
|
||||
uri += "ic_mist";
|
||||
}
|
||||
|
||||
int imageResource = c.getResources().getIdentifier(uri, null, packageName);
|
||||
return c.getResources().getDrawable(imageResource);
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMain() {
|
||||
return main;
|
||||
}
|
||||
|
||||
public void setMain(String main) {
|
||||
this.main = main;
|
||||
}
|
||||
}
|
22
app/src/main/java/com/amine/myterio/app/model/Wind.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.amine.myterio.app.model;
|
||||
|
||||
public class Wind {
|
||||
public float deg;
|
||||
public float speed;
|
||||
|
||||
public float getDeg() {
|
||||
return deg;
|
||||
}
|
||||
|
||||
public void setDeg(float deg) {
|
||||
this.deg = deg;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
}
|
25
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/list"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"/>
|
||||
|
||||
<com.melnykov.fab.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@mipmap/ic_search_white_24dp"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
96
app/src/main/res/layout/city_card_view.xml
Normal file
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="10dp">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="250dp"
|
||||
card_view:cardCornerRadius="2dp"
|
||||
android:elevation="2dp">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center_horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight=".5"
|
||||
android:id="@+id/left_card_part">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:text="Large Text"
|
||||
android:id="@+id/name"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginTop="25dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="Medium Text"
|
||||
android:id="@+id/temp_min"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginBottom="25dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="Medium Text"
|
||||
android:id="@+id/max_temp"
|
||||
android:layout_above="@+id/temp_min"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginBottom="25dp"/>
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight=".5"
|
||||
android:id="@+id/right_card_part">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="128dp"
|
||||
android:layout_height="128dp"
|
||||
android:id="@+id/weather_image"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:text="Small Text"
|
||||
android:id="@+id/wind_speed"
|
||||
android:layout_below="@+id/weather_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="25dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="Medium Text"
|
||||
android:id="@+id/weather_text"
|
||||
android:layout_above="@+id/weather_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="25dp"/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
16
app/src/main/res/layout/fragment_main.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:context=".MainActivity$PlaceholderFragment">
|
||||
|
||||
<TextView
|
||||
android:text="@string/hello_world"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</RelativeLayout>
|
9
app/src/main/res/menu/menu_main.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".MainActivity">
|
||||
<item android:id="@+id/action_settings"
|
||||
android:title="@string/action_settings"
|
||||
android:orderInCategory="100"
|
||||
app:showAsAction="never"/>
|
||||
</menu>
|
BIN
app/src/main/res/mipmap-hdpi/Thumbs.db
Normal file
BIN
app/src/main/res/mipmap-hdpi/ic_cloud.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_coud_grey.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_max.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_min.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_mist.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_moon.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_moony_cloud.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_moony_rain.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_rainy.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_rainy_rain.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 396 B |
BIN
app/src/main/res/mipmap-hdpi/ic_snow.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_sun.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_sunny_cloud.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_sunny_rain.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_temp.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_thunder.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_wind.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/mipmap-mdpi/Thumbs.db
Normal file
BIN
app/src/main/res/mipmap-mdpi/ic_cloud.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_coud_grey.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_max.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_min.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_mist.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_moon.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_moony_cloud.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_moony_rain.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_rainy.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_rainy_rain.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 247 B |
BIN
app/src/main/res/mipmap-mdpi/ic_snow.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_sun.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_sunny_cloud.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_sunny_rain.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_temp.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_thunder.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_wind.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/Thumbs.db
Normal file
BIN
app/src/main/res/mipmap-xhdpi/ic_cloud.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_coud_grey.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_max.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_min.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_mist.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_moon.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_moony_cloud.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_moony_rain.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_rainy.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_rainy_rain.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 465 B |
BIN
app/src/main/res/mipmap-xhdpi/ic_snow.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_sun.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_sunny_cloud.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_sunny_rain.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_temp.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_thunder.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_wind.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/Thumbs.db
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_cloud.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_coud_grey.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_max.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_min.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_mist.png
Normal file
After Width: | Height: | Size: 12 KiB |