房间相册 上传照片UI
This commit is contained in:
@@ -1086,7 +1086,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".avroom.activity.RoomAlbumActivity" />
|
||||
<activity android:name=".avroom.room_album.RoomAlbumActivity" />
|
||||
|
||||
</application>
|
||||
|
||||
|
@@ -1,51 +0,0 @@
|
||||
package com.yizhuan.erban.avroom.fragment
|
||||
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.databinding.FragmentRoomAlbumBinding
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
|
||||
|
||||
class RoomAlbumFragment : BaseViewBindingFragment<FragmentRoomAlbumBinding>() {
|
||||
|
||||
private val viewModel: RoomAlbumViewModel by viewModels()
|
||||
|
||||
override fun init() {
|
||||
binding.recyclerView.layoutManager = GridLayoutManager(context, 2)
|
||||
val offset = resources.getDimensionPixelOffset(R.dimen.dp_15)
|
||||
binding.recyclerView.addItemDecoration(
|
||||
GridSpacingItemNewDecoration(
|
||||
offset,
|
||||
offset,
|
||||
true
|
||||
)
|
||||
)
|
||||
binding.recyclerView.adapter =
|
||||
object : BaseQuickAdapter<Int, BaseViewHolder>(R.layout.item_room_album) {
|
||||
override fun convert(helper: BaseViewHolder, item: Int?) {
|
||||
//ImageLoadUtils.loadImageWithBlur(
|
||||
// context,
|
||||
// "https://image.hfighting.com/FsElQzIALqAixbAT56riNMotkAZR?imageslim",
|
||||
// helper.getView(R.id.iv_pic),
|
||||
// 25, 4
|
||||
//)
|
||||
|
||||
}
|
||||
}.apply {
|
||||
val list = mutableListOf<Int>()
|
||||
for (i in 0 until 20) {
|
||||
list.add(0)
|
||||
}
|
||||
setNewData(list)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance() = RoomAlbumFragment()
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
package com.yizhuan.erban.avroom.fragment
|
||||
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
|
||||
class RoomAlbumViewModel : BaseViewModel() {
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
package com.yizhuan.erban.avroom.model
|
||||
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
|
||||
class RoomAlbumViewModel :BaseViewModel(){
|
||||
init {
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.yizhuan.erban.avroom.room_album
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity
|
||||
|
||||
data class PhotoItem(val path: String, val type: Int) : MultiItemEntity {
|
||||
override fun getItemType(): Int {
|
||||
return type
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TYPE_PHOTO = 0
|
||||
const val TYPE_ADD = 1
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.yizhuan.erban.avroom.activity
|
||||
package com.yizhuan.erban.avroom.room_album
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@@ -11,8 +11,6 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.fragment.RoomAlbumFragment
|
||||
import com.yizhuan.erban.avroom.model.RoomAlbumViewModel
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivityRoomAlbumBinding
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
||||
@@ -30,12 +28,10 @@ class RoomAlbumActivity : BaseViewBindingActivity<ActivityRoomAlbumBinding>() {
|
||||
|
||||
override fun init() {
|
||||
initTitleBar(getString(R.string.room_album))
|
||||
mTitleBar.setBackgroundResource(R.color.color_F5F6FA)
|
||||
mTitleBar.setBackgroundResource(R.color.white)
|
||||
|
||||
val titles = listOf("我的照片", "普通照片", "解鎖照片")
|
||||
|
||||
//binding.tvUpload.setImageResource(R.drawable.bg_activity_room_album_upload)
|
||||
|
||||
binding.indicator.navigator = CommonNavigator(this).apply {
|
||||
isAdjustMode = true
|
||||
|
||||
@@ -99,41 +95,10 @@ class RoomAlbumActivity : BaseViewBindingActivity<ActivityRoomAlbumBinding>() {
|
||||
}
|
||||
}
|
||||
|
||||
//binding.vp.adapter = object :
|
||||
// BaseQuickAdapter<String, BaseViewHolder>(R.layout.common_recyclerview, titles) {
|
||||
// override fun convert(helper: BaseViewHolder, item: String) {
|
||||
// val recyclerView = helper.getView<RecyclerView>(R.id.recycler_view)
|
||||
// recyclerView.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
// recyclerView.layoutManager = GridLayoutManager(this@RoomAlbumActivity, 2)
|
||||
// val offset = resources.getDimensionPixelOffset(R.dimen.dp_15)
|
||||
// recyclerView.addItemDecoration(
|
||||
// GridSpacingItemNewDecoration(
|
||||
// offset,
|
||||
// offset,
|
||||
// true
|
||||
// )
|
||||
// )
|
||||
// recyclerView.adapter =
|
||||
// object : BaseQuickAdapter<Int, BaseViewHolder>(R.layout.item_room_album) {
|
||||
// override fun convert(helper: BaseViewHolder, item: Int?) {
|
||||
// ImageLoadUtils.loadImageWithBlur(
|
||||
// context,
|
||||
// "https://image.hfighting.com/FsElQzIALqAixbAT56riNMotkAZR?imageslim",
|
||||
// helper.getView(R.id.iv_pic),
|
||||
// 25, 4
|
||||
// )
|
||||
//
|
||||
// }
|
||||
// }.apply {
|
||||
// val list = mutableListOf<Int>()
|
||||
// for (i in 0 until 20) {
|
||||
// list.add(0)
|
||||
// }
|
||||
// setNewData(list)
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
binding.tvUpload.setOnClickListener {
|
||||
UploadRoomAlbumDialogFragment().show(supportFragmentManager, UploadRoomAlbumDialogFragment::class.java.simpleName)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
@@ -0,0 +1,74 @@
|
||||
package com.yizhuan.erban.avroom.room_album
|
||||
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.databinding.FragmentRoomAlbumBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
|
||||
|
||||
class RoomAlbumFragment : BaseViewBindingFragment<FragmentRoomAlbumBinding>() {
|
||||
|
||||
private val viewModel by activityViewModels<RoomAlbumViewModel>()
|
||||
|
||||
override fun init() {
|
||||
binding.recyclerView.layoutManager = GridLayoutManager(context, 2)
|
||||
val offset = resources.getDimensionPixelOffset(R.dimen.dp_15)
|
||||
binding.recyclerView.addItemDecoration(
|
||||
GridSpacingItemNewDecoration(
|
||||
offset,
|
||||
offset,
|
||||
true
|
||||
)
|
||||
)
|
||||
binding.recyclerView.adapter =
|
||||
object : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_room_album) {
|
||||
override fun convert(helper: BaseViewHolder, item: String) {
|
||||
ImageLoadUtils.loadImageWithBlur(
|
||||
context,
|
||||
item,
|
||||
helper.getView(R.id.iv_pic),
|
||||
25, 4
|
||||
)
|
||||
}
|
||||
|
||||
override fun onCreateDefViewHolder(
|
||||
parent: ViewGroup?,
|
||||
viewType: Int
|
||||
): BaseViewHolder {
|
||||
val holder = super.onCreateDefViewHolder(parent, viewType)
|
||||
holder.addOnClickListener(R.id.v_action)
|
||||
return holder
|
||||
}
|
||||
|
||||
}.apply {
|
||||
|
||||
viewModel.myPhotosLiveData.observe(this@RoomAlbumFragment) {
|
||||
setNewData(it)
|
||||
}
|
||||
|
||||
setOnItemChildClickListener { _, view, position ->
|
||||
if (view.id == R.id.v_action) {
|
||||
val buttonItems = listOf(
|
||||
ButtonItem("發送到公屏", {}),
|
||||
ButtonItem("刪除照片", {}),
|
||||
ButtonItem("查看大圖", {})
|
||||
)
|
||||
dialogManager.showCommonPopupDialog(buttonItems)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance() = RoomAlbumFragment()
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.yizhuan.erban.avroom.room_album
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
|
||||
class RoomAlbumViewModel : BaseViewModel() {
|
||||
|
||||
private val _myPhotosLiveData = MutableLiveData<MutableList<String>>()
|
||||
val myPhotosLiveData: LiveData<MutableList<String>> = _myPhotosLiveData
|
||||
|
||||
init {
|
||||
loadMyPhotos()
|
||||
}
|
||||
|
||||
fun loadMyPhotos() {
|
||||
safeLaunch {
|
||||
val list = mutableListOf<String>()
|
||||
for (i in 0 until 20) {
|
||||
list.add("https://image.hfighting.com/FsElQzIALqAixbAT56riNMotkAZR")
|
||||
}
|
||||
|
||||
_myPhotosLiveData.value = list
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,159 @@
|
||||
package com.yizhuan.erban.avroom.room_album
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogRoomAlbumUploadBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
|
||||
import com.yizhuan.xchat_android_library.common.photo.PhotoProvider
|
||||
import com.yizhuan.xchat_android_library.common.photo.PhotoProvider.photoProvider
|
||||
import com.yizhuan.xchat_android_library.easypermisssion.EasyPermissions
|
||||
|
||||
class UploadRoomAlbumDialogFragment : BottomSheetDialogFragment() {
|
||||
|
||||
private var _binding: DialogRoomAlbumUploadBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private lateinit var photoAdapter: BaseMultiItemQuickAdapter<PhotoItem, BaseViewHolder>
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NO_TITLE, R.style.ErbanBottomSheetDialog)
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = super.onCreateDialog(savedInstanceState)
|
||||
dialog.window?.attributes?.apply {
|
||||
width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
height = WindowManager.LayoutParams.MATCH_PARENT
|
||||
}
|
||||
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = DialogRoomAlbumUploadBinding.inflate(layoutInflater, container, false)
|
||||
|
||||
binding.rvPhoto.layoutManager = GridLayoutManager(context, 3)
|
||||
binding.rvPhoto.addItemDecoration(GridSpacingItemNewDecoration(resources.getDimensionPixelOffset(R.dimen.dp_18), true))
|
||||
|
||||
photoAdapter =
|
||||
object : BaseMultiItemQuickAdapter<PhotoItem, BaseViewHolder>(
|
||||
mutableListOf(
|
||||
PhotoItem(
|
||||
"",
|
||||
PhotoItem.TYPE_ADD
|
||||
)
|
||||
)
|
||||
) {
|
||||
init {
|
||||
addItemType(PhotoItem.TYPE_PHOTO, R.layout.item_publish_image)
|
||||
addItemType(PhotoItem.TYPE_ADD, R.layout.item_add_picture)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val holder = super.onCreateViewHolder(parent, viewType)
|
||||
if (viewType == PhotoItem.TYPE_PHOTO) {
|
||||
holder.setGone(R.id.iv_gif_tag, false)
|
||||
holder.setImageResource(R.id.iv_delete, R.drawable.ic_delete_room_album)
|
||||
holder.addOnClickListener(R.id.iv_delete)
|
||||
}
|
||||
return holder
|
||||
}
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: PhotoItem) {
|
||||
if (item.type == PhotoItem.TYPE_ADD) {
|
||||
return
|
||||
}
|
||||
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_photo), item.path, false, 8)
|
||||
}
|
||||
}.apply {
|
||||
setOnItemChildClickListener { _, view, position ->
|
||||
if (view.id == R.id.iv_delete) {
|
||||
remove(position)
|
||||
}
|
||||
}
|
||||
setOnItemClickListener { _, view, position ->
|
||||
if (position == data.size - 1) {
|
||||
checkStoragePermission()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.rvPhoto.adapter = photoAdapter
|
||||
|
||||
binding.rgType.setOnCheckedChangeListener { group, checkedId ->
|
||||
}
|
||||
return binding.root
|
||||
}
|
||||
|
||||
private fun checkStoragePermission() {
|
||||
if (!EasyPermissions.hasPermissions(
|
||||
requireContext(),
|
||||
if (Build.VERSION.SDK_INT >= 33) Manifest.permission.READ_MEDIA_IMAGES
|
||||
else Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
)
|
||||
) {
|
||||
EasyPermissions.requestPermissions(
|
||||
this,
|
||||
getString(R.string.permission_storage_rationale),
|
||||
100,
|
||||
if (Build.VERSION.SDK_INT >= 33) Manifest.permission.READ_MEDIA_IMAGES
|
||||
else Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
)
|
||||
} else {
|
||||
photoProvider(
|
||||
this,
|
||||
7 - photoAdapter.data.size,
|
||||
true,
|
||||
200,
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode != Activity.RESULT_OK) {
|
||||
return
|
||||
}
|
||||
if (requestCode == 200) {
|
||||
PhotoProvider.getResultPathListAsync(data) {
|
||||
val list = photoAdapter.data
|
||||
val removeLast = list.removeLast()
|
||||
it?.forEach { item ->
|
||||
list.add(PhotoItem(item, PhotoItem.TYPE_PHOTO))
|
||||
}
|
||||
if (list.size < 6) {
|
||||
list.add(removeLast)
|
||||
}
|
||||
photoAdapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
}
|
8
app/src/main/res/color/color_selector_radio_button.xml
Normal file
8
app/src/main/res/color/color_selector_radio_button.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:color="@color/white" android:state_checked="true" />
|
||||
|
||||
<item android:color="@color/color_9168FA" />
|
||||
|
||||
</selector>
|
BIN
app/src/main/res/drawable-xhdpi/ic_delete_room_album.webp
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_delete_room_album.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 290 B |
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
7
app/src/main/res/drawable/bg_f5f6fa_6.xml
Normal file
7
app/src/main/res/drawable/bg_f5f6fa_6.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="@dimen/dp_6" />
|
||||
|
||||
<solid android:color="@color/color_F5F6FA" />
|
||||
</shape>
|
14
app/src/main/res/drawable/bg_room_album_add_picture.xml
Normal file
14
app/src/main/res/drawable/bg_room_album_add_picture.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/dp_1"
|
||||
android:color="@color/color_B3B3C3"
|
||||
android:dashWidth="@dimen/dp_2"
|
||||
android:dashGap="@dimen/dp_2" />
|
||||
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
|
||||
<solid android:color="@color/color_F5F6FA" />
|
||||
|
||||
</shape>
|
18
app/src/main/res/drawable/selector_room_album_upload.xml
Normal file
18
app/src/main/res/drawable/selector_room_album_upload.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_checked="true">
|
||||
<shape>
|
||||
<solid android:color="@color/color_9168FA" />
|
||||
<corners android:radius="@dimen/dp_6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape>
|
||||
<stroke android:width="@dimen/dp_1" android:color="@color/color_9168FA" />
|
||||
<corners android:radius="@dimen/dp_6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
155
app/src/main/res/layout/dialog_room_album_upload.xml
Normal file
155
app/src/main/res/layout/dialog_room_album_upload.xml
Normal file
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_dialog_share">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_photo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:padding="@dimen/dp_4"
|
||||
android:src="@drawable/chat_popup_game_close"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/bg_f5f6fa_6"
|
||||
app:layout_constraintTop_toBottomOf="@id/rv_photo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:text="@string/photo_type"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_type"
|
||||
app:layout_constraintStart_toStartOf="@id/v_type"
|
||||
app:layout_constraintTop_toTopOf="@id/v_type" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:checkedButton="@id/rb_common"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_type"
|
||||
app:layout_constraintEnd_toEndOf="@id/v_type"
|
||||
app:layout_constraintTop_toTopOf="@id/v_type">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_common"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:background="@drawable/selector_room_album_upload"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:text="@string/normal_photo"
|
||||
android:textColor="@color/color_selector_radio_button"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_locked"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:background="@drawable/selector_room_album_upload"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:text="@string/locked_photo"
|
||||
android:textColor="@color/color_selector_radio_button"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</RadioGroup>
|
||||
|
||||
<View
|
||||
android:id="@+id/v_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/bg_f5f6fa_6"
|
||||
app:layout_constraintTop_toBottomOf="@id/v_type" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:text="@string/unlock_gift"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintStart_toStartOf="@id/v_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/v_gift" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:text="當前無需選擇解鎖禮物"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_gift_more"
|
||||
app:layout_constraintTop_toTopOf="@id/v_gift" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_more"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:src="@drawable/ic_arrow_more_publish"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintEnd_toEndOf="@id/v_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/v_gift" />
|
||||
|
||||
<com.lihang.ShadowLayout
|
||||
android:id="@+id/sl_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_48"
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
app:hl_cornerRadius="@dimen/dp_24"
|
||||
app:hl_endColor="@color/color_CF70FF"
|
||||
app:hl_shadowHidden="true"
|
||||
app:hl_startColor="@color/color_5CF1FF"
|
||||
app:layout_constraintTop_toBottomOf="@id/v_gift">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="確認上傳"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
</com.lihang.ShadowLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_42"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/sl_confirm" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
38
app/src/main/res/layout/item_add_picture.xml
Normal file
38
app/src/main/res/layout/item_add_picture.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout_gravity="center"
|
||||
tools:layout_width="@dimen/dp_100">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_room_album_add_picture"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_47"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:src="@drawable/ic_dialog_room_album_upload_gallery_"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="每次最多上傳6張"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_pic" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -33,7 +33,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/iv_pic" />
|
||||
|
||||
<View
|
||||
android:id="@+id/iv_action"
|
||||
android:id="@+id/v_action"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:background="@drawable/bg_room_album_action"
|
||||
|
@@ -5136,5 +5136,9 @@
|
||||
<string name="tips_fairy_resolve_high">分解傳說精靈將隨機獲得400-500個碎片</string>
|
||||
<string name="upload_picture">上傳照片</string>
|
||||
<string name="room_album">房間相冊</string>
|
||||
<string name="photo_type">照片類型</string>
|
||||
<string name="normal_photo">普通照片</string>
|
||||
<string name="locked_photo">解鎖照片</string>
|
||||
<string name="unlock_gift">解鎖禮物</string>
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user