Compare commits
9 Commits
contacts-v
...
contacts-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
559f1c58ba | ||
|
|
4bb814308b | ||
|
|
05a9fc5275 | ||
|
|
74d5239898 | ||
|
|
948141d5a9 | ||
|
|
3535df8b3e | ||
|
|
bd4ba7b291 | ||
|
|
9ff8b1ed80 | ||
|
|
859238a173 |
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Mar 04 01:25:27 HKT 2025
|
#Thu Mar 06 20:00:52 HKT 2025
|
||||||
stageCount=9
|
stageCount=12
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=1.0
|
baseVersion=1.0
|
||||||
publishVersion=1.0.8
|
publishVersion=1.0.11
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=1.0.9
|
baseBetaVersion=1.0.12
|
||||||
|
|||||||
@@ -232,6 +232,12 @@ public class SettingsActivity extends AppCompatActivity implements IWinBollActiv
|
|||||||
Intent intent = new Intent(this, UnitTestActivity.class);
|
Intent intent = new Intent(this, UnitTestActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onAddNewConnectionRule(View view) {
|
||||||
|
Rules.getInstance(this).getPhoneBlacRuleBeanList().add(new PhoneConnectRuleModel());
|
||||||
|
Rules.getInstance(this).saveRules();
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
public void onDefaultPhone(View view) {
|
public void onDefaultPhone(View view) {
|
||||||
Intent intent = new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
|
Intent intent = new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cc.winboll.studio.contacts.R;
|
|||||||
import cc.winboll.studio.contacts.dun.Rules;
|
import cc.winboll.studio.contacts.dun.Rules;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -26,6 +27,15 @@ public class UnitTestActivity extends Activity {
|
|||||||
logView.start();
|
logView.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onTestPhone(View view) {
|
||||||
|
// 开始测试数据
|
||||||
|
EditText etPhone = findViewById(R.id.phone_et);
|
||||||
|
Rules rules = Rules.getInstance(this);
|
||||||
|
String phone = etPhone.getText().toString().trim();
|
||||||
|
LogUtils.d(TAG, String.format("Test phone : %s\n%s", phone, rules.isAllowed(phone)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void onTestMain(View view) {
|
public void onTestMain(View view) {
|
||||||
Rules rules = Rules.getInstance(this);
|
Rules rules = Rules.getInstance(this);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,14 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import cc.winboll.studio.contacts.R;
|
import cc.winboll.studio.contacts.R;
|
||||||
import cc.winboll.studio.contacts.beans.PhoneConnectRuleModel;
|
import cc.winboll.studio.contacts.beans.PhoneConnectRuleModel;
|
||||||
import cc.winboll.studio.contacts.dun.Rules;
|
import cc.winboll.studio.contacts.dun.Rules;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.widget.HorizontalScrollView;
|
||||||
|
import cc.winboll.studio.contacts.views.LeftScrollView;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
||||||
|
|
||||||
public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
@@ -42,10 +49,10 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
LayoutInflater inflater = LayoutInflater.from(context);
|
LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
if (viewType == VIEW_TYPE_SIMPLE) {
|
if (viewType == VIEW_TYPE_SIMPLE) {
|
||||||
View view = inflater.inflate(R.layout.view_phone_connect_rule_simple, parent, false);
|
View view = inflater.inflate(R.layout.view_phone_connect_rule_simple, parent, false);
|
||||||
return new SimpleViewHolder(view);
|
return new SimpleViewHolder(parent, view);
|
||||||
} else {
|
} else {
|
||||||
View view = inflater.inflate(R.layout.view_phone_connect_rule, parent, false);
|
View view = inflater.inflate(R.layout.view_phone_connect_rule, parent, false);
|
||||||
return new EditViewHolder(view);
|
return new EditViewHolder(parent, view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,15 +60,128 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) {
|
||||||
final PhoneConnectRuleModel model = ruleList.get(position);
|
final PhoneConnectRuleModel model = ruleList.get(position);
|
||||||
if (holder instanceof SimpleViewHolder) {
|
if (holder instanceof SimpleViewHolder) {
|
||||||
SimpleViewHolder simpleViewHolder = (SimpleViewHolder) holder;
|
final SimpleViewHolder simpleViewHolder = (SimpleViewHolder) holder;
|
||||||
simpleViewHolder.textView.setText(model.getRuleText());
|
String szView = model.getRuleText().trim().equals("") ?"[NULL]": model.getRuleText();
|
||||||
simpleViewHolder.button.setOnClickListener(new View.OnClickListener() {
|
simpleViewHolder.tvRuleText.setText(szView);
|
||||||
|
simpleViewHolder.scrollView.setOnActionListener(new LeftScrollView.OnActionListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onUp() {
|
||||||
|
ArrayList<PhoneConnectRuleModel> list = Rules.getInstance(context).getPhoneBlacRuleBeanList();
|
||||||
|
if (position > 0) {
|
||||||
|
ToastUtils.show("onUp");
|
||||||
|
simpleViewHolder.scrollView.smoothScrollTo(0, 0);
|
||||||
|
// PhoneConnectRuleModel newBean = new PhoneConnectRuleModel();
|
||||||
|
// newBean.setRuleText(list.get(position).getRuleText());
|
||||||
|
// newBean.setIsAllowConnection(list.get(position).isAllowConnection());
|
||||||
|
// newBean.setIsEnable(list.get(position).isEnable());
|
||||||
|
// newBean.setIsSimpleView(list.get(position).isSimpleView());
|
||||||
|
list.add(position - 1, list.get(position));
|
||||||
|
list.remove(position + 1);
|
||||||
|
Rules.getInstance(context).saveRules();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDown() {
|
||||||
|
ArrayList<PhoneConnectRuleModel> list = Rules.getInstance(context).getPhoneBlacRuleBeanList();
|
||||||
|
if (position < list.size() - 1) {
|
||||||
|
ToastUtils.show("onDown");
|
||||||
|
simpleViewHolder.scrollView.smoothScrollTo(0, 0);
|
||||||
|
// PhoneConnectRuleModel newBean = new PhoneConnectRuleModel();
|
||||||
|
// newBean.setRuleText(list.get(position).getRuleText());
|
||||||
|
// newBean.setIsAllowConnection(list.get(position).isAllowConnection());
|
||||||
|
// newBean.setIsEnable(list.get(position).isEnable());
|
||||||
|
// newBean.setIsSimpleView(list.get(position).isSimpleView());
|
||||||
|
list.add(position + 2, list.get(position));
|
||||||
|
list.remove(position);
|
||||||
|
Rules.getInstance(context).saveRules();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEdit() {
|
||||||
|
simpleViewHolder.scrollView.smoothScrollTo(0, 0);
|
||||||
model.setIsSimpleView(false);
|
model.setIsSimpleView(false);
|
||||||
notifyItemChanged(position);
|
notifyDataSetChanged();
|
||||||
|
//notifyItemChanged(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDelete() {
|
||||||
|
YesNoAlertDialog.show(simpleViewHolder.scrollView.getContext(), "删除确认", "是否删除该通话规则?", new YesNoAlertDialog.OnDialogResultListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onYes() {
|
||||||
|
simpleViewHolder.scrollView.smoothScrollTo(0, 0);
|
||||||
|
model.setIsSimpleView(true);
|
||||||
|
ArrayList<PhoneConnectRuleModel> list = Rules.getInstance(context).getPhoneBlacRuleBeanList();
|
||||||
|
list.remove(position);
|
||||||
|
Rules.getInstance(context).saveRules();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
//notifyItemChanged(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNo() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// simpleViewHolder.editButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(View v) {
|
||||||
|
// model.setIsSimpleView(false);
|
||||||
|
// notifyItemChanged(position);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// simpleViewHolder.deleteButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(View v) {
|
||||||
|
// model.setIsSimpleView(false);
|
||||||
|
// ArrayList<PhoneConnectRuleModel> list = Rules.getInstance(context).getPhoneBlacRuleBeanList();
|
||||||
|
// list.remove(position);
|
||||||
|
// Rules.getInstance(context).saveRules();
|
||||||
|
// notifyItemChanged(position);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// // 触摸事件处理
|
||||||
|
// simpleViewHolder.contentLayout.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
// @Override
|
||||||
|
// public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
// switch (event.getAction()) {
|
||||||
|
// case MotionEvent.ACTION_DOWN:
|
||||||
|
// simpleViewHolder.startX = event.getX();
|
||||||
|
// simpleViewHolder.isSwiping = true;
|
||||||
|
// break;
|
||||||
|
// case MotionEvent.ACTION_MOVE:
|
||||||
|
// if (simpleViewHolder.isSwiping) {
|
||||||
|
// float deltaX = simpleViewHolder.startX - event.getX();
|
||||||
|
// if (deltaX > 0) { // 左滑
|
||||||
|
// float translationX = Math.max(-simpleViewHolder.actionLayout.getWidth(), -deltaX);
|
||||||
|
// simpleViewHolder.contentLayout.setTranslationX(translationX);
|
||||||
|
// simpleViewHolder.actionLayout.setVisibility(View.VISIBLE);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case MotionEvent.ACTION_UP:
|
||||||
|
// simpleViewHolder.isSwiping = false;
|
||||||
|
// if (simpleViewHolder.contentLayout.getTranslationX() < -simpleViewHolder.actionLayout.getWidth() / 2) {
|
||||||
|
// // 保持按钮显示
|
||||||
|
// simpleViewHolder.contentLayout.setTranslationX(-actionLayout.getWidth());
|
||||||
|
// } else {
|
||||||
|
// // 恢复原状
|
||||||
|
// simpleViewHolder.contentLayout.animate().translationX(0).setDuration(200).start();
|
||||||
|
// simpleViewHolder.actionLayout.setVisibility(View.INVISIBLE);
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
} else if (holder instanceof EditViewHolder) {
|
} else if (holder instanceof EditViewHolder) {
|
||||||
final EditViewHolder editViewHolder = (EditViewHolder) holder;
|
final EditViewHolder editViewHolder = (EditViewHolder) holder;
|
||||||
editViewHolder.editText.setText(model.getRuleText());
|
editViewHolder.editText.setText(model.getRuleText());
|
||||||
@@ -95,14 +215,21 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class SimpleViewHolder extends RecyclerView.ViewHolder {
|
static class SimpleViewHolder extends RecyclerView.ViewHolder {
|
||||||
TextView textView;
|
|
||||||
Button button;
|
|
||||||
|
|
||||||
public SimpleViewHolder(@NonNull View itemView) {
|
private final LeftScrollView scrollView;
|
||||||
|
private final TextView tvRuleText;
|
||||||
|
|
||||||
|
|
||||||
|
public SimpleViewHolder(@NonNull ViewGroup parent, @NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
textView = itemView.findViewById(R.id.text_view);
|
scrollView = itemView.findViewById(R.id.scrollView);
|
||||||
button = itemView.findViewById(R.id.button);
|
//tvRuleText = itemView.findViewById(R.id.ruletext_tv);
|
||||||
|
tvRuleText = new TextView(itemView.getContext());
|
||||||
|
scrollView.setContentWidth(parent.getWidth());
|
||||||
|
//scrollView.setContentWidth(600);
|
||||||
|
scrollView.addContentLayout(tvRuleText);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class EditViewHolder extends RecyclerView.ViewHolder {
|
static class EditViewHolder extends RecyclerView.ViewHolder {
|
||||||
@@ -111,7 +238,7 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
CheckBox checkBoxEnable;
|
CheckBox checkBoxEnable;
|
||||||
Button buttonConfirm;
|
Button buttonConfirm;
|
||||||
|
|
||||||
public EditViewHolder(@NonNull View itemView) {
|
public EditViewHolder(@NonNull ViewGroup parent, @NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
editText = itemView.findViewById(R.id.edit_text);
|
editText = itemView.findViewById(R.id.edit_text);
|
||||||
checkBoxAllow = itemView.findViewById(R.id.checkbox_allow);
|
checkBoxAllow = itemView.findViewById(R.id.checkbox_allow);
|
||||||
|
|||||||
@@ -0,0 +1,220 @@
|
|||||||
|
package cc.winboll.studio.contacts.views;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/04 10:51:50
|
||||||
|
* @Describe CustomHorizontalScrollView
|
||||||
|
*/
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.HorizontalScrollView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import cc.winboll.studio.contacts.R;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|
||||||
|
public class LeftScrollView extends HorizontalScrollView {
|
||||||
|
|
||||||
|
public static final String TAG = "LeftScrollView";
|
||||||
|
|
||||||
|
private LinearLayout contentLayout;
|
||||||
|
private LinearLayout toolLayout;
|
||||||
|
private TextView textView;
|
||||||
|
private Button editButton;
|
||||||
|
private Button deleteButton;
|
||||||
|
private Button upButton;
|
||||||
|
private Button downButton;
|
||||||
|
private float mStartX;
|
||||||
|
private float mEndX;
|
||||||
|
private boolean isScrolling = false;
|
||||||
|
private int nScrollAcceptSize;
|
||||||
|
|
||||||
|
public LeftScrollView(Context context) {
|
||||||
|
super(context);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LeftScrollView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LeftScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addContentLayout(TextView textView) {
|
||||||
|
contentLayout.addView(textView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContentWidth(int contentWidth) {
|
||||||
|
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) contentLayout.getLayoutParams();
|
||||||
|
layoutParams.width = contentWidth;
|
||||||
|
contentLayout.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
View viewMain = inflate(getContext(), R.layout.view_left_scroll, null);
|
||||||
|
|
||||||
|
// 创建内容布局
|
||||||
|
contentLayout = viewMain.findViewById(R.id.content_layout);
|
||||||
|
toolLayout = viewMain.findViewById(R.id.action_layout);
|
||||||
|
|
||||||
|
//LogUtils.d(TAG, String.format("getWidth() %d", getWidth()));
|
||||||
|
|
||||||
|
addView(viewMain);
|
||||||
|
|
||||||
|
// 创建编辑按钮
|
||||||
|
editButton = viewMain.findViewById(R.id.edit_btn);
|
||||||
|
// 创建删除按钮
|
||||||
|
deleteButton = viewMain.findViewById(R.id.delete_btn);
|
||||||
|
// 向上按钮
|
||||||
|
upButton = viewMain.findViewById(R.id.up_btn);
|
||||||
|
// 向下按钮
|
||||||
|
downButton = viewMain.findViewById(R.id.down_btn);
|
||||||
|
|
||||||
|
// 编辑按钮点击事件
|
||||||
|
editButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onActionListener != null) {
|
||||||
|
onActionListener.onEdit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 删除按钮点击事件
|
||||||
|
deleteButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onActionListener != null) {
|
||||||
|
onActionListener.onDelete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 编辑按钮点击事件
|
||||||
|
upButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onActionListener != null) {
|
||||||
|
onActionListener.onUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 删除按钮点击事件
|
||||||
|
downButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onActionListener != null) {
|
||||||
|
onActionListener.onDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
LogUtils.d(TAG, "ACTION_DOWN");
|
||||||
|
mStartX = event.getX();
|
||||||
|
// isScrolling = false;
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_MOVE:
|
||||||
|
//LogUtils.d(TAG, "ACTION_MOVE");
|
||||||
|
// float currentX = event.getX();
|
||||||
|
// float deltaX = mStartX - currentX;
|
||||||
|
// //mLastX = currentX;
|
||||||
|
// if (Math.abs(deltaX) > 0) {
|
||||||
|
// isScrolling = true;
|
||||||
|
// }
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
if (getScrollX() > 0) {
|
||||||
|
LogUtils.d(TAG, "ACTION_UP");
|
||||||
|
mEndX = event.getX();
|
||||||
|
LogUtils.d(TAG, String.format("mStartX %f, mEndX %f", mStartX, mEndX));
|
||||||
|
if (mEndX < mStartX) {
|
||||||
|
LogUtils.d(TAG, String.format("mEndX >= mStartX \ngetScrollX() %d", getScrollX()));
|
||||||
|
//if (getScrollX() > editButton.getWidth()) {
|
||||||
|
if (Math.abs(mStartX - mEndX) > editButton.getWidth()) {
|
||||||
|
smoothScrollToRight();
|
||||||
|
} else {
|
||||||
|
smoothScrollToLeft();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, String.format("mEndX >= mStartX \ngetScrollX() %d", getScrollX()));
|
||||||
|
//if (getScrollX() > deleteButton.getWidth()) {
|
||||||
|
if (Math.abs(mEndX - mStartX) > deleteButton.getWidth()) {
|
||||||
|
smoothScrollToLeft();
|
||||||
|
} else {
|
||||||
|
smoothScrollToRight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return super.onTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void smoothScrollToRight() {
|
||||||
|
mEndX = 0;
|
||||||
|
mStartX = 0;
|
||||||
|
View childView = getChildAt(0);
|
||||||
|
if (childView != null) {
|
||||||
|
// 计算需要滑动到最右边的距离
|
||||||
|
int scrollToX = childView.getWidth() - getWidth();
|
||||||
|
// 确保滑动距离不小于0
|
||||||
|
final int scrollToX2 = Math.max(0, scrollToX);
|
||||||
|
// 平滑滑动到最右边
|
||||||
|
post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
smoothScrollTo(scrollToX2, 0);
|
||||||
|
LogUtils.d(TAG, "smoothScrollTo(0, 0);");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
LogUtils.d(TAG, "smoothScrollTo(scrollToX, 0);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void smoothScrollToLeft() {
|
||||||
|
mEndX = 0;
|
||||||
|
mStartX = 0;
|
||||||
|
// 在手指抬起时,使用 post 方法调用 smoothScrollTo(0, 0)
|
||||||
|
post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
smoothScrollTo(0, 0);
|
||||||
|
LogUtils.d(TAG, "smoothScrollTo(0, 0);");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置文本内容
|
||||||
|
public void setText(CharSequence text) {
|
||||||
|
textView.setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义回调接口
|
||||||
|
public interface OnActionListener {
|
||||||
|
void onEdit();
|
||||||
|
void onDelete();
|
||||||
|
void onUp();
|
||||||
|
void onDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnActionListener onActionListener;
|
||||||
|
|
||||||
|
public void setOnActionListener(OnActionListener listener) {
|
||||||
|
this.onActionListener = listener;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,271 +1,290 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<ScrollView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/activitymainToolbar1"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content">
|
||||||
android:layout_weight="1.0">
|
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="服务设置:"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="主要服务"
|
|
||||||
android:id="@+id/sw_mainservice"
|
|
||||||
android:layout_margin="5dp"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="云盾设置:"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.contacts.views.DuInfoTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/tv_DunInfo"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="是否启用云盾防御"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/sw_IsEnableDun"
|
|
||||||
android:onClick="onSW_IsEnableDun"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical">
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="初始防御层的叠加数量:"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:inputType="number"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/et_DunTotalCount"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="防御层每次恢复的时间间隔(秒钟):"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:inputType="number"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/et_DunResumeSecondCount"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="防御层每次恢复的叠加数量:"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:inputType="number"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/et_DunResumeCount"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="应用权限设置:"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="right">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="悬浮窗设置"
|
|
||||||
android:id="@+id/activitysettingsButton2"
|
|
||||||
android:onClick="onCanDrawOverlays"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="默认拨号设置"
|
|
||||||
android:id="@+id/activitysettingsButton1"
|
|
||||||
android:onClick="onDefaultPhone"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="音量设置:"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:id="@+id/tv_volume"/>
|
|
||||||
|
|
||||||
<SeekBar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
android:max="100"
|
|
||||||
android:id="@+id/bellvolume"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="拨不通电话记录查询:"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:gravity="right"
|
android:layout_weight="1.0">
|
||||||
android:layout_margin="10dp">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="下载 BoBullToon"
|
|
||||||
android:onClick="onDownloadBoBullToon"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:layout_margin="10dp">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="查询电话:"/>
|
android:text="服务设置:"/>
|
||||||
|
|
||||||
<EditText
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:orientation="horizontal"
|
||||||
android:inputType="phone"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="主要服务"
|
||||||
|
android:id="@+id/sw_mainservice"
|
||||||
|
android:layout_margin="5dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="云盾设置:"/>
|
||||||
|
|
||||||
|
<cc.winboll.studio.contacts.views.DuInfoTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/tv_DunInfo"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="是否启用云盾防御"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:id="@+id/sw_IsEnableDun"
|
||||||
|
android:onClick="onSW_IsEnableDun"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ems="10"
|
android:gravity="center_vertical">
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/activitysettingsEditText1"/>
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="初始防御层的叠加数量:"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:inputType="number"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/et_DunTotalCount"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="防御层每次恢复的时间间隔(秒钟):"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:inputType="number"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/et_DunResumeSecondCount"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="防御层每次恢复的叠加数量:"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:inputType="number"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/et_DunResumeCount"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="查询记录"
|
android:text="应用权限设置:"/>
|
||||||
android:onClick="onSearchBoBullToonPhone"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Phone Connect Rule :"/>
|
android:text="悬浮窗设置"
|
||||||
|
android:id="@+id/activitysettingsButton2"
|
||||||
|
android:onClick="onCanDrawOverlays"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<Button
|
||||||
android:id="@+id/recycler_view"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:text="默认拨号设置"
|
||||||
android:layout_weight="1.0"
|
android:id="@+id/activitysettingsButton1"
|
||||||
android:background="@drawable/recycler_view_border"
|
android:onClick="onDefaultPhone"/>
|
||||||
android:layout_margin="5dp"/>
|
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="单元测试:"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="right">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Unit Test"
|
android:text="音量设置:"/>
|
||||||
android:onClick="onUnitTest"/>
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:id="@+id/tv_volume"/>
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:max="100"
|
||||||
|
android:id="@+id/bellvolume"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="拨不通电话记录查询:"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right"
|
||||||
|
android:layout_margin="10dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="下载 BoBullToon"
|
||||||
|
android:onClick="onDownloadBoBullToon"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:layout_margin="10dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="查询电话:"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/activitysettingsEditText1"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="查询记录"
|
||||||
|
android:onClick="onSearchBoBullToonPhone"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Phone Connect Rule :"
|
||||||
|
android:layout_weight="1.0"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="添加新规则"
|
||||||
|
android:onClick="onAddNewConnectionRule"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="300dp"
|
||||||
|
android:background="@drawable/recycler_view_border"
|
||||||
|
android:layout_margin="5dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="单元测试:"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Unit Test"
|
||||||
|
android:onClick="onUnitTest"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</ScrollView>
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<HorizontalScrollView
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -16,7 +18,34 @@
|
|||||||
android:text="Test Main"
|
android:text="Test Main"
|
||||||
android:onClick="onTestMain"/>
|
android:onClick="onTestMain"/>
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="测试号码:"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/phone_et"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Test Phone"
|
||||||
|
android:onClick="onTestPhone"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
<cc.winboll.studio.libappbase.LogView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
52
contacts/src/main/res/layout/view_left_scroll.xml
Normal file
52
contacts/src/main/res/layout/view_left_scroll.xml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/content_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@color/white">
|
||||||
|
<!-- 这里放置你的列表项内容 -->
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/action_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@color/lightgray">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/edit_btn"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="编辑"
|
||||||
|
android:background="@color/blue" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/up_btn"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="△"
|
||||||
|
android:background="@color/green" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/down_btn"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="▽"
|
||||||
|
android:background="@color/green" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/delete_btn"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="删除"
|
||||||
|
android:background="@color/red" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
@@ -2,24 +2,15 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical">
|
android:padding="2dp">
|
||||||
|
|
||||||
<TextView
|
<cc.winboll.studio.contacts.views.LeftScrollView
|
||||||
android:id="@+id/text_view"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:id="@+id/scrollView"/>
|
||||||
android:textSize="16sp"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="编辑"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<HorizontalScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:id="@+id/scrollView">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/content_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@color/white">
|
||||||
|
<!-- 这里放置你的列表项内容 -->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="16sp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/action_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@color/lightgray">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/edit_btn"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="编辑"
|
||||||
|
android:background="@color/blue" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/delete_btn"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="删除"
|
||||||
|
android:background="@color/red" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
@@ -4,4 +4,10 @@
|
|||||||
<color name="colorPrimary">#FF196ABC</color>
|
<color name="colorPrimary">#FF196ABC</color>
|
||||||
<color name="colorPrimaryDark">#FF002B57</color>
|
<color name="colorPrimaryDark">#FF002B57</color>
|
||||||
<color name="colorAccent">#FF80BFFF</color>
|
<color name="colorAccent">#FF80BFFF</color>
|
||||||
|
<color name="blue">#FF379AFF</color>
|
||||||
|
<color name="green">#FF69E551</color>
|
||||||
|
<color name="red">#FFE55151</color>
|
||||||
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="lightgray">#FFE0E0E0</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user