diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..edf612b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + id("com.android.application") +} + +android { + namespace = "com.hnucm.weather" + compileSdk = 34 + + defaultConfig { + applicationId = "com.hnucm.weather" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.9.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.4") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation ("com.geyifeng.immersionbar:immersionbar:3.2.2") + implementation ("com.geyifeng.immersionbar:immersionbar-components:3.2.2") +} \ No newline at end of file diff --git a/proguard-rules.pro b/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# 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 *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/src/androidTest/java/com/hnucm/weather/ExampleInstrumentedTest.java b/src/androidTest/java/com/hnucm/weather/ExampleInstrumentedTest.java new file mode 100644 index 0000000..26f8861 --- /dev/null +++ b/src/androidTest/java/com/hnucm/weather/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.hnucm.weather; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.hnucm.weather", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c819c3a --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/hnucm/weather/LoginActivity.java b/src/main/java/com/hnucm/weather/LoginActivity.java new file mode 100644 index 0000000..55bf8db --- /dev/null +++ b/src/main/java/com/hnucm/weather/LoginActivity.java @@ -0,0 +1,14 @@ +package com.hnucm.weather; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class LoginActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + } +} \ No newline at end of file diff --git a/src/main/java/com/hnucm/weather/MainActivity.java b/src/main/java/com/hnucm/weather/MainActivity.java new file mode 100644 index 0000000..fa9bc8a --- /dev/null +++ b/src/main/java/com/hnucm/weather/MainActivity.java @@ -0,0 +1,14 @@ +package com.hnucm.weather; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} \ No newline at end of file diff --git a/src/main/java/com/hnucm/weather/WelcomeActivity.java b/src/main/java/com/hnucm/weather/WelcomeActivity.java new file mode 100644 index 0000000..c6a7c6e --- /dev/null +++ b/src/main/java/com/hnucm/weather/WelcomeActivity.java @@ -0,0 +1,32 @@ +package com.hnucm.weather; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; + +import com.gyf.immersionbar.ImmersionBar; + +public class WelcomeActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_welcome); + ImmersionBar.with(this).init(); + Thread thread = new Thread(new Runnable() { + @Override + public void run() { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class); + startActivity(intent); + } + }); + thread.start(); + } +} \ No newline at end of file diff --git a/src/main/res/drawable/ic_launcher_background.xml b/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/res/drawable/ic_launcher_foreground.xml b/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/res/drawable/test1.png b/src/main/res/drawable/test1.png new file mode 100644 index 0000000..8c8165f Binary files /dev/null and b/src/main/res/drawable/test1.png differ diff --git a/src/main/res/drawable/test2.jpg b/src/main/res/drawable/test2.jpg new file mode 100644 index 0000000..5160a4c Binary files /dev/null and b/src/main/res/drawable/test2.jpg differ diff --git a/src/main/res/drawable/test3.png b/src/main/res/drawable/test3.png new file mode 100644 index 0000000..ce785d0 Binary files /dev/null and b/src/main/res/drawable/test3.png differ diff --git a/src/main/res/drawable/test4.png b/src/main/res/drawable/test4.png new file mode 100644 index 0000000..2d6fffd Binary files /dev/null and b/src/main/res/drawable/test4.png differ diff --git a/src/main/res/layout/activity_login.xml b/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..d0d85b4 --- /dev/null +++ b/src/main/res/layout/activity_login.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/res/layout/activity_main.xml b/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..17eab17 --- /dev/null +++ b/src/main/res/layout/activity_main.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/src/main/res/layout/activity_welcome.xml b/src/main/res/layout/activity_welcome.xml new file mode 100644 index 0000000..c104bce --- /dev/null +++ b/src/main/res/layout/activity_welcome.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/res/mipmap-hdpi/ic_launcher.webp b/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/src/main/res/mipmap-mdpi/ic_launcher.webp b/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/src/main/res/mipmap-xhdpi/ic_launcher.webp b/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/src/main/res/values-night/themes.xml b/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..d25b0f2 --- /dev/null +++ b/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/src/main/res/values/colors.xml b/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml new file mode 100644 index 0000000..c41b3ac --- /dev/null +++ b/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Weather + \ No newline at end of file diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml new file mode 100644 index 0000000..d66ac09 --- /dev/null +++ b/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + +