android sample app
1.0.0
要運行應用程序,您需要從TMBD提供API密鑰。當您獲取密鑰時,請在本地環境中添加以下變量:
API_KEY_TMDB = Your API Key
如何在Mac / Windows中設置環境變量
為了保持代碼的樣式和質量,使用了波紋管靜態分析工具。所有這些都使用正確的配置,您可以在項目root Directory config/.{toolName}中找到它們。
| 工具 | 配置文件 | 檢查命令 | 修復命令 |
|---|---|---|---|
| detekt | .detekt.yml | ./gradlew detekt | - |
| ktlint | - | ./gradlew ktlint | ./gradlew ktlintFormat |
| 一塵不染 | - | ./gradlew spotlessCheck | ./gradlew spotlessApply |
| 皮棉 | .lint.xml | ./gradlew lint | - |
| Gradle版本插件 | - | ./gradlew dependencyUpdates | - |
除Gradle版本插件外,所有這些工具均集成在預先承諾的git鉤中,以確保所有靜態分析和測試都通過,然後才能進行更改。可以選擇運行Gradle版本插件。跳過它們以獲取特定的提交,請在您的git命令中添加此選項:
git commit --no-verify強烈建議修復破損的代碼樣式。有一個Gradle任務,可以為您執行ktlintFormat ,而spotlessApply :
./gradlew reformat預密碼的GIT鉤具有與CircleCi完全相同的檢查,並在此腳本中定義。此步驟確保所有人都遵守已建立的規則。但是,連續集成最終將被驗證,即更改是正確的。
如果您想進一步了解命名慣例,代碼樣式以及更多信息,請查看我們的Android指南存儲庫。
查看:渲染UI並委派用戶操作以查看模型
ViewModel:可以具有簡單的UI邏輯,但大多數時候只能從USECase獲取數據
用戶酶:包含所有業務規則,它們以單個責任原則的方式寫
存儲庫:單個數據源。負責從一個或多個數據源獲取數據
Copyright 2020 adesso Turkey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.