whellview,权限申请,emoji
This commit is contained in:
parent
d68d5f254b
commit
84181ccb7e
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
17
.idea/runConfigurations.xml
Normal file
17
.idea/runConfigurations.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -5,6 +5,8 @@ import android.view.WindowManager
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.hjq.permissions.OnPermissionCallback
|
||||
import com.hjq.permissions.XXPermissions
|
||||
import com.tenlionsoft.aimz_k.R
|
||||
import com.tenlionsoft.aimz_k.databinding.ActivityChatBinding
|
||||
import com.tenlionsoft.aimz_k.viewmodel.ChatPageViewModel
|
||||
@ -32,5 +34,40 @@ class ChatActivity : BaseActivity() {
|
||||
chatPageViewModel.showSendBtn.observe(this) {
|
||||
mBinding.ivSend.visibility = if (it) View.GONE else View.VISIBLE
|
||||
}
|
||||
mBinding.rpvEmoji.setOnEmojiPickedListener {
|
||||
mBinding.etMsg.append(it.emoji)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//XXPermissions.with(this)
|
||||
//// 申请单个权限
|
||||
//.permission(Permission.RECORD_AUDIO)
|
||||
//// 申请多个权限
|
||||
//.permission(Permission.Group.CALENDAR)
|
||||
//// 设置权限请求拦截器(局部设置)
|
||||
////.interceptor(new PermissionInterceptor())
|
||||
//// 设置不触发错误检测机制(局部设置)
|
||||
////.unchecked()
|
||||
//.request(object : OnPermissionCallback {
|
||||
//
|
||||
// override fun onGranted(permissions: MutableList<String>, allGranted: Boolean) {
|
||||
// if (!allGranted) {
|
||||
// toast("获取部分权限成功,但部分权限未正常授予")
|
||||
// return
|
||||
// }
|
||||
// toast("获取录音和日历权限成功")
|
||||
// }
|
||||
//
|
||||
// override fun onDenied(permissions: MutableList<String>, doNotAskAgain: Boolean) {
|
||||
// if (doNotAskAgain) {
|
||||
// toast("被永久拒绝授权,请手动授予录音和日历权限")
|
||||
// // 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
// XXPermissions.startPermissionActivity(context, permissions)
|
||||
// } else {
|
||||
// toast("获取录音和日历权限失败")
|
||||
// }
|
||||
// }
|
||||
//})
|
@ -77,11 +77,6 @@
|
||||
android:layout_height="match_parent" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -148,7 +143,109 @@
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_msg_add" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp">
|
||||
|
||||
<androidx.emoji2.emojipicker.EmojiPickerView
|
||||
android:id="@+id/rpv_emoji"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
<com.tenlionsoft.baselib.widget.wheel.WheelView
|
||||
android:id="@+id/wv_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rlPhoto"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivPhoto"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/selector_ctype_image" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/ivPhoto"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15px"
|
||||
android:text="相片"
|
||||
android:textSize="12sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rlVideo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivVideo"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/selector_ctype_video" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/ivVideo"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15px"
|
||||
android:text="视频"
|
||||
android:textSize="12sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rlFile"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFile"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/selector_ctype_file" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/ivFile"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15px"
|
||||
android:text="文件"
|
||||
android:textSize="12sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</layout>
|
@ -41,6 +41,7 @@ dependencies {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
api(libs.androidx.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.androidx.emoji2.emojipicker)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
@ -53,7 +54,6 @@ dependencies {
|
||||
api(libs.lifecycleViewModel)
|
||||
api(libs.rxkotlin)
|
||||
api(libs.glide)
|
||||
api(libs.permissionX)
|
||||
|
||||
api(libs.retrofit)
|
||||
api(libs.rxjava)
|
||||
@ -66,4 +66,6 @@ dependencies {
|
||||
api(libs.refreshHeader)
|
||||
api(libs.refreshFoot)
|
||||
api(libs.jjwt)
|
||||
api(libs.androidx.emoji2.emojipicker)
|
||||
api(libs.xxpermissions)
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.tenlionsoft.baselib.widget.wheel
|
||||
|
||||
import androidx.annotation.IntDef
|
||||
|
||||
|
||||
/**
|
||||
* 左右圆弧效果方向注解
|
||||
*/
|
||||
@IntDef(
|
||||
WheelView.CURVED_ARC_DIRECTION_LEFT,
|
||||
WheelView.CURVED_ARC_DIRECTION_CENTER,
|
||||
WheelView.CURVED_ARC_DIRECTION_RIGHT
|
||||
)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class CurvedArcDirection
|
@ -0,0 +1,11 @@
|
||||
package com.tenlionsoft.baselib.widget.wheel
|
||||
|
||||
import androidx.annotation.IntDef
|
||||
|
||||
|
||||
/**
|
||||
* 分割线类型注解
|
||||
*/
|
||||
@IntDef(WheelView.DIVIDER_TYPE_FILL, WheelView.DIVIDER_TYPE_WRAP)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class DividerType
|
@ -0,0 +1,10 @@
|
||||
package com.tenlionsoft.baselib.widget.wheel
|
||||
|
||||
import androidx.annotation.IntDef
|
||||
|
||||
/**
|
||||
* 文字对齐方式注解
|
||||
*/
|
||||
@IntDef(WheelView.TEXT_ALIGN_LEFT, WheelView.TEXT_ALIGN_CENTER, WheelView.TEXT_ALIGN_RIGHT)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class TextAlign
|
File diff suppressed because it is too large
Load Diff
@ -227,4 +227,71 @@
|
||||
</attr>
|
||||
|
||||
</declare-styleable>
|
||||
<declare-styleable name="WheelView">
|
||||
<!--文字大小-->
|
||||
<attr name="wv_textSize" format="dimension" />
|
||||
<!--是否自适应文字大小以完全显示过长的文字-->
|
||||
<attr name="wv_autoFitTextSize" format="boolean" />
|
||||
<!--文字对齐方式-->
|
||||
<attr name="wv_textAlign" format="enum">
|
||||
<enum name="left" value="0" />
|
||||
<enum name="center" value="1" />
|
||||
<enum name="right" value="2" />
|
||||
</attr>
|
||||
<!--文字距离边界的外边距-->
|
||||
<attr name="wv_textBoundaryMargin" format="dimension" />
|
||||
<!--未选中文字颜色-->
|
||||
<attr name="wv_normalItemTextColor" format="color" />
|
||||
<!--被选中的文字颜色-->
|
||||
<attr name="wv_selectedItemTextColor" format="color" />
|
||||
<!--行间距-->
|
||||
<attr name="wv_lineSpacing" format="dimension" />
|
||||
<!--数据为Integer类型时是否需要转换-->
|
||||
<attr name="wv_integerNeedFormat" format="boolean" />
|
||||
<!--Integer类型转换格式-->
|
||||
<attr name="wv_integerFormat" format="string" />
|
||||
|
||||
<!--可见item数-->
|
||||
<attr name="wv_visibleItems" format="integer" />
|
||||
<!--当前选中下标-->
|
||||
<attr name="wv_selectedItemPosition" format="integer" />
|
||||
<!--是否循环滚动-->
|
||||
<attr name="wv_cyclic" format="boolean" />
|
||||
|
||||
<!--是否显示分割线-->
|
||||
<attr name="wv_showDivider" format="boolean" />
|
||||
<!--分割线类型-->
|
||||
<attr name="wv_dividerType" format="enum">
|
||||
<enum name="fill" value="0" />
|
||||
<enum name="wrap" value="1" />
|
||||
</attr>
|
||||
<!--分割线颜色-->
|
||||
<attr name="wv_dividerColor" format="color" />
|
||||
<!--分割线高度-->
|
||||
<attr name="wv_dividerHeight" format="dimension" />
|
||||
<!--wrap类型下分割线内边距-->
|
||||
<attr name="wv_dividerPaddingForWrap" format="dimension" />
|
||||
|
||||
<!--是否是弯曲(3D)效果-->
|
||||
<attr name="wv_curved" format="boolean" />
|
||||
<!--弯曲(3D)效果左右圆弧偏移效果方向 可向指定方向偏移-->
|
||||
<attr name="wv_curvedArcDirection" format="enum">
|
||||
<enum name="left" value="0" />
|
||||
<enum name="center" value="1" />
|
||||
<enum name="right" value="2" />
|
||||
</attr>
|
||||
<!--弯曲(3D)效果左右圆弧偏移效果方向系数 偏移系数-->
|
||||
<attr name="wv_curvedArcDirectionFactor" format="float" />
|
||||
<!--弯曲(3D)效果选中后折射的偏移 与字体大小的比值,1为不偏移 越小偏移越明显-->
|
||||
<attr name="wv_curvedRefractRatio" format="float" />
|
||||
|
||||
<!--是否绘制选中区域-->
|
||||
<attr name="wv_drawSelectedRect" format="boolean" />
|
||||
<!--选中区域颜色-->
|
||||
<attr name="wv_selectedRectColor" format="color" />
|
||||
<!--选中区域圆角-->
|
||||
<attr name="wv_selectedRectRadius" format="reference|dimension"/>
|
||||
<attr name="wv_selectedRectLeftRadius" format="reference|dimension"/>
|
||||
<attr name="wv_selectedRectRightRadius" format="reference|dimension"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
@ -20,7 +20,6 @@ mmkv = "1.3.9"
|
||||
rxjava = "3.0.0"
|
||||
lifecycleViewModel = "2.8.5"
|
||||
glide = "4.16.0"
|
||||
permissionX = "1.8.1"
|
||||
lifecycleRuntimeKtx = "2.6.1"
|
||||
activityCompose = "1.8.0"
|
||||
composeBom = "2024.04.01"
|
||||
@ -34,8 +33,8 @@ lifecycleLivedataKtx = "2.6.1"
|
||||
fragmentKtx = "1.5.6"
|
||||
smartRefreshLayout = "2.1.0"
|
||||
jjwt = "3.10.3"
|
||||
|
||||
|
||||
emoji2Emojipicker = "1.0.0-alpha03"
|
||||
xxpermissions = "20.0"
|
||||
|
||||
|
||||
|
||||
@ -56,7 +55,6 @@ rxjava = { group = "io.reactivex.rxjava3", name = "rxjava", version.ref = "rxjav
|
||||
rxkotlin = { group = "io.reactivex.rxjava3", name = "rxkotlin", version.ref = "rxjava" }
|
||||
lifecycleViewModel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewModel" }
|
||||
glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }
|
||||
permissionX = { group = "com.guolindev.permissionx", name = "permissionx", version.ref = "permissionX" }
|
||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
||||
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||
@ -83,10 +81,9 @@ refreshHeaderCircle = { group = "io.github.scwang90", name = "refresh-header-cla
|
||||
refreshFoot = { group = "io.github.scwang90", name = "refresh-footer-classics", version.ref = "smartRefreshLayout" }
|
||||
refreshFalsify = { group = "io.github.scwang90", name = "refresh-header-falsify", version.ref = "smartRefreshLayout" }
|
||||
refreshMaterial = { group = "io.github.scwang90", name = "refresh-header-material", version.ref = "smartRefreshLayout" }
|
||||
#implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头
|
||||
#implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头
|
||||
jjwt = { group = "com.auth0", name = "java-jwt", version.ref = "jjwt" }
|
||||
|
||||
androidx-emoji2-emojipicker = { group = "androidx.emoji2", name = "emoji2-emojipicker", version.ref = "emoji2Emojipicker" }
|
||||
xxpermissions = { group = "com.github.getActivity", name = "XXPermissions", version.ref = "xxpermissions" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
|
@ -16,6 +16,7 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven(url = "https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user