优化:界面布局&用户体验优化

pull/115/head
pppscn 2 years ago
parent d01ab9838d
commit 43922b28ce

@ -30,6 +30,7 @@ import com.idormy.sms.forwarder.adapter.LogAdapter;
import com.idormy.sms.forwarder.model.vo.LogVo;
import com.idormy.sms.forwarder.sender.HttpServer;
import com.idormy.sms.forwarder.sender.SendUtil;
import com.idormy.sms.forwarder.sender.SenderUtil;
import com.idormy.sms.forwarder.sender.SmsHubApiTask;
import com.idormy.sms.forwarder.service.BatteryService;
import com.idormy.sms.forwarder.service.FrontService;
@ -39,10 +40,12 @@ import com.idormy.sms.forwarder.utils.KeepAliveUtils;
import com.idormy.sms.forwarder.utils.LogUtil;
import com.idormy.sms.forwarder.utils.NetUtil;
import com.idormy.sms.forwarder.utils.PhoneUtils;
import com.idormy.sms.forwarder.utils.RuleUtil;
import com.idormy.sms.forwarder.utils.SettingUtil;
import com.idormy.sms.forwarder.utils.SharedPreferencesHelper;
import com.idormy.sms.forwarder.utils.SmsUtil;
import com.idormy.sms.forwarder.utils.TimeUtil;
import com.idormy.sms.forwarder.view.StepBar;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
@ -66,8 +69,6 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
@Override
protected void onCreate(Bundle savedInstanceState) {
LogUtil.init(this);
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
@ -80,6 +81,10 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
SmsUtil.init(this);
NetUtil.init(this);
LogUtil.init(this);
RuleUtil.init(this);
SenderUtil.init(this);
//前台服务
try {
serviceIntent = new Intent(MainActivity.this, FrontService.class);
@ -207,6 +212,14 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
builder.create().show();
return true;
});
//步骤完成状态校验
boolean checkStep1 = SettingUtil.getSwitchEnableSms() || SettingUtil.getSwitchEnablePhone() || SettingUtil.getSwitchEnableAppNotify();
boolean checkStep2 = SenderUtil.countSender("1", null) > 0;
boolean checkStep3 = RuleUtil.countRule("1", null, null) > 0;
boolean checkStep4 = LogUtil.countLog("2", null, null) > 0;
StepBar stepBar = findViewById(R.id.stepBar);
stepBar.setHighlight(checkStep1, checkStep2, checkStep3, checkStep4);
}
private int getTypeCheckId(String currentType) {
@ -267,6 +280,7 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
@Override
protected void onPause() {
overridePendingTransition(0, 0);
super.onPause();
MobclickAgent.onPageEnd(TAG);
MobclickAgent.onPause(this);
@ -355,7 +369,7 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
return true;
});
//对于发送失败的消息添加重发按钮
if (logVo.getForwardStatus() == 0) {
if (logVo.getForwardStatus() != 2) {
builder.setPositiveButton("重发消息", (dialog, which) -> {
Toast.makeText(MainActivity.this, R.string.resend_toast, Toast.LENGTH_SHORT).show();
SendUtil.resendMsgByLog(MainActivity.this, handler, logVo);

@ -31,8 +31,10 @@ import com.idormy.sms.forwarder.model.vo.SmsVo;
import com.idormy.sms.forwarder.sender.SendUtil;
import com.idormy.sms.forwarder.sender.SenderUtil;
import com.idormy.sms.forwarder.utils.CommonUtil;
import com.idormy.sms.forwarder.utils.LogUtil;
import com.idormy.sms.forwarder.utils.RuleUtil;
import com.idormy.sms.forwarder.utils.SettingUtil;
import com.idormy.sms.forwarder.view.StepBar;
import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList;
@ -65,8 +67,10 @@ public class RuleActivity extends AppCompatActivity {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rule);
RuleUtil.init(RuleActivity.this);
SenderUtil.init(RuleActivity.this);
LogUtil.init(this);
RuleUtil.init(this);
SenderUtil.init(this);
}
@Override
@ -135,6 +139,14 @@ public class RuleActivity extends AppCompatActivity {
CommonUtil.calcMarginBottom(this, help_tip, btnFloat, listView, null);
//添加规则
btnFloat.setOnClickListener(v -> setRule(null, false));
//步骤完成状态校验
boolean checkStep1 = SettingUtil.getSwitchEnableSms() || SettingUtil.getSwitchEnablePhone() || SettingUtil.getSwitchEnableAppNotify();
boolean checkStep2 = SenderUtil.countSender("1", null) > 0;
boolean checkStep3 = RuleUtil.countRule("1", null, null) > 0;
boolean checkStep4 = LogUtil.countLog("2", null, null) > 0;
StepBar stepBar = findViewById(R.id.stepBar);
stepBar.setHighlight(checkStep1, checkStep2, checkStep3, checkStep4);
}
private int getTypeCheckId(String curType) {
@ -597,6 +609,7 @@ public class RuleActivity extends AppCompatActivity {
@Override
protected void onPause() {
overridePendingTransition(0, 0);
super.onPause();
MobclickAgent.onPageEnd(TAG);
MobclickAgent.onPause(this);

@ -68,7 +68,11 @@ import com.idormy.sms.forwarder.sender.SenderTelegramMsg;
import com.idormy.sms.forwarder.sender.SenderUtil;
import com.idormy.sms.forwarder.sender.SenderWebNotifyMsg;
import com.idormy.sms.forwarder.utils.CommonUtil;
import com.idormy.sms.forwarder.utils.LogUtil;
import com.idormy.sms.forwarder.utils.RuleUtil;
import com.idormy.sms.forwarder.utils.SettingUtil;
import com.idormy.sms.forwarder.view.ClearEditText;
import com.idormy.sms.forwarder.view.StepBar;
import com.umeng.analytics.MobclickAgent;
import java.net.Proxy;
@ -102,7 +106,10 @@ public class SenderActivity extends AppCompatActivity {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sender);
SenderUtil.init(SenderActivity.this);
LogUtil.init(this);
RuleUtil.init(this);
SenderUtil.init(this);
}
@Override
@ -309,6 +316,13 @@ public class SenderActivity extends AppCompatActivity {
});
});
//步骤完成状态校验
boolean checkStep1 = SettingUtil.getSwitchEnableSms() || SettingUtil.getSwitchEnablePhone() || SettingUtil.getSwitchEnableAppNotify();
boolean checkStep2 = SenderUtil.countSender("1", null) > 0;
boolean checkStep3 = RuleUtil.countRule("1", null, null) > 0;
boolean checkStep4 = LogUtil.countLog("2", null, null) > 0;
StepBar stepBar = findViewById(R.id.stepBar);
stepBar.setHighlight(checkStep1, checkStep2, checkStep3, checkStep4);
}
@Override
@ -326,6 +340,7 @@ public class SenderActivity extends AppCompatActivity {
@Override
protected void onPause() {
overridePendingTransition(0, 0);
super.onPause();
MobclickAgent.onPageEnd(TAG);
MobclickAgent.onPause(this);

@ -31,14 +31,18 @@ import androidx.appcompat.app.AppCompatActivity;
import com.idormy.sms.forwarder.receiver.RebootBroadcastReceiver;
import com.idormy.sms.forwarder.sender.HttpServer;
import com.idormy.sms.forwarder.sender.SenderUtil;
import com.idormy.sms.forwarder.sender.SmsHubApiTask;
import com.idormy.sms.forwarder.utils.CommonUtil;
import com.idormy.sms.forwarder.utils.DbHelper;
import com.idormy.sms.forwarder.utils.Define;
import com.idormy.sms.forwarder.utils.HttpUtil;
import com.idormy.sms.forwarder.utils.KeepAliveUtils;
import com.idormy.sms.forwarder.utils.LogUtil;
import com.idormy.sms.forwarder.utils.RuleUtil;
import com.idormy.sms.forwarder.utils.SettingUtil;
import com.idormy.sms.forwarder.view.ClearEditText;
import com.idormy.sms.forwarder.view.StepBar;
import java.util.Arrays;
import java.util.HashMap;
@ -57,6 +61,10 @@ public class SettingActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
context = SettingActivity.this;
setContentView(R.layout.activity_setting);
LogUtil.init(this);
RuleUtil.init(this);
SenderUtil.init(this);
}
@SuppressLint("NewApi")
@ -117,6 +125,20 @@ public class SettingActivity extends AppCompatActivity {
//帮助提示
SwitchHelpTip(findViewById(R.id.switch_help_tip));
//步骤完成状态校验
boolean checkStep1 = SettingUtil.getSwitchEnableSms() || SettingUtil.getSwitchEnablePhone() || SettingUtil.getSwitchEnableAppNotify();
boolean checkStep2 = SenderUtil.countSender("1", null) > 0;
boolean checkStep3 = RuleUtil.countRule("1", null, null) > 0;
boolean checkStep4 = LogUtil.countLog("2", null, null) > 0;
StepBar stepBar = findViewById(R.id.stepBar);
stepBar.setHighlight(checkStep1, checkStep2, checkStep3, checkStep4);
}
@Override
protected void onPause() {
overridePendingTransition(0, 0);
super.onPause();
}
//设置转发短信

@ -62,6 +62,8 @@ 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.ruleImage = view.findViewById(R.id.rule_image);
viewHolder.ruleStatus = view.findViewById(R.id.rule_status);
viewHolder.ruleSenderImage = view.findViewById(R.id.rule_sender_image);
viewHolder.ruleSenderStatus = view.findViewById(R.id.rule_sender_status);
@ -74,6 +76,9 @@ public class RuleAdapter extends ArrayAdapter<RuleModel> {
// 获取控件实例并调用set...方法使其显示出来
if (ruleModel != null) {
viewHolder.ruleImage.setImageResource(ruleModel.getImageId());
viewHolder.ruleStatus.setImageResource(ruleModel.getStatusImageId());
List<SenderModel> senderModel = SenderUtil.getSender(ruleModel.getSenderId(), null);
viewHolder.ruleMatch.setText(ruleModel.getRuleMatch());
if (!senderModel.isEmpty()) {
@ -113,6 +118,8 @@ public class RuleAdapter extends ArrayAdapter<RuleModel> {
static class ViewHolder {
TextView ruleMatch;
TextView ruleSender;
ImageView ruleImage;
ImageView ruleStatus;
ImageView ruleSenderImage;
ImageView ruleSenderStatus;
}

@ -307,11 +307,33 @@ public class RuleModel {
return switchRegexReplace;
}
public boolean getStatusChecked() {
return !(status == STATUS_OFF);
}
public int getImageId() {
switch (simSlot) {
case (CHECK_SIM_SLOT_1):
return R.drawable.sim1;
case (CHECK_SIM_SLOT_2):
return R.drawable.sim2;
case (CHECK_SIM_SLOT_ALL):
default:
return type.equals("app") ? R.drawable.ic_app : R.drawable.ic_sim;
}
}
public int getStatusImageId() {
switch (status) {
case (STATUS_OFF):
return R.drawable.ic_round_pause;
case (STATUS_ON):
default:
return R.drawable.ic_round_play;
}
}
@NonNull
@Override
public String toString() {

@ -160,36 +160,33 @@ public class SenderUtil {
return tSenders;
}
public static int countSender(String key) {
// Define a projection that specifies which columns from the database
// you will actually use after this query.
String[] projection = {
};
// Define 'where' part of query.
public static int countSender(String status, String key) {
String[] projection = {};
String selection = " 1 ";
// Specify arguments in placeholder order.
List<String> selectionArgList = new ArrayList<>();
if (key != null) {
// Define 'where' part of query.
selection = " and (" + SenderTable.SenderEntry.COLUMN_NAME_NAME + " LIKE ? or " + SenderTable.SenderEntry.COLUMN_NAME_JSON_SETTING + " LIKE ? ) ";
// Specify arguments in placeholder order.
if (status != null && !status.isEmpty()) {
selection += " and " + SenderTable.SenderEntry.COLUMN_NAME_STATUS + " = ? ";
selectionArgList.add(status);
}
if (key != null && !key.isEmpty()) {
selection += " and (" + SenderTable.SenderEntry.COLUMN_NAME_NAME + " LIKE ? or " + SenderTable.SenderEntry.COLUMN_NAME_JSON_SETTING + " LIKE ? ) ";
selectionArgList.add(key);
selectionArgList.add(key);
}
String[] selectionArgs = selectionArgList.toArray(new String[0]);
// How you want the results sorted in the resulting Cursor
String[] selectionArgs = selectionArgList.toArray(new String[0]);
Cursor cursor = db.query(
SenderTable.SenderEntry.TABLE_NAME, // The table to query
projection, // The array of columns to return (pass null to get all)
selection, // The columns for the WHERE clause
selectionArgs, // The values for the WHERE clause
null, // don't group the rows
null, // don't filter by row groups
null // The sort order
null, // don't group the rows
null, // don't filter by row groups
null // The sort order
);
int count = cursor.getCount();
cursor.close();
return count;

@ -211,4 +211,39 @@ public class LogUtil {
return LogVos;
}
public static int countLog(String status, String type, String value) {
String[] projection = {};
String selection = " 1 ";
List<String> selectionArgList = new ArrayList<>();
if (status != null && !status.isEmpty()) {
selection += " and " + LogTable.LogEntry.COLUMN_NAME_FORWARD_STATUS + " = ? ";
selectionArgList.add(status);
}
if (type != null && !type.isEmpty()) {
selection += " and " + LogTable.LogEntry.COLUMN_NAME_TYPE + " = ? ";
selectionArgList.add(status);
}
if (value != null && !value.isEmpty()) {
selection += " and " + LogTable.LogEntry.COLUMN_NAME_CONTENT + " LIKE ? ";
selectionArgList.add(value);
}
String[] selectionArgs = selectionArgList.toArray(new String[0]);
Cursor cursor = db.query(
LogTable.LogEntry.TABLE_NAME, // The table to query
projection, // The array of columns to return (pass null to get all)
selection, // The columns for the WHERE clause
selectionArgs, // The values for the WHERE clause
null, // don't group the rows
null, // don't filter by row groups
null // The sort order
);
int count = cursor.getCount();
cursor.close();
return count;
}
}

@ -196,4 +196,40 @@ public class RuleUtil {
return tRules;
}
public static int countRule(String status, String type, String value) {
String[] projection = {};
String selection = " 1 ";
List<String> selectionArgList = new ArrayList<>();
if (status != null && !status.isEmpty()) {
selection += " and " + RuleTable.RuleEntry.COLUMN_NAME_STATUS + " = ? ";
selectionArgList.add(status);
}
if (type != null && !type.isEmpty()) {
selection += " and " + RuleTable.RuleEntry.COLUMN_NAME_TYPE + " = ? ";
selectionArgList.add(status);
}
if (value != null && !value.isEmpty()) {
selection += " and " + RuleTable.RuleEntry.COLUMN_NAME_VALUE + " LIKE ? ";
selectionArgList.add(value);
}
String[] selectionArgs = selectionArgList.toArray(new String[0]);
Cursor cursor = db.query(
RuleTable.RuleEntry.TABLE_NAME, // The table to query
projection, // The array of columns to return (pass null to get all)
selection, // The columns for the WHERE clause
selectionArgs, // The values for the WHERE clause
null, // don't group the rows
null, // don't filter by row groups
null // The sort order
);
int count = cursor.getCount();
cursor.close();
return count;
}
}

@ -1,10 +1,13 @@
package com.idormy.sms.forwarder.view;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -14,72 +17,163 @@ import com.idormy.sms.forwarder.RuleActivity;
import com.idormy.sms.forwarder.SenderActivity;
import com.idormy.sms.forwarder.SettingActivity;
@SuppressWarnings("FieldCanBeLocal")
public class StepBar extends LinearLayout {
private final Context mContext;
private TypedArray mTypedArray;
//自定义参数
private String current_step;
//控件
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;
private TextView txStep1;
private TextView txStep2;
private TextView txStep3;
private TextView txStep4;
private TextView tvStep1;
private TextView tvStep2;
private TextView tvStep3;
private TextView tvStep4;
private ImageView ivStep_12_1;
private ImageView ivStep_12_2;
private ImageView ivStep_12_3;
private ImageView ivStep_23_1;
private ImageView ivStep_23_2;
private ImageView ivStep_23_3;
private ImageView ivStep_34_1;
private ImageView ivStep_34_2;
private ImageView ivStep_34_3;
public StepBar(Context context) {
super(context);
mContext = context;
initView();
}
public StepBar(final Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
initParams(context, attrs);
initView();
}
public StepBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
initParams(context, attrs);
initView();
}
private void initParams(Context context, AttributeSet attrs) {
mTypedArray = mContext.obtainStyledAttributes(attrs, R.styleable.StepBar);
if (mTypedArray != null) {
current_step = mTypedArray.getString(R.styleable.StepBar_current_step);
System.out.println("current_step = " + current_step);
mTypedArray.recycle();
}
}
private void initView() {
//初始化界面
View view = LayoutInflater.from(context).inflate(R.layout.step_bar, this);
//绑定
View view = LayoutInflater.from(mContext).inflate(R.layout.step_bar, this);
//步骤1
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);
if (!current_step.equalsIgnoreCase("setting")) {
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);
});
} else {
tvStep1.setTextColor(mContext.getResources().getColor(R.color.colorPrimaryDark));
}
//步骤2
txStep2 = findViewById(R.id.txStep2);
tvStep2 = findViewById(R.id.tvStep2);
if (!current_step.equalsIgnoreCase("sender")) {
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);
});
} else {
tvStep2.setTextColor(mContext.getResources().getColor(R.color.colorPrimaryDark));
}
//步骤3
txStep3 = findViewById(R.id.txStep3);
tvStep3 = findViewById(R.id.tvStep3);
if (!current_step.equalsIgnoreCase("rule")) {
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);
});
} else {
tvStep3.setTextColor(mContext.getResources().getColor(R.color.colorPrimaryDark));
}
//步骤4
txStep4 = findViewById(R.id.txStep4);
tvStep4 = findViewById(R.id.tvStep4);
//初始化函数
init(context);
if (!current_step.equalsIgnoreCase("main")) {
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);
});
} else {
tvStep4.setTextColor(mContext.getResources().getColor(R.color.colorPrimaryDark));
}
ivStep_12_1 = findViewById(R.id.ivStep_12_1);
ivStep_12_2 = findViewById(R.id.ivStep_12_2);
ivStep_12_3 = findViewById(R.id.ivStep_12_3);
ivStep_23_1 = findViewById(R.id.ivStep_23_1);
ivStep_23_2 = findViewById(R.id.ivStep_23_2);
ivStep_23_3 = findViewById(R.id.ivStep_23_3);
ivStep_34_1 = findViewById(R.id.ivStep_34_1);
ivStep_34_2 = findViewById(R.id.ivStep_34_2);
ivStep_34_3 = findViewById(R.id.ivStep_34_3);
}
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);
});
@SuppressLint("UseCompatLoadingForDrawables")
public void setHighlight(boolean Step1, boolean Step2, boolean Step3, boolean Step4) {
if (Step1) txStep1.setBackground(mContext.getResources().getDrawable(R.drawable.step_circle_current));
if (Step2) txStep2.setBackground(mContext.getResources().getDrawable(R.drawable.step_circle_current));
if (Step3) txStep3.setBackground(mContext.getResources().getDrawable(R.drawable.step_circle_current));
if (Step4) txStep4.setBackground(mContext.getResources().getDrawable(R.drawable.step_circle_current));
if (Step1 && Step2) {
ivStep_12_1.setImageResource(R.drawable.step_rectangle_current);
ivStep_12_2.setImageResource(R.drawable.step_rectangle_current);
ivStep_12_3.setImageResource(R.drawable.step_rectangle_current);
}
if (Step2 && Step3) {
ivStep_23_1.setImageResource(R.drawable.step_rectangle_current);
ivStep_23_2.setImageResource(R.drawable.step_rectangle_current);
ivStep_23_3.setImageResource(R.drawable.step_rectangle_current);
}
if (Step3 && Step4) {
ivStep_34_1.setImageResource(R.drawable.step_rectangle_current);
ivStep_34_2.setImageResource(R.drawable.step_rectangle_current);
ivStep_34_3.setImageResource(R.drawable.step_rectangle_current);
}
}
}

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19.99,4c0,-1.1 -0.89,-2 -1.99,-2h-8L4,8v12c0,1.1 0.9,2 2,2h12.01c1.1,0 1.99,-0.9 1.99,-2l-0.01,-16zM9,19L7,19v-2h2v2zM17,19h-2v-2h2v2zM9,15L7,15v-4h2v4zM13,19h-2v-4h2v4zM13,13h-2v-2h2v2zM17,15h-2v-4h2v4z" />
</vector>

