优化:界面布局&用户体验优化
parent
ea3fc586af
commit
d01ab9838d
@ -0,0 +1,85 @@
|
|||||||
|
package com.idormy.sms.forwarder.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.idormy.sms.forwarder.MainActivity;
|
||||||
|
import com.idormy.sms.forwarder.R;
|
||||||
|
import com.idormy.sms.forwarder.RuleActivity;
|
||||||
|
import com.idormy.sms.forwarder.SenderActivity;
|
||||||
|
import com.idormy.sms.forwarder.SettingActivity;
|
||||||
|
|
||||||
|
public class StepBar extends LinearLayout {
|
||||||
|
//控件
|
||||||
|
private final TextView txStep1;
|
||||||
|
private final TextView txStep2;
|
||||||
|
private final TextView txStep3;
|
||||||
|
private final TextView txStep4;
|
||||||
|
private final TextView tvStep1;
|
||||||
|
private final TextView tvStep2;
|
||||||
|
private final TextView tvStep3;
|
||||||
|
private final TextView tvStep4;
|
||||||
|
|
||||||
|
public StepBar(final Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
//初始化界面
|
||||||
|
View view = LayoutInflater.from(context).inflate(R.layout.step_bar, this);
|
||||||
|
//绑定
|
||||||
|
txStep1 = findViewById(R.id.txStep1);
|
||||||
|
txStep2 = findViewById(R.id.txStep2);
|
||||||
|
txStep3 = findViewById(R.id.txStep3);
|
||||||
|
txStep4 = findViewById(R.id.txStep4);
|
||||||
|
tvStep1 = findViewById(R.id.tvStep1);
|
||||||
|
tvStep2 = findViewById(R.id.tvStep2);
|
||||||
|
tvStep3 = findViewById(R.id.tvStep3);
|
||||||
|
tvStep4 = findViewById(R.id.tvStep4);
|
||||||
|
//初始化函数
|
||||||
|
init(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(final Context context) {
|
||||||
|
|
||||||
|
tvStep1.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SettingActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep1.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SettingActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
tvStep2.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SenderActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep2.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SenderActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
tvStep3.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), RuleActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep3.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), RuleActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
tvStep4.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), MainActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep4.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), MainActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,10 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24"
|
|
||||||
android:tint="?attr/colorControlNormal">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
|
||||||
</vector>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,74 +1,74 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:tools="http://schemas.android.com/tools"
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit1"
|
android:id="@+id/edit1"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/point"
|
||||||
android:text="@string/point" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit2"
|
android:id="@+id/edit2"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/point"
|
||||||
android:text="@string/point" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit3"
|
android:id="@+id/edit3"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/point"
|
||||||
android:text="@string/point" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit4"
|
android:id="@+id/edit4"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
</merge>
|
</merge>
|
@ -0,0 +1,196 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#ffffff"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#aadcdcdc" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_current"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_1"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_current"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/step_rectangle_current"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_current"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_current"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_2"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_normal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_3"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_normal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_4"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:layout_marginBottom="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep1"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_1"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep2"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_2"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep3"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_3"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep4"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_4"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue