更新弹窗UI修改
This commit is contained in:
@@ -68,8 +68,8 @@ public class NumberProgressBar extends View {
|
||||
private String mPrefix = "";
|
||||
|
||||
|
||||
private final int default_text_color = Color.rgb(255, 137, 91);
|
||||
private final int default_reached_color = Color.rgb(255, 137, 91);
|
||||
private final int default_text_color = Color.rgb(95, 204, 228);
|
||||
private final int default_reached_color = Color.rgb(95, 204, 228);
|
||||
private final int default_unreached_color = Color.rgb(204, 204, 204);
|
||||
private final float default_progress_text_offset;
|
||||
private final float default_text_size;
|
||||
|
@@ -49,7 +49,6 @@ class UpdateDialogActivity : AppCompatActivity(), View.OnClickListener {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
overridePendingTransition(0, 0)
|
||||
title = ""
|
||||
setContentView(R.layout.dialog_update)
|
||||
init()
|
||||
}
|
||||
@@ -70,9 +69,7 @@ class UpdateDialogActivity : AppCompatActivity(), View.OnClickListener {
|
||||
|
||||
private fun initView() {
|
||||
val ibClose = findViewById<View>(R.id.ib_close)
|
||||
val vLine = findViewById<View>(R.id.line)
|
||||
val ivBg = findViewById<ImageView>(R.id.iv_bg)
|
||||
val tvTitle = findViewById<TextView>(R.id.tv_title)
|
||||
val tvSize = findViewById<TextView>(R.id.tv_size)
|
||||
val tvDescription = findViewById<TextView>(R.id.tv_description)
|
||||
progressBar = findViewById(R.id.np_bar)
|
||||
@@ -103,13 +100,8 @@ class UpdateDialogActivity : AppCompatActivity(), View.OnClickListener {
|
||||
btnUpdate.background = drawable
|
||||
}
|
||||
if (manager.forcedUpgrade) {
|
||||
vLine.visibility = View.GONE
|
||||
ibClose.visibility = View.GONE
|
||||
}
|
||||
if (manager.apkVersionName.isNotEmpty()) {
|
||||
tvTitle.text =
|
||||
String.format(resources.getString(R.string.dialog_new), manager.apkVersionName)
|
||||
}
|
||||
if (manager.apkSize.isNotEmpty()) {
|
||||
tvSize.text =
|
||||
String.format(resources.getString(R.string.dialog_new_size), manager.apkSize)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 88 KiB |
@@ -3,37 +3,21 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="140dp"
|
||||
android:background="@drawable/ic_dialog_default" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_white_radius_6"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="311dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/ic_dialog_default"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="发现新版v2.0.1可以下载啦!" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="136dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textColor="#757575"
|
||||
android:textSize="14sp"
|
||||
@@ -44,7 +28,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="136dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:overScrollMode="never">
|
||||
|
||||
@@ -53,9 +37,10 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.1"
|
||||
android:textColor="#757575"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#161958"
|
||||
android:textSize="12sp"
|
||||
tools:text="" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<com.tongdaxing.erban.upgrade.view.NumberProgressBar
|
||||
@@ -66,32 +51,42 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_update"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="@string/update"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white" />
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/ib_close"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_common_cancel"
|
||||
android:text="下次再说"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#5FCCE4"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_update"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:text="立即更新"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@android:color/white" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ib_close"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/ic_dialog_close" />
|
||||
|
||||
</LinearLayout>
|
Reference in New Issue
Block a user