@ -88,8 +88,10 @@
android:textSize="12sp" />
<com.idormy.sms.forwarder.view.StepBar
android:id="@+id/stepBar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:current_step="main" />
</LinearLayout>
</RelativeLayout>

@ -98,8 +98,10 @@
android:textSize="12sp" />
<com.idormy.sms.forwarder.view.StepBar
android:id="@+id/stepBar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:current_step="rule" />
</LinearLayout>

@ -48,8 +48,10 @@
android:textSize="12sp" />
<com.idormy.sms.forwarder.view.StepBar
android:id="@+id/stepBar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:current_step="sender" />
</LinearLayout>
</RelativeLayout>

@ -33,14 +33,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="转发功能"
android:text="@string/forwarding_function"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="总开关,请根据实际需要,启用对应的转发功能"
android:text="@string/forwarding_function_tips"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
@ -123,7 +123,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="必选类型:"
android:text="@string/mandatory_type"
android:textSize="11sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
@ -135,7 +135,7 @@
android:layout_marginStart="-5dp"
android:scaleX="0.7"
android:scaleY="0.7"
android:text="未接来电" />
android:text="@string/missed_call" />
<CheckBox
android:id="@+id/cbCallType1"
@ -144,7 +144,7 @@
android:layout_marginStart="-15dp"
android:scaleX="0.7"
android:scaleY="0.7"
android:text="已接来电" />
android:text="@string/received_call" />
<CheckBox
android:id="@+id/cbCallType2"
@ -153,7 +153,7 @@
android:layout_marginStart="-15dp"
android:scaleX="0.7"
android:scaleY="0.7"
android:text="本机去电" />
android:text="@string/local_outgoing_call" />
</LinearLayout>
</LinearLayout>
@ -208,7 +208,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="可选操作:"
android:text="@string/optional_action"
android:textSize="11sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
@ -248,14 +248,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主动请求"
android:text="@string/active_request"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="通过 被动接收 或者 主动轮询 获取指令,从而操作本机"
android:text="@string/active_request_tips"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
@ -278,14 +278,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="被动接收本地 HttpServer"
android:text="@string/httpserver"
android:textStyle="bold"
tools:ignore="RelativeOverlap" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="WiFi网络下可用启动后局域网内其他机器可直接调用本机接口"
android:text="@string/httpserver_tips"
android:textSize="9sp"
tools:ignore="SmallSp" />
</LinearLayout>
@ -363,14 +363,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="电池监控"
android:text="@string/battery_monitor"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="电池状态变化与电量预警互不干扰"
android:text="@string/battery_monitor_tips"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
@ -508,14 +508,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="保活措施"
android:text="@string/keep_alive"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="建议开启每一项授权或设置不要禁用通知栏避免APP服务被杀"
android:text="@string/keep_alive_tips"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
@ -760,14 +760,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="个性设置"
android:text="@string/custom_settings"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="如果自动获取失败,请手动填写备注信息;清空后将再次自动获取!"
android:text="@string/custom_settings_tips"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
@ -1091,8 +1091,10 @@
android:textSize="12sp" />
<com.idormy.sms.forwarder.view.StepBar
android:id="@+id/stepBar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:current_step="setting" />
</LinearLayout>

