mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-15 18:13:57 +00:00
优化界面布局
This commit is contained in:
parent
15b06bddff
commit
1e2e7c86d0
@ -35,7 +35,7 @@
|
||||
android:label="转发规则" />
|
||||
<activity
|
||||
android:name="com.idormy.sms.forwarder.SenderActivity"
|
||||
android:label="发送方设置" />
|
||||
android:label="发送方" />
|
||||
|
||||
<receiver android:name="com.idormy.sms.forwarder.BroadCastReceiver.RebootBroadcastReceiver">
|
||||
<intent-filter android:priority="2147483647">
|
||||
|
@ -5,6 +5,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.idormy.sms.forwarder.R;
|
||||
@ -61,6 +62,7 @@ public class RuleAdapter extends ArrayAdapter<RuleModel> {
|
||||
viewHolder = new ViewHolder();
|
||||
viewHolder.ruleMatch = view.findViewById(R.id.rule_match);
|
||||
viewHolder.ruleSender = view.findViewById(R.id.rule_sender);
|
||||
viewHolder.ruleSenderImage = view.findViewById(R.id.rule_sender_image);
|
||||
|
||||
// 将ViewHolder存储在View中(即将控件的实例存储在其中)
|
||||
view.setTag(viewHolder);
|
||||
@ -75,10 +77,9 @@ public class RuleAdapter extends ArrayAdapter<RuleModel> {
|
||||
viewHolder.ruleMatch.setText(ruleModel.getRuleMatch());
|
||||
if (!senderModel.isEmpty()) {
|
||||
viewHolder.ruleSender.setText(senderModel.get(0).getName());
|
||||
|
||||
viewHolder.ruleSenderImage.setImageResource(senderModel.get(0).getImageId());
|
||||
} else {
|
||||
viewHolder.ruleSender.setText("");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,6 +111,7 @@ public class RuleAdapter extends ArrayAdapter<RuleModel> {
|
||||
class ViewHolder {
|
||||
TextView ruleMatch;
|
||||
TextView ruleSender;
|
||||
ImageView ruleSenderImage;
|
||||
}
|
||||
|
||||
}
|
@ -3,17 +3,24 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rule_sender_image"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rule_match"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="10dp" />
|
||||
android:layout_marginLeft="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rule_sender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="10dp" />
|
||||
android:layout_marginLeft="10dp" />
|
||||
</LinearLayout>
|
@ -5,8 +5,9 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sender_image"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp" />
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_margin="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sender_name"
|
||||
|
Loading…
Reference in New Issue
Block a user