Skip to content

Commit

Permalink
【ID871147007】合规5-在个人信息>>>用户ID后方添加一个“复制”的图标。
Browse files Browse the repository at this point in the history
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192871147007

Change-Id: I54f9ebe86e310af9fd252a45c11347007bd31b6f
  • Loading branch information
SundoggyNew committed Dec 31, 2021
1 parent d9021ef commit eee6bbb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup.MarginLayoutParams
import android.widget.TextView
import android.widget.Toast
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.JSONObject
import com.tencent.iot.explorer.link.App
Expand Down Expand Up @@ -90,6 +91,7 @@ class UserInfoActivity : PActivity(), UserInfoView, View.OnClickListener, View.O

override fun setListener() {
iv_back.setOnClickListener { finish() }
iv_user_id_copy.setOnClickListener(this)
tv_title_nick.setOnClickListener(this)
tv_user_info_logout.setOnClickListener(this)
tv_user_id.setOnLongClickListener(this)
Expand All @@ -116,6 +118,11 @@ class UserInfoActivity : PActivity(), UserInfoView, View.OnClickListener, View.O

override fun onClick(v: View?) {
when (v) {
iv_user_id_copy -> {
// 获取AndroidID,并保存至剪切板
Utils.copy(this, App.data.userInfo.UserID)
Toast.makeText(App.activity, "内容已复制", Toast.LENGTH_LONG).show()
}
tv_title_avatar, iv_avatar, iv_avatar_arrow -> {
showCameraPopup()
}
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/res/layout/activity_user_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,24 @@
android:id="@+id/tv_user_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginEnd="40dp"
android:textColor="@color/gray_6C7078"
android:textSize="@dimen/ts_14"
app:layout_constraintBottom_toBottomOf="@+id/tv_title_user_id"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_title_user_id" />

<ImageView
android:id="@+id/iv_user_id_copy"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginEnd="16dp"
android:rotation="180"
android:src="@mipmap/user_id_copy"
app:layout_constraintBottom_toBottomOf="@+id/tv_title_user_id"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_title_user_id" />

<View
android:id="@+id/line_user_id"
android:layout_width="match_parent"
Expand Down
Binary file added app/src/main/res/mipmap-hdpi/user_id_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/user_id_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/user_id_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxhdpi/user_id_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxxhdpi/user_id_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eee6bbb

Please sign in to comment.