@ -466,6 +466,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:checked="true"
android:gravity="end"
android:textSize="18sp"
tools:ignore="UseSwitchCompatOrMaterialXml" />

@ -468,6 +468,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:checked="true"
android:gravity="end"
android:textSize="18sp"
tools:ignore="UseSwitchCompatOrMaterialXml" />

@ -470,6 +470,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:checked="true"
android:gravity="end"
android:textSize="18sp"
tools:ignore="UseSwitchCompatOrMaterialXml" />

@ -68,10 +68,14 @@
<TextView
android:id="@+id/tlog_content"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="10dp" />
android:layout_gravity="start"
android:layout_marginBottom="10dp"
android:ellipsize="end"
android:gravity="start"
android:maxEms="8"
android:maxLines="3" />
</LinearLayout>

@ -3,6 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
@ -15,11 +17,12 @@
<TextView
android:id="@+id/ItemTextView"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:ellipsize="end"
android:gravity="center"
android:maxEms="6"
android:maxEms="5"
android:maxLines="1"
android:textColor="#ffffff"
android:textSize="12sp" />

@ -12,17 +12,16 @@
<LinearLayout
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginStart="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/rule_sender_image"
android:id="@+id/rule_image"
android:layout_width="32dp"
android:layout_height="32dp"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/rule_sender_status"
android:id="@+id/rule_status"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginStart="18dp"
@ -32,15 +31,53 @@
<TextView
android:id="@+id/rule_match"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp" />
android:layout_marginStart="5dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="start"
android:maxEms="8"
android:maxLines="3" />
<TextView
android:id="@+id/rule_sender"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp" />
android:layout_marginStart="5dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:layout_width="24dp"
android:layout_height="24dp"
android:orientation="vertical">
<ImageView
android:id="@+id/rule_sender_image"
android:layout_width="24dp"
android:layout_height="24dp"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/rule_sender_status"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginStart="14dp"
android:layout_marginTop="-10dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<TextView
android:id="@+id/rule_sender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxEms="6"
android:maxLines="1"
android:textSize="9sp"
tools:ignore="SmallSp" />
</LinearLayout>
</LinearLayout>

@ -32,9 +32,14 @@
<TextView
android:id="@+id/sender_name"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp" />
android:layout_marginStart="10dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="start"
android:maxEms="8"
android:maxLines="2" />
</LinearLayout>

@ -27,44 +27,48 @@
android:id="@+id/txStep1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/step_circle_current"
android:background="@drawable/step_circle_normal"
android:gravity="center"
android:text="@string/_1"
android:textColor="#fff"
android:textSize="16sp" />
<ImageView
android:id="@+id/ivStep_12_1"
android:layout_width="15dp"
android:layout_height="4dp"
android:layout_gravity="center"
android:src="@drawable/step_rectangle_current"
android:src="@drawable/step_rectangle_normal"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/ivStep_12_2"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_weight="1"
android:src="@drawable/step_rectangle_current"
android:src="@drawable/step_rectangle_normal"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/ivStep_12_3"
android:layout_width="15dp"
android:layout_height="4dp"
android:layout_gravity="center"
android:src="@drawable/step_rectangle_current"
android:src="@drawable/step_rectangle_normal"
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:background="@drawable/step_circle_normal"
android:gravity="center"
android:text="@string/_2"
android:textColor="#fff"
android:textSize="16sp" />
<ImageView
android:id="@+id/ivStep_23_1"
android:layout_width="15dp"
android:layout_height="4dp"
android:layout_gravity="center"
@ -72,6 +76,7 @@
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/ivStep_23_2"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_weight="1"
@ -79,6 +84,7 @@
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/ivStep_23_3"
android:layout_width="15dp"
android:layout_height="4dp"
android:layout_gravity="center"
@ -96,6 +102,7 @@
android:textSize="16sp" />
<ImageView
android:id="@+id/ivStep_34_1"
android:layout_width="15dp"
android:layout_height="4dp"
android:layout_gravity="center"
@ -103,6 +110,7 @@
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/ivStep_34_2"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_weight="1"
@ -111,6 +119,7 @@
<ImageView
android:id="@+id/ivStep_34_3"
android:layout_width="15dp"
android:layout_height="4dp"
android:layout_gravity="center"

@ -312,4 +312,21 @@
<string name="step_4">Logs</string>
<string name="clean_log">Clean Log</string>
<string name="todo">TODO</string>
<string name="forwarding_function">Forwarding Function</string>
<string name="forwarding_function_tips">Main switch: Enable the forwarding function as required</string>
<string name="mandatory_type">Mandatory type:</string>
<string name="missed_call">Missed call</string>
<string name="received_call">Received call</string>
<string name="local_outgoing_call">Local outgoing call</string>
<string name="optional_action">Optional action:</string>
<string name="active_request">Active request</string>
<string name="active_request_tips">Obtain instructions through passive reception or active polling to operate the machine</string>
<string name="httpserver">Local HttpServer</string>
<string name="httpserver_tips">Available under WiFi network, after startup, other machines in the LAN can directly call the local interface</string>
<string name="battery_monitor">Battery monitor</string>
<string name="battery_monitor_tips">[Note] You need to manually create APP forwarding rules, package name: 88888888</string>
<string name="keep_alive">Keep alive measures</string>
<string name="keep_alive_tips">It is recommended to open each authorization or setting, do not disable the notification bar, to avoid the APP service being killed</string>
<string name="custom_settings">Custom settings</string>
<string name="custom_settings_tips">If the automatic acquisition fails, please fill in the remarks manually; after clearing, it will be automatically acquired again!</string>
</resources>

