Android Animated Icons 项目教程

随笔1周前发布 小姐
16 0 0

Android Animated Icons 项目教程

Android-Animated-IconsHow to improve the user experience using animated icons with vector drawables on Android项目地址:https://gitcode.com/gh_mirrors/an/Android-Animated-Icons

1. 项目的目录结构及介绍




Android-Animated-Icons/


├── app/


│   ├── build.gradle


│   ├── src/


│   │   ├── main/


│   │   │   ├── java/


│   │   │   │   └── com/


│   │   │   │       └── andremion/


│   │   │   │           └── animatedicons/


│   │   │   │               ├── MainActivity.java


│   │   │   │               └── ...


│   │   │   ├── res/


│   │   │   │   ├── drawable/


│   │   │   │   ├── layout/


│   │   │   │   ├── mipmap/


│   │   │   │   └── values/


│   │   │   └── AndroidManifest.xml


│   └── ...


├── build.gradle


├── settings.gradle


└── ...

app/: 包含应用程序的主要代码和资源。
build.gradle: 应用程序的构建脚本。src/main/: 主要源代码和资源文件夹。
java/com/andremion/animatedicons/: 包含主要的Java代码。
MainActivity.java: 应用程序的主活动。 res/: 包含应用程序的资源文件,如布局、图片和字符串。AndroidManifest.xml: 应用程序的清单文件,定义应用程序的组件和权限。 build.gradle: 项目的根构建脚本。settings.gradle: 项目的设置文件,包含项目模块的配置。

2. 项目的启动文件介绍

项目的启动文件是 MainActivity.java,位于 app/src/main/java/com/andremion/animatedicons/ 目录下。这个文件是应用程序的主活动,负责初始化用户界面和处理用户交互。




package com.andremion.animatedicons;


 


import android.os.Bundle;


import android.support.v7.app.AppCompatActivity;


 


public class MainActivity extends AppCompatActivity {


 


    @Override


    protected void onCreate(Bundle savedInstanceState) {


        super.onCreate(savedInstanceState);


        setContentView(R.layout.activity_main);


    }


}

3. 项目的配置文件介绍

build.gradle (项目级)




// 项目级 build.gradle 文件


buildscript {


    repositories {


        google()


        jcenter()


    }


    dependencies {


        classpath 'com.android.tools.build:gradle:3.5.3'


    }


}


 


allprojects {


    repositories {


        google()


        jcenter()


    }


}


 


task clean(type: Delete) {


    delete rootProject.buildDir


}

build.gradle (应用级)




// 应用级 build.gradle 文件


apply plugin: 'com.android.application'


 


android {


    compileSdkVersion 29


    defaultConfig {


        applicationId "com.andremion.animatedicons"


        minSdkVersion 16


        targetSdkVersion 29


        versionCode 1


        versionName "1.0"


    }


    buildTypes {


        release {


            minifyEnabled false


            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'


        }


    }


}


 


dependencies {


    implementation fileTree(dir: 'libs', include: ['*.jar'])


    implementation 'androidx.appcompat:appcompat:1.1.0'


    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'


}

AndroidManifest.xml




<manifest xmlns:android="http://schemas.android.com/apk/res/android"


    package="com.andremion.animatedicons">


 


    <application


        android:allowBackup="true"


        android:icon="@mipmap/ic_launcher"


        android:label="@string/app_name"


        android:roundIcon="@mipmap/ic_launcher_round"


        android:supportsRtl="true"


        android:theme="@style/AppTheme">


        <activity android:name=".MainActivity">


            <intent-filter>


                <action



Android-Animated-IconsHow to improve the user experience using animated icons with vector drawables on Android项目地址:https://gitcode.com/gh_mirrors/an/Android-Animated-Icons

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...