# Ohos-Intent-Library **Repository Path**: archermind-ti/Ohos-Intent-Library ## Basic Information - **Project Name**: Ohos-Intent-Library - **Description**: A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation codes like Share, Contacts, Email and etc, which you can easily use. 原项目Doc地址:https://github.com/mohammadima3oud/Android-Intent-Library - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2021-04-12 - **Last Updated**: 2022-03-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Ohos-Intent-Library ### 项目介绍 一个可以为您节省大量时间的库,无需编写相同的Intent创建代码。它由许多Intent创建代码组成,如共享、联系人、电子邮件等,您可以轻松使用 ### 效果展示 ### 安装教程 #### 方式一 1. 下载Ohos-Intent-Library的har包 2. 将har包放入需要的module的libs下 3. 在module中添加对这个har包的引用 ``` dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) …… } ``` 4. gradle sync #### 方式二 在project的build.gradle中添加`mavenCentral()`的引用 ``` allprojects { repositories { mavenCentral() } } ``` 在entry的build.gradle中添加依赖 ``` dependencies { ... implementation 'com.gitee.archermind-ti:Ohos-Intent-Library:1.0.0' ... } ``` ### 使用说明 ### Showing the intent immediately ``` SettingIntents.from(this).setting().show(); SettingIntents.from(this).applicationSetting().show(); ``` ### Build the intent and show it your self ``` startAbility(SettingIntents.from(this).setting().build()); startAbility(SettingIntents.from(this).applicationSetting().build()); ``` ## 📄List of Intents - ### BrowserIntents ``` openBrowser() openLink(String url) openLink(Uri uri) openGoogle() ``` Example ``` BrowserIntents.from(this).openBrowser().show(); ``` - ### CalendarIntents ``` openCalendar() ``` Example ``` CalendarIntents.from(this).openCalendar().show(); ``` - ### CameraIntents ``` openPhotoCamera() openVideoCamera() capturePhoto(Uri location, String fileName) captureVideo(Uri location, String fileName) ``` Example ``` startAbilityForResult(CameraIntents.from(this).openPhotoCamera().build(), RequestTag.IMAGE_CAMERA); ``` - ### ContactIntents ``` openContacts() viewContact(String name) pickContact() pickSpecificContactData() ``` Example ``` ContactIntents.from(this).openContacts().show(); ``` - ### FileIntents ``` fileChooser() pickFile() pickImageFile() pickImageFile(Boolean allowMultiple, Boolean localOnly) ``` Example ``` startAbilityForResult(FileIntents.from(this).fileChooser().build(), RequestTag.FILE_CHOOSE); ``` - ### GalleryIntents ``` openGallery() pickImage() ``` Example ``` startAbilityForResult(GalleryIntents.from(this).pickImage().build(), RequestTag.PICK_IMAGE); ``` - ### MediaIntents ``` playAudio(String url) showImage(String url) playVideo(String url) playYouTubeVideo(String videoId) ``` Example ``` MediaIntents.from(this).playYouTubeVideo("gOzdLhJG2EQ").show(); ``` - ### MusicIntents ``` openPlayMusic() ``` Example ``` MusicIntents.from(this).openPlayMusic().show(); ``` - ### PhoneIntents ``` showDialNumber() showDialNumber(String phoneNumber) callNumber(String phoneNumber) ``` Example ``` PhoneIntents.from(this).showDialNumber().show(); ``` - ### SearchIntents ``` searchInGooglePlay(String query) searchWeb(String query) ``` Example ``` SearchIntents.from(this).searchInGooglePlay("Instagram").show(); ``` - ### SettingIntents ``` setting() apnSetting() bluetoothSetting() dateSetting() displaySetting() localeSetting() securitySetting() wifiSetting() wirelessSetting() accessibilitySetting() applicationSetting() captioningSetting() castSetting() dreamSetting() airplaneModeSetting() inputMethodSetting() locationSourceSetting() internalStorageSetting() memoryCardSetting() homeSetting() nfcSetting() nfcSharingSetting() nfcPaymentSetting() printSetting() privacySetting() searchSetting() soundSetting() syncSetting() webViewSetting() vpnSetting() applicationDetailSetting(String packageName) applicationDevelopmentSetting() batterySaverSetting() dataRoamingSetting() deviceInfoSetting() hardKeyboardSetting() manageApplicationSetting() manageWriteSetting() networkOperatorSetting() notificationListenerSetting() usageAccessSetting() userDictionarySetting() voiceInputSetting() vrListenerSetting() wifiIpSetting() ignoreBatteryOptimizationSetting() manageAllApplicationSetting() manageDefaultAppsSetting() inputMethodSubtypeSetting() notificationPolicyAccessSetting() ignoreBackgroundDataRestrictionsSetting(String packageName) ``` Example ``` SettingIntents.from(this).setting().show(); ``` - ### ShareIntents ``` shareText(String subject, String message) shareText(String subject, String message, String chooserDialogTitle) ``` Example ``` ShareIntents.from(this).shareText("Subject example","message example").show(); ``` #### 调用差异 openharmony版本暂不提供闹钟、计算器、邮件、地图、短信、录音的Intent跳转 ### 版本迭代 - v1.0.0 ### License Copyright 2019 mohammadima3oud 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.