@ -76,4 +76,8 @@
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
</style>
<declare-styleable name="StepBar">
<attr name="current_step" format="string" />
</declare-styleable>
</resources>

@ -311,4 +311,21 @@
<string name="step_4">转发日志</string>
<string name="clean_log">清理日志</string>
<string name="todo">TODO</string>
<string name="forwarding_function">转发功能</string>
<string name="forwarding_function_tips">总开关,请根据实际需要,启用对应的转发功能</string>
<string name="mandatory_type">必选类型:</string>
<string name="missed_call">未接来电</string>
<string name="received_call">已接来电</string>
<string name="local_outgoing_call">本机去电</string>
<string name="optional_action">可选操作:</string>
<string name="active_request">主动请求</string>
<string name="active_request_tips">通过 被动接收 或者 主动轮询 获取指令,从而操作本机</string>
<string name="httpserver">被动接收本地 HttpServer</string>
<string name="httpserver_tips">WiFi网络下可用启动后局域网内其他机器可直接调用本机接口</string>
<string name="battery_monitor">电池监控</string>
<string name="battery_monitor_tips">【注意】需要手动创建APP转发规则包名88888888</string>
<string name="keep_alive">保活措施</string>
<string name="keep_alive_tips">建议开启每一项授权或设置不要禁用通知栏避免APP服务被杀</string>
<string name="custom_settings">个性设置</string>
<string name="custom_settings_tips">如果自动获取失败,请手动填写备注信息;清空后将再次自动获取!</string>
</resources>

@ -79,4 +79,8 @@
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
</style>
<declare-styleable name="StepBar">
<attr name="current_step" format="string" />
</declare-styleable>
</resources>

Loading…
Cancel
Save