我的 UI
This commit is contained in:
parent
64078445df
commit
a2b8a6700a
|
|
@ -15,7 +15,7 @@
|
|||
android:id="@+id/top_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/vididinapp_feature_mine_bg_top"
|
||||
android:background="@drawable/mine_bg_top"
|
||||
app:layout_constraintDimensionRatio="642:360"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
@ -36,9 +36,8 @@
|
|||
android:id="@+id/avatar_view"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@color/gray3"
|
||||
android:src="@mipmap/temp"
|
||||
app:scaleType="centerCrop"
|
||||
app:src="@mipmap/img_1"
|
||||
app:isCircle="true" />
|
||||
|
||||
|
||||
|
|
@ -91,7 +90,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/temp" />
|
||||
android:src="@mipmap/mine_privcy" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_option_political"
|
||||
|
|
@ -112,7 +111,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/temp" />
|
||||
android:src="@mipmap/icon_arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
|
@ -131,7 +130,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/temp" />
|
||||
android:src="@mipmap/mine_version" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_option_versao"
|
||||
|
|
@ -152,7 +151,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/temp" />
|
||||
android:src="@mipmap/icon_arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
@ -170,7 +169,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/temp" />
|
||||
android:src="@mipmap/mine_feedback" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_option_feedback"
|
||||
|
|
@ -191,7 +190,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/temp" />
|
||||
android:src="@mipmap/icon_arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 914 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
|
|
@ -8,6 +8,7 @@ import androidx.annotation.AttrRes
|
|||
import com.ama.core.architecture.R
|
||||
import androidx.core.content.withStyledAttributes
|
||||
import androidx.core.graphics.withSave
|
||||
import com.ama.core.architecture.util.ResUtil
|
||||
|
||||
class CircleImageView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
|
@ -16,9 +17,10 @@ class CircleImageView @JvmOverloads constructor(
|
|||
) : View(context, attrs, defStyleAttr) {
|
||||
|
||||
private var bitmap: Bitmap? = null
|
||||
private val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
private val mPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
isAntiAlias = true
|
||||
isDither = true
|
||||
color = ResUtil.getColor(R.color.gray_9)
|
||||
}
|
||||
private val drawRect = RectF()
|
||||
private var scaleType = ScaleType.CENTER_CROP
|
||||
|
|
@ -39,17 +41,15 @@ class CircleImageView @JvmOverloads constructor(
|
|||
context.withStyledAttributes(
|
||||
attrs, R.styleable.ProtoImageView, defStyleAttr, 0
|
||||
) {
|
||||
|
||||
val srcResource = getResourceId(R.styleable.ProtoImageView_src, 0)
|
||||
if (srcResource != 0) {
|
||||
setImageResource(srcResource)
|
||||
}
|
||||
|
||||
val scaleTypeIndex = getInt(R.styleable.ProtoImageView_imageScaleType, 2)
|
||||
val scaleTypeIndex = getInt(R.styleable.ProtoImageView_scaleType, 2)
|
||||
scaleType = ScaleType.values().getOrElse(scaleTypeIndex) { ScaleType.CENTER_CROP }
|
||||
roundRadius = getDimension(R.styleable.ProtoImageView_roundRadius, 0f)
|
||||
isCircle = getBoolean(R.styleable.ProtoImageView_isCircle, false)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +149,8 @@ class CircleImageView @JvmOverloads constructor(
|
|||
if (isCircle || roundRadius > 0) {
|
||||
clipPath(path)
|
||||
}
|
||||
drawBitmap(bitmap, null, drawRect, paint)
|
||||
drawRect(drawRect, mPaint)
|
||||
drawBitmap(bitmap, null, drawRect, mPaint)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<declare-styleable name="ProtoImageView" tools:ignore="ResourceName">
|
||||
<attr name="src" format="reference" />
|
||||
<attr name="imageScaleType">
|
||||
<attr name="scaleType">
|
||||
<enum name="fitXY" value="0" />
|
||||
<enum name="center" value="1" />
|
||||
<enum name="centerCrop" value="2" />
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@
|
|||
<color name="transparent">00000000</color>
|
||||
<color name="title_bar_default_bg">#FF6B9E</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="gray_3">#333333</color>
|
||||
<color name="gray_9">#999999</color>
|
||||
|
||||
|
||||
</resources>
|
||||
Loading…
Reference in New Issue