EffectiveAndroidUI 项目教程
EffectiveAndroidUISample project created to show some of the best Android practices to work in the Android UI Layer. The UI layer of this project has been implemented using MVP or MVVM (without binding engine) to show how this patterns works. This project is used during the talk “EffectiveAndroidUI”.项目地址:https://gitcode.com/gh_mirrors/ef/EffectiveAndroidUI
1. 项目的目录结构及介绍
EffectiveAndroidUI 项目的目录结构如下:
EffectiveAndroidUI/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── com/
│ │ │ │ │ ├── github/
│ │ │ │ │ │ ├── pedrovgs/
│ │ │ │ │ │ │ ├── effectiveandroidui/
│ │ │ │ │ │ │ │ ├── activity/
│ │ │ │ │ │ │ │ ├── adapter/
│ │ │ │ │ │ │ │ ├── component/
│ │ │ │ │ │ │ │ ├── fragment/
│ │ │ │ │ │ │ │ ├── interactor/
│ │ │ │ │ │ │ │ ├── module/
│ │ │ │ │ │ │ │ ├── presenter/
│ │ │ │ │ │ │ │ ├── renderer/
│ │ │ │ │ │ │ │ ├── view/
│ │ │ │ │ │ │ │ └── widget/
│ │ │ ├── res/
│ │ │ │ ├── drawable/
│ │ │ │ ├── layout/
│ │ │ │ ├── menu/
│ │ │ │ ├── mipmap/
│ │ │ │ ├── values/
│ │ │ │ └── xml/
│ │ │ └── AndroidManifest.xml
│ │ └── test/
│ │ └── java/
│ │ └── com/
│ │ └── github/
│ │ └── pedrovgs/
│ │ └── effectiveandroidui/
│ └── build.gradle
├── gradle/
│ └── wrapper/
├── .gitignore
├── build.gradle
├── gradle.properties
├── gradlew
├── gradlew.bat
├── LICENSE.txt
├── README.md
└── settings.gradle
目录结构介绍
app/
: 包含应用程序的主要代码和资源文件。src/
: 源代码目录。main/
: 主代码目录。java/
: Java 代码目录。com/github/pedrovgs/effectiveandroidui/
: 主要包目录,包含各种功能模块的代码。
res/
: 资源文件目录,包含布局、图片、字符串等资源。AndroidManifest.xml
: 应用程序的配置文件。
test/
: 测试代码目录。
build.gradle
: 应用程序的构建脚本。
gradle/
: Gradle 包装器目录。.gitignore
: Git 忽略文件配置。build.gradle
: 项目的构建脚本。gradle.properties
: Gradle 属性文件。gradlew
: Gradle 包装器脚本(Unix)。gradlew.bat
: Gradle 包装器脚本(Windows)。LICENSE.txt
: 项目许可证文件。README.md
: 项目说明文件。settings.gradle
: 项目设置文件。
2. 项目的启动文件介绍
项目的启动文件是 app/src/main/java/com/github/pedrovgs/effectiveandroidui/activity/SplashActivity.java
。这个文件是应用程序的入口点,负责启动应用程序并跳转到主界面。
SplashActivity.java
package com.github.pedrovgs.effectiveandroidui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import com.github.pedrovgs.effectiveandroidui.R;
public class SplashActivity extends AppCompatActivity {
private static final long SPLASH_DISPLAY_LENGTH = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout
EffectiveAndroidUISample project created to show some of the best Android practices to work in the Android UI Layer. The UI layer of this project has been implemented using MVP or MVVM (without binding engine) to show how this patterns works. This project is used during the talk “EffectiveAndroidUI”.项目地址:https://gitcode.com/gh_mirrors/ef/EffectiveAndroidUI