开源项目 anchoredbottomsheet 使用教程

随笔1天前发布 哒琳
7 0 0

开源项目 anchoredbottomsheet 使用教程

anchoredbottomsheetiOS Maps-like bottom sheet with anchor points and reusable view项目地址:https://gitcode.com/gh_mirrors/an/anchoredbottomsheet

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




anchoredbottomsheet/


├── app/


│   ├── build.gradle


│   ├── proguard-rules.pro


│   └── src/


│       ├── androidTest/


│       ├── main/


│       │   ├── java/


│       │   │   └── com.example.anchoredbottomsheet/


│       │   │       ├── MainActivity.java


│       │   │       └── ...


│       │   ├── res/


│       │   │   ├── layout/


│       │   │   │   ├── activity_main.xml


│       │   │   │   └── ...


│       │   │   ├── values/


│       │   │   │   ├── strings.xml


│       │   │   │   └── ...


│       │   │   └── ...


│       │   └── AndroidManifest.xml


│       └── test/


├── build.gradle


├── settings.gradle


└── ...

app/: 包含应用程序的主要代码和资源。
build.gradle: 应用程序的构建脚本。proguard-rules.pro: ProGuard 规则文件。src/: 源代码目录。
androidTest/: 用于 Android 测试的代码。main/: 主要代码和资源。
java/: Java 源代码。
com.example.anchoredbottomsheet/: 主应用程序包。
MainActivity.java: 主活动文件。: 其他 Java 文件。 res/: 资源文件。
layout/: 布局文件。
activity_main.xml: 主活动布局文件。: 其他布局文件。 values/: 值资源文件。
strings.xml: 字符串资源文件。: 其他值资源文件。 : 其他资源文件。 AndroidManifest.xml: 应用程序清单文件。 test/: 用于单元测试的代码。 build.gradle: 项目级别的构建脚本。settings.gradle: 项目设置文件。: 其他项目文件和目录。

2. 项目的启动文件介绍

MainActivity.java: 这是应用程序的主活动文件,负责启动应用程序并加载主界面。




package com.example.anchoredbottomsheet;


 


import android.os.Bundle;


import androidx.appcompat.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()


        mavenCentral()


    }


    dependencies {


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


    }


}


 


allprojects {


    repositories {


        google()


        mavenCentral()


    }


}


 


// 应用程序级别的 build.gradle


apply plugin: 'com.android.application'


 


android {


    compileSdkVersion 30


    defaultConfig {


        applicationId "com.example.anchoredbottomsheet"


        minSdkVersion 21


        targetSdkVersion 30


        versionCode 1


        versionName "1.0"


    }


    buildTypes {


        release {


            minifyEnabled false


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


        }


    }


}


 


dependencies {


    implementation 'androidx.appcompat:appcompat:1.3.1'


    implementation 'com.google.android.material:material:1.4.0'


    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'


}

AndroidManifest.xml: 这是应用程序的清单文件,包含应用程序的基本信息、权限和活动声明。




<manifest xmlns



anchoredbottomsheetiOS Maps-like bottom sheet with anchor points and reusable view项目地址:https://gitcode.com/gh_mirrors/an/anchoredbottomsheet

© 版权声明

相关文章

暂无评论

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