diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..26659750 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures \ No newline at end of file diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 00000000..17d632c7 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +GoodWeather \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..96cc43ef --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 00000000..261ec285 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..1a3eaffb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..7055642b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 00000000..7f68460d --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..f0604b2c --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# good-weather +Check weather with app for android diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 00000000..71fe1234 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,26 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.1" + + defaultConfig { + applicationId "org.asdtm.goodweather" + minSdkVersion 11 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.1.1' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 00000000..5cf1d5ad --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/qqq3/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 *; +#} diff --git a/app/src/androidTest/java/org/asdtm/goodweather/ApplicationTest.java b/app/src/androidTest/java/org/asdtm/goodweather/ApplicationTest.java new file mode 100644 index 00000000..7af8727f --- /dev/null +++ b/app/src/androidTest/java/org/asdtm/goodweather/ApplicationTest.java @@ -0,0 +1,15 @@ +package org.asdtm.goodweather; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase +{ + public ApplicationTest() + { + super(Application.class); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..fb5a0daa --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/org/asdtm/goodweather/MainActivity.java b/app/src/main/java/org/asdtm/goodweather/MainActivity.java new file mode 100644 index 00000000..3e46e52b --- /dev/null +++ b/app/src/main/java/org/asdtm/goodweather/MainActivity.java @@ -0,0 +1,14 @@ +package org.asdtm.goodweather; + +import android.app.Fragment; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class MainActivity extends SingleFragmentActivity +{ + @Override + protected Fragment createNewFragment() + { + return new WeatherPageFragment(); + } +} diff --git a/app/src/main/java/org/asdtm/goodweather/SingleFragmentActivity.java b/app/src/main/java/org/asdtm/goodweather/SingleFragmentActivity.java new file mode 100644 index 00000000..27f4d0d8 --- /dev/null +++ b/app/src/main/java/org/asdtm/goodweather/SingleFragmentActivity.java @@ -0,0 +1,36 @@ +package org.asdtm.goodweather; + +import android.app.Activity; +import android.app.Fragment; +import android.app.FragmentManager; +import android.os.Bundle; + +public abstract class SingleFragmentActivity extends Activity +{ + protected abstract Fragment createNewFragment(); + + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_fragment); + + // Получаем доступ к менеджеру фрагментов + FragmentManager fragmentManager = getFragmentManager(); + + // Запрашиваем у FragmentManager фрагмент с идентификатором контейнерного представления + // если этот фрагмент уже находится в списке, FragmentManager возвращает его + Fragment fragment = fragmentManager.findFragmentById(R.id.fragmentContainer); + + // Если фрагмент с идентификатором контейнерного представления отсутствует + if (fragment == null) { + // создаем новый экземпляр фрагмента + fragment = createNewFragment(); + + // Создаем новую транзакцию, которая добавляет фрагмент в список + fragmentManager.beginTransaction().add(R.id.fragmentContainer, fragment).commit(); + } + + + } +} diff --git a/app/src/main/java/org/asdtm/goodweather/WeatherPageFragment.java b/app/src/main/java/org/asdtm/goodweather/WeatherPageFragment.java new file mode 100644 index 00000000..b839083d --- /dev/null +++ b/app/src/main/java/org/asdtm/goodweather/WeatherPageFragment.java @@ -0,0 +1,24 @@ +package org.asdtm.goodweather; + +import android.app.Fragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +public class WeatherPageFragment extends Fragment +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) + { + View v = inflater.inflate(R.layout.fragment_main, parent, false); + + return v; + } +} diff --git a/app/src/main/res/layout/activity_fragment.xml b/app/src/main/res/layout/activity_fragment.xml new file mode 100644 index 00000000..72941157 --- /dev/null +++ b/app/src/main/res/layout/activity_fragment.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml new file mode 100644 index 00000000..8b041469 --- /dev/null +++ b/app/src/main/res/layout/fragment_main.xml @@ -0,0 +1,39 @@ + + + + + + + + +