功能优化
This commit is contained in:
parent
bd3121eee1
commit
0c81561074
@ -16,12 +16,35 @@ public class Solution {
|
||||
@ColumnInfo(name = "solution_name")
|
||||
public String solutionName;
|
||||
|
||||
public Solution(String solutionName) {
|
||||
@ColumnInfo(name = "mode")
|
||||
public int mode;
|
||||
|
||||
public Solution(String solutionName, int mode) {
|
||||
this.solutionName = solutionName;
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public long getSolutionId() { return solutionId; }
|
||||
public void setSolutionId(long solutionId) { this.solutionId = solutionId; }
|
||||
public String getSolutionName() { return solutionName; }
|
||||
public void setSolutionName(String solutionName) { this.solutionName = solutionName; }
|
||||
public int getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(int mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public long getSolutionId() {
|
||||
return solutionId;
|
||||
}
|
||||
|
||||
public void setSolutionId(long solutionId) {
|
||||
this.solutionId = solutionId;
|
||||
}
|
||||
|
||||
public String getSolutionName() {
|
||||
return solutionName;
|
||||
}
|
||||
|
||||
public void setSolutionName(String solutionName) {
|
||||
this.solutionName = solutionName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,18 +9,23 @@ import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.auto.clicker.autoclicker.R;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityBatteryLimitFreeBinding;
|
||||
|
||||
public class BatteryLimitFreeActivity extends AppCompatActivity {
|
||||
private ActivityBatteryLimitFreeBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_battery_limit_free);
|
||||
binding = ActivityBatteryLimitFreeBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
binding.back.setOnClickListener(v -> finish());
|
||||
}
|
||||
}
|
||||
@ -9,18 +9,24 @@ import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.auto.clicker.autoclicker.R;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityBatteryLimitFreeBinding;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityFeedbackBinding;
|
||||
|
||||
public class FeedbackActivity extends AppCompatActivity {
|
||||
private ActivityFeedbackBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_feedback);
|
||||
binding = ActivityFeedbackBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
binding.backArrow.setOnClickListener(v -> finish());
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,8 @@ public class HowToUseActivity extends AppCompatActivity {
|
||||
initTabs();
|
||||
|
||||
binding.howViewpager.setCurrentItem(0, false);
|
||||
|
||||
binding.back.setOnClickListener(v -> finish());
|
||||
}
|
||||
|
||||
private void initPagerAdapter() {
|
||||
|
||||
@ -9,18 +9,24 @@ import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.auto.clicker.autoclicker.R;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityFeedbackBinding;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityScriptsBinding;
|
||||
|
||||
public class ScriptsActivity extends AppCompatActivity {
|
||||
private ActivityScriptsBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_scripts);
|
||||
binding = ActivityScriptsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
binding.btnBack.setOnClickListener(v -> finish());
|
||||
}
|
||||
}
|
||||
@ -8,18 +8,24 @@ import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import com.auto.clicker.autoclicker.R;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityFeedbackBinding;
|
||||
import com.auto.clicker.autoclicker.databinding.ActivityTroubleshootingBinding;
|
||||
|
||||
public class TroubleshootingActivity extends AppCompatActivity {
|
||||
private ActivityTroubleshootingBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_troubleshooting);
|
||||
binding = ActivityTroubleshootingBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
binding.back.setOnClickListener(v -> finish());
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,8 @@ public class SettingActivity extends AppCompatActivity {
|
||||
initTabs();
|
||||
|
||||
binding.settingViewpager.setCurrentItem(0, false);
|
||||
|
||||
binding.back.setOnClickListener(v -> finish());
|
||||
}
|
||||
|
||||
private void initPagerAdapter() {
|
||||
|
||||
@ -3,10 +3,12 @@ package com.auto.clicker.autoclicker.ui.adapter.floating;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.auto.clicker.autoclicker.R;
|
||||
import com.auto.clicker.autoclicker.room.entity.Solution;
|
||||
|
||||
import java.util.List;
|
||||
@ -29,7 +31,7 @@ public class SolutionAdapter extends RecyclerView.Adapter<SolutionAdapter.Soluti
|
||||
@Override
|
||||
public SolutionViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(android.R.layout.simple_list_item_1, parent, false);
|
||||
.inflate(R.layout.item_solution, parent, false);
|
||||
return new SolutionViewHolder(view);
|
||||
}
|
||||
|
||||
@ -37,12 +39,18 @@ public class SolutionAdapter extends RecyclerView.Adapter<SolutionAdapter.Soluti
|
||||
public void onBindViewHolder(@NonNull SolutionViewHolder holder, int position) {
|
||||
Solution solution = solutionList.get(position);
|
||||
holder.solutionNameTextView.setText(solution.getSolutionName());
|
||||
if(solution.getMode() == 1){
|
||||
holder.solutionModeNameTextView.setText("1-point Mode");
|
||||
}else {
|
||||
holder.solutionModeNameTextView.setText("Multi-Point Mode");
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
holder.solutionPlayImageView.setOnClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onSolutionClick(solution);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,10 +68,14 @@ public class SolutionAdapter extends RecyclerView.Adapter<SolutionAdapter.Soluti
|
||||
|
||||
static class SolutionViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView solutionNameTextView;
|
||||
TextView solutionModeNameTextView;
|
||||
ImageView solutionPlayImageView;
|
||||
|
||||
SolutionViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
solutionNameTextView = itemView.findViewById(android.R.id.text1);
|
||||
solutionNameTextView = itemView.findViewById(R.id.textViewTopLeft);
|
||||
solutionModeNameTextView = itemView.findViewById(R.id.textViewBottomLeft);
|
||||
solutionPlayImageView = itemView.findViewById(R.id.imageViewRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.auto.clicker.autoclicker.ui.fragment.setting;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -10,109 +11,186 @@ import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.auto.clicker.autoclicker.R;
|
||||
import com.auto.clicker.autoclicker.databinding.FragmentActionBinding;
|
||||
|
||||
|
||||
public class ActionFragment extends Fragment {
|
||||
private FragmentActionBinding binding;
|
||||
|
||||
private static final int TYPE_INTERVAL = 0;
|
||||
private static final int TYPE_SWIPE_DURATION = 1;
|
||||
private static final int TYPE_REPEAT = 2;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
binding = FragmentActionBinding.inflate(inflater, container, false);
|
||||
|
||||
binding.intervalSelectorContainer.setOnClickListener(this::showIntervalUnitSelection);
|
||||
binding.intervalSelectorContainer.setOnClickListener(v -> showUnitSelection(v, TYPE_INTERVAL));
|
||||
binding.unitSelectorContainer.setOnClickListener(v -> showUnitSelection(v, TYPE_SWIPE_DURATION));
|
||||
|
||||
binding.unitSelectorContainer.setOnClickListener(this::showSwipeDurationUnitSelection);
|
||||
setupRepeatMode();
|
||||
|
||||
setupAdvancedMode();
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void showIntervalUnitSelection(View anchorView) {
|
||||
// 加载弹窗布局
|
||||
View popupView = getLayoutInflater().inflate(R.layout.dialog_unit_selection, null);
|
||||
PopupWindow popupWindow = new PopupWindow(
|
||||
popupView,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
true // 设置为 true,以便点击外部区域时自动关闭
|
||||
);
|
||||
|
||||
// 设置背景,否则点击外部无法关闭
|
||||
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
|
||||
// 获取弹窗中的TextViews
|
||||
TextView tvMs = popupView.findViewById(R.id.tv_unit_ms);
|
||||
TextView tvSec = popupView.findViewById(R.id.tv_unit_sec);
|
||||
TextView tvMin = popupView.findViewById(R.id.tv_unit_min);
|
||||
|
||||
// Interval 单位有:毫秒,秒,分钟
|
||||
tvMs.setVisibility(View.VISIBLE);
|
||||
tvSec.setVisibility(View.VISIBLE);
|
||||
tvMin.setVisibility(View.VISIBLE);
|
||||
|
||||
tvMs.setOnClickListener(v -> {
|
||||
binding.intervalSelectedUnit.setText(getString(R.string.milliseconds_unit));
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Interval", binding.etIntervalValue.getText().toString(), getString(R.string.milliseconds_unit));
|
||||
private void setupRepeatMode() {
|
||||
binding.repeatSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (isChecked) {
|
||||
binding.repeatInput.setVisibility(View.VISIBLE);
|
||||
binding.repeatSelectorContainer.setVisibility(View.VISIBLE);
|
||||
binding.repeatSelectedUnit.setText(getString(R.string.infinitely_unit));
|
||||
binding.etRepeatValue.setText("");
|
||||
binding.etRepeatValue.setEnabled(false);
|
||||
binding.etRepeatValue.setInputType(InputType.TYPE_NULL);
|
||||
} else {
|
||||
binding.repeatInput.setVisibility(View.GONE);
|
||||
binding.repeatSelectorContainer.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
tvSec.setOnClickListener(v -> {
|
||||
binding.intervalSelectedUnit.setText(getString(R.string.seconds_unit));
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Interval", binding.etIntervalValue.getText().toString(), getString(R.string.seconds_unit));
|
||||
});
|
||||
if (!binding.repeatSwitch.isChecked()) {
|
||||
binding.repeatInput.setVisibility(View.GONE);
|
||||
binding.repeatSelectorContainer.setVisibility(View.GONE);
|
||||
} else {
|
||||
binding.repeatSelectedUnit.setText(getString(R.string.infinitely_unit));
|
||||
binding.etRepeatValue.setText("");
|
||||
binding.etRepeatValue.setEnabled(false);
|
||||
binding.etRepeatValue.setInputType(InputType.TYPE_NULL);
|
||||
}
|
||||
|
||||
tvMin.setOnClickListener(v -> {
|
||||
binding.intervalSelectedUnit.setText(getString(R.string.minutes_unit));
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Interval", binding.etIntervalValue.getText().toString(), getString(R.string.minutes_unit));
|
||||
});
|
||||
|
||||
// 显示弹窗,使其显示在anchorView下方
|
||||
popupWindow.showAsDropDown(anchorView);
|
||||
binding.repeatSelectorContainer.setOnClickListener(v -> showUnitSelection(v, TYPE_REPEAT));
|
||||
}
|
||||
|
||||
private void showSwipeDurationUnitSelection(View anchorView) {
|
||||
// 加载弹窗布局
|
||||
private void setupAdvancedMode() {
|
||||
binding.advancedSwitch.setChecked(true);
|
||||
|
||||
binding.advancedSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (isChecked) {
|
||||
Toast.makeText(getContext(), "Anti-Detection mode is ON", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getContext(), "Anti-Detection mode is OFF", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showUnitSelection(View anchorView, int type) {
|
||||
View popupView = getLayoutInflater().inflate(R.layout.dialog_unit_selection, null);
|
||||
PopupWindow popupWindow = new PopupWindow(
|
||||
popupView,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
true // 设置为 true,以便点击外部区域时自动关闭
|
||||
true
|
||||
);
|
||||
|
||||
// 设置背景,否则点击外部无法关闭
|
||||
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
|
||||
// 获取弹窗中的TextViews
|
||||
TextView tvMs = popupView.findViewById(R.id.tv_unit_ms);
|
||||
TextView tvSec = popupView.findViewById(R.id.tv_unit_sec);
|
||||
TextView tvMin = popupView.findViewById(R.id.tv_unit_min);
|
||||
TextView tvInfinitely = popupView.findViewById(R.id.tv_unit_infinitely);
|
||||
TextView tvDuration = popupView.findViewById(R.id.tv_unit_duration);
|
||||
TextView tvCycle = popupView.findViewById(R.id.tv_unit_cycle);
|
||||
|
||||
// Swipe duration 单位只有:毫秒,秒
|
||||
tvMs.setVisibility(View.VISIBLE);
|
||||
tvSec.setVisibility(View.VISIBLE);
|
||||
tvMin.setVisibility(View.GONE); // 隐藏分钟选项
|
||||
|
||||
tvMs.setOnClickListener(v -> {
|
||||
binding.tvSelectedUnit.setText(getString(R.string.milliseconds_unit));
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Swipe Duration", binding.etDurationValue.getText().toString(), getString(R.string.milliseconds_unit));
|
||||
});
|
||||
switch (type) {
|
||||
case TYPE_INTERVAL:
|
||||
tvMs.setVisibility(View.VISIBLE);
|
||||
tvSec.setVisibility(View.VISIBLE);
|
||||
tvMin.setVisibility(View.VISIBLE);
|
||||
tvInfinitely.setVisibility(View.GONE);
|
||||
tvDuration.setVisibility(View.GONE);
|
||||
tvCycle.setVisibility(View.GONE);
|
||||
break;
|
||||
case TYPE_SWIPE_DURATION:
|
||||
tvMs.setVisibility(View.VISIBLE);
|
||||
tvSec.setVisibility(View.VISIBLE);
|
||||
tvMin.setVisibility(View.GONE);
|
||||
tvInfinitely.setVisibility(View.GONE);
|
||||
tvDuration.setVisibility(View.GONE);
|
||||
tvCycle.setVisibility(View.GONE);
|
||||
break;
|
||||
case TYPE_REPEAT:
|
||||
tvMs.setVisibility(View.GONE);
|
||||
tvSec.setVisibility(View.GONE);
|
||||
tvMin.setVisibility(View.GONE);
|
||||
tvInfinitely.setVisibility(View.VISIBLE);
|
||||
tvDuration.setVisibility(View.VISIBLE);
|
||||
tvCycle.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
|
||||
tvSec.setOnClickListener(v -> {
|
||||
binding.tvSelectedUnit.setText(getString(R.string.seconds_unit));
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Swipe Duration", binding.etDurationValue.getText().toString(), getString(R.string.seconds_unit));
|
||||
});
|
||||
if (type == TYPE_INTERVAL || type == TYPE_SWIPE_DURATION) {
|
||||
tvMs.setOnClickListener(v -> {
|
||||
String unitText = getString(R.string.milliseconds_unit);
|
||||
if (type == TYPE_INTERVAL) {
|
||||
binding.intervalSelectedUnit.setText(unitText);
|
||||
showInputValue("Interval", binding.etIntervalValue.getText().toString(), unitText);
|
||||
} else {
|
||||
binding.tvSelectedUnit.setText(unitText);
|
||||
showInputValue("Swipe Duration", binding.etDurationValue.getText().toString(), unitText);
|
||||
}
|
||||
popupWindow.dismiss();
|
||||
});
|
||||
|
||||
tvSec.setOnClickListener(v -> {
|
||||
String unitText = getString(R.string.seconds_unit);
|
||||
if (type == TYPE_INTERVAL) {
|
||||
binding.intervalSelectedUnit.setText(unitText);
|
||||
showInputValue("Interval", binding.etIntervalValue.getText().toString(), unitText);
|
||||
} else {
|
||||
binding.tvSelectedUnit.setText(unitText);
|
||||
showInputValue("Swipe Duration", binding.etDurationValue.getText().toString(), unitText);
|
||||
}
|
||||
popupWindow.dismiss();
|
||||
});
|
||||
|
||||
if (type == TYPE_INTERVAL) {
|
||||
tvMin.setOnClickListener(v -> {
|
||||
String unitText = getString(R.string.minutes_unit);
|
||||
binding.intervalSelectedUnit.setText(unitText);
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Interval", binding.etIntervalValue.getText().toString(), unitText);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (type == TYPE_REPEAT) {
|
||||
tvInfinitely.setOnClickListener(v -> {
|
||||
binding.repeatSelectedUnit.setText(getString(R.string.infinitely_unit));
|
||||
binding.etRepeatValue.setText("");
|
||||
binding.etRepeatValue.setEnabled(false);
|
||||
binding.etRepeatValue.setInputType(InputType.TYPE_NULL);
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Repeat", binding.etRepeatValue.getText().toString(), getString(R.string.infinitely_unit));
|
||||
});
|
||||
|
||||
tvDuration.setOnClickListener(v -> {
|
||||
binding.repeatSelectedUnit.setText(getString(R.string.duration_unit));
|
||||
binding.etRepeatValue.setText("");
|
||||
binding.etRepeatValue.setEnabled(true);
|
||||
binding.etRepeatValue.setInputType(InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_TIME); // 设置为时间格式
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Repeat", binding.etRepeatValue.getText().toString(), getString(R.string.duration_unit));
|
||||
});
|
||||
|
||||
tvCycle.setOnClickListener(v -> {
|
||||
binding.repeatSelectedUnit.setText(getString(R.string.cycle_unit));
|
||||
binding.etRepeatValue.setText("");
|
||||
binding.etRepeatValue.setEnabled(true);
|
||||
binding.etRepeatValue.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
popupWindow.dismiss();
|
||||
showInputValue("Repeat", binding.etRepeatValue.getText().toString(), getString(R.string.cycle_unit));
|
||||
});
|
||||
}
|
||||
|
||||
// 显示弹窗,使其显示在anchorView下方
|
||||
popupWindow.showAsDropDown(anchorView);
|
||||
}
|
||||
|
||||
@ -120,13 +198,28 @@ public class ActionFragment extends Fragment {
|
||||
String message = type + " 值: " + (value.isEmpty() ? "未输入" : value) + ", 单位: " + unit;
|
||||
Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();
|
||||
|
||||
if (type.equals("Interval")) {
|
||||
long intervalValue = value.isEmpty() ? 0 : Long.parseLong(value);
|
||||
// 根据 unit 进行单位转换或保存
|
||||
} else if (type.equals("Swipe Duration")) {
|
||||
long durationValue = value.isEmpty() ? 0 : Long.parseLong(value);
|
||||
// 根据 unit 进行单位转换或保存
|
||||
}
|
||||
if (type.equals("Interval")) {
|
||||
long intervalValue = value.isEmpty() ? 0 : Long.parseLong(value);
|
||||
// 根据 unit 进行单位转换或保存 Interval 值
|
||||
// 例如:if (unit.equals(getString(R.string.seconds_unit))) { ... }
|
||||
} else if (type.equals("Swipe Duration")) {
|
||||
long durationValue = value.isEmpty() ? 0 : Long.parseLong(value);
|
||||
// 根据 unit 进行单位转换或保存 Swipe Duration 值
|
||||
} else if (type.equals("Repeat")) {
|
||||
if (unit.equals(getString(R.string.infinitely_unit))) {
|
||||
// Repeat 为无限次,不需要处理输入值
|
||||
} else if (unit.equals(getString(R.string.duration_unit))) {
|
||||
// Repeat 为时长,处理时间格式的输入
|
||||
// 您需要在这里添加解析时间格式的逻辑
|
||||
String durationValue = value.isEmpty() ? "0" : value;
|
||||
// long parsedDuration = parseDurationString(durationValue); // 自定义方法解析时间
|
||||
Toast.makeText(getContext(), "Repeat Duration: " + durationValue, Toast.LENGTH_SHORT).show();
|
||||
} else if (unit.equals(getString(R.string.cycle_unit))) {
|
||||
// Repeat 为次数,处理整数输入
|
||||
int repeatCount = value.isEmpty() ? 0 : Integer.parseInt(value);
|
||||
Toast.makeText(getContext(), "Repeat Cycles: " + repeatCount, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -11,7 +11,6 @@ import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
@ -45,7 +44,8 @@ public class FloatingTabDialogManager {
|
||||
|
||||
private EditText inputName;
|
||||
private Button saveButton;
|
||||
private Button closeButton;
|
||||
private Button closeSaveButton;
|
||||
private Button closeLoadButton;
|
||||
|
||||
private RecyclerView loadRecyclerview;
|
||||
private SolutionAdapter solutionsAdapter;
|
||||
@ -80,7 +80,8 @@ public class FloatingTabDialogManager {
|
||||
|
||||
inputName = savePage.findViewById(R.id.script_name_input);
|
||||
saveButton = savePage.findViewById(R.id.save);
|
||||
closeButton = savePage.findViewById(R.id.close);
|
||||
closeSaveButton = savePage.findViewById(R.id.close);
|
||||
closeLoadButton = loadPage.findViewById(R.id.close);
|
||||
|
||||
saveButton.setOnClickListener(v -> {
|
||||
String solutionName = inputName.getText().toString().trim();
|
||||
@ -109,13 +110,15 @@ public class FloatingTabDialogManager {
|
||||
|
||||
});
|
||||
|
||||
closeButton.setOnClickListener(v -> removeFloatingTabDialog());
|
||||
closeSaveButton.setOnClickListener(v -> removeFloatingTabDialog());
|
||||
closeLoadButton.setOnClickListener(v -> removeFloatingTabDialog());
|
||||
|
||||
loadRecyclerview = loadPage.findViewById(R.id.script_list);
|
||||
loadRecyclerview.setLayoutManager(new LinearLayoutManager(context));
|
||||
|
||||
solutionsAdapter = new SolutionAdapter(solutionList, solution -> {
|
||||
if (floatingViewManager != null) {
|
||||
floatingViewManager.showFloatingViews(solution.getMode());
|
||||
floatingViewManager.loadSolution(solution.solutionId);
|
||||
Toast.makeText(context, "正在加载方案: " + solution.getSolutionName(), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
|
||||
@ -57,6 +57,8 @@ public class FloatingViewManager {
|
||||
private static final String TAG = "FloatingViewManager";
|
||||
public static final long DEBOUNCE_INTERVAL = 500;
|
||||
|
||||
private int mode;
|
||||
|
||||
private int touchPointSize;
|
||||
|
||||
private int controlBarWidth;
|
||||
@ -109,6 +111,8 @@ public class FloatingViewManager {
|
||||
throw new SecurityException("需要悬浮窗许可");
|
||||
}
|
||||
|
||||
this.mode = mode;
|
||||
|
||||
removeAllFloatingViews();
|
||||
showMultipleModeViews(mode);
|
||||
|
||||
@ -117,7 +121,7 @@ public class FloatingViewManager {
|
||||
|
||||
private void showMultipleModeViews(int mode) {
|
||||
initMultipleTouchPointView();
|
||||
initMultipleControlBar();
|
||||
initMultipleControlBar(mode);
|
||||
|
||||
if (multipleControlBarView != null) {
|
||||
windowManager.addView(multipleControlBarView, multipleControlBarParams);
|
||||
@ -129,7 +133,7 @@ public class FloatingViewManager {
|
||||
eventOrderCounter = 1;
|
||||
}
|
||||
|
||||
private void initMultipleControlBar() {
|
||||
private void initMultipleControlBar(int mode) {
|
||||
if (multipleControlBarView != null) {
|
||||
safeRemoveView(multipleControlBarView);
|
||||
multipleControlBarView = null;
|
||||
@ -142,7 +146,7 @@ public class FloatingViewManager {
|
||||
multipleControlBarParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
setupDraggableView(multipleControlBarView, multipleControlBarParams, this::updateMoreControlBarPosition);
|
||||
setupControlButtons(multipleControlBarView);
|
||||
setupControlButtons(multipleControlBarView,mode);
|
||||
|
||||
updateControlBarImageViews(multipleControlBarView, this.controlBarWidth);
|
||||
}
|
||||
@ -220,7 +224,7 @@ public class FloatingViewManager {
|
||||
windowManager.updateViewLayout(multipleControlBarView, multipleControlBarParams);
|
||||
}
|
||||
|
||||
private void setupControlButtons(LinearLayout controlBar) {
|
||||
private void setupControlButtons(LinearLayout controlBar,int mode) {
|
||||
ImageView playButton = controlBar.findViewById(R.id.play_button);
|
||||
ImageView addButton = controlBar.findViewById(R.id.add_button);
|
||||
ImageView removeButton = controlBar.findViewById(R.id.remove_button);
|
||||
@ -230,6 +234,12 @@ public class FloatingViewManager {
|
||||
ImageView settingButton = controlBar.findViewById(R.id.settings_button);
|
||||
ImageView closeButton = controlBar.findViewById(R.id.close_button);
|
||||
|
||||
if (mode == 1){
|
||||
addButton.setVisibility(View.GONE);
|
||||
removeButton.setVisibility(View.GONE);
|
||||
slideButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
playButton.setOnClickListener(v -> toggleMultipleClicking());
|
||||
addButton.setOnClickListener(v -> addPointEvent());
|
||||
removeButton.setOnClickListener(v -> removeLastEvent());
|
||||
@ -620,32 +630,25 @@ public class FloatingViewManager {
|
||||
public void saveCurrentEventsAsSolution(String solutionName, EventRepository.RepositoryCallback<Long> callback) {
|
||||
if (solutionName == null || solutionName.trim().isEmpty()) {
|
||||
Toast.makeText(context, "方案名称不能为空", Toast.LENGTH_SHORT).show();
|
||||
// 在这里调用回调的 onError,或者 onComplete 返回一个表示失败的值
|
||||
// 确保 FloatingTabDialogManager 收到反馈
|
||||
if (callback != null) {
|
||||
callback.onComplete(-1L); // 返回一个表示失败的值
|
||||
callback.onComplete(-1L);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (runtimeEvents.isEmpty()) {
|
||||
Toast.makeText(context, "当前没有事件可以保存", Toast.LENGTH_SHORT).show();
|
||||
if (callback != null) {
|
||||
callback.onComplete(-1L); // 返回一个表示失败的值
|
||||
callback.onComplete(-1L);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Solution newSolution = new Solution(solutionName);
|
||||
Solution newSolution = new Solution(solutionName,mode);
|
||||
eventRepository.insertSolutionWithEvents(newSolution, runtimeEvents, new EventRepository.RepositoryCallback<Long>() {
|
||||
@Override
|
||||
public void onComplete(Long solutionId) {
|
||||
// 成功保存,Toast 可以在这里显示,也可以在 FloatingTabDialogManager 中显示
|
||||
// 为了职责分离,建议在这里显示一个简单的"保存成功" Toast,然后让 FloatingTabDialogManager 决定是否关闭
|
||||
// Toast.makeText(context, "方案 '" + solutionName + "' 保存成功!", Toast.LENGTH_SHORT).show();
|
||||
// 保存失败,Toast 可以在这里显示
|
||||
// Toast.makeText(context, "保存方案失败。", Toast.LENGTH_SHORT).show();
|
||||
if (callback != null) {
|
||||
callback.onComplete(solutionId); // 将结果传递给调用者
|
||||
callback.onComplete(solutionId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/black" />
|
||||
<stroke android:width="2dp" android:color="@color/gray" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="@color/gray" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
|
||||
7
app/src/main/res/drawable/close_bg.xml
Normal file
7
app/src/main/res/drawable/close_bg.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="12dp" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#1A546B" />
|
||||
</shape>
|
||||
15
app/src/main/res/drawable/script_option.xml
Normal file
15
app/src/main/res/drawable/script_option.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="3dp"
|
||||
android:height="23dp"
|
||||
android:viewportWidth="3"
|
||||
android:viewportHeight="23">
|
||||
<path
|
||||
android:pathData="M1.5,1.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
<path
|
||||
android:pathData="M1.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
<path
|
||||
android:pathData="M1.5,21.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/solution_play.xml
Normal file
9
app/src/main/res/drawable/solution_play.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,0C18.627,0 24,5.373 24,12C24,18.627 18.627,24 12,24C5.373,24 0,18.627 0,12C0,5.373 5.373,0 12,0ZM8.143,19.461L20.571,12.286L8.143,5.11V19.461Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
@ -22,6 +22,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="23dp"
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="23dp"
|
||||
|
||||
@ -8,38 +8,58 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unit_ms"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="10dp"
|
||||
android:padding="8dp"
|
||||
android:text="@string/milliseconds_unit"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unit_sec"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="10dp"
|
||||
android:padding="8dp"
|
||||
android:text="@string/seconds_unit"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unit_min"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="10dp"
|
||||
android:padding="8dp"
|
||||
android:text="@string/minutes_unit"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unit_infinitely"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="@string/infinitely_unit"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unit_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="@string/duration_unit"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unit_cycle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="@string/cycle_unit"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
@ -11,367 +11,369 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="25dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/default_actions_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="223dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_default_actions_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Default Actions"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_interval_icon"
|
||||
android:layout_width="11dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/hourglass"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_interval_label"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_interval_label"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_interval_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_interval_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Interval between actions"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_default_actions_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/input_interval"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:background="@drawable/rounded_edittext_background"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/default_actions_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="223dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_interval_label">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_interval_value"
|
||||
android:layout_width="0dp"
|
||||
<TextView
|
||||
android:id="@+id/tv_default_actions_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Default Actions"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_interval_icon"
|
||||
android:layout_width="11dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/hourglass"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_interval_label"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_interval_label"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_interval_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_interval_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Interval between actions"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray" />
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_default_actions_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/interval_selector_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/interval_selected_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="milliseconds"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/interval_unit_dropdown"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="8dp"
|
||||
android:src="@drawable/blue_arrow_down" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/duration_icon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="11dp"
|
||||
android:src="@drawable/left_swipe"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_swipe_duration_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_interval_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_swipe_duration_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_swipe_duration_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Swipe duration"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_interval_label"
|
||||
app:layout_constraintTop_toBottomOf="@id/input_interval" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="41dp"
|
||||
android:text="@string/preview"
|
||||
android:textColor="@color/blue"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_swipe_duration_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_swipe_duration_label" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/input_with_unit_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/rounded_edittext_background"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_swipe_duration_label">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_duration_value"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/unit_selector_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_selected_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="milliseconds"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_unit_dropdown"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="8dp"
|
||||
android:src="@drawable/blue_arrow_down" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/default_cycle_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="134dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="23dp"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_actions_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/default_cycle_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Default cycle"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repeat_icon"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:src="@drawable/cycle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/repeat_text"
|
||||
app:layout_constraintEnd_toStartOf="@+id/repeat_text"
|
||||
app:layout_constraintTop_toTopOf="@+id/repeat_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repeat_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Repeat mode"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_cycle_title" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/repeat_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="35dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/repeat_text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/repeat_text"
|
||||
app:thumbTint="@color/switch_thumb_selector"
|
||||
app:trackTint="@color/switch_track_selector" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repeat_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/repeat_text">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_repeat_value"
|
||||
android:layout_width="123dp"
|
||||
android:id="@+id/input_interval"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:background="@drawable/rounded_edittext_background"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repeat_selector_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="62dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp">
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_interval_label">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repeat_selected_unit"
|
||||
android:layout_width="wrap_content"
|
||||
<EditText
|
||||
android:id="@+id/et_interval_value"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="infinitely"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
android:textColorHint="@color/gray" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repeat_unit_dropdown"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="8dp"
|
||||
android:src="@drawable/blue_arrow_down" />
|
||||
<LinearLayout
|
||||
android:id="@+id/interval_selector_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/interval_selected_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="milliseconds"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/interval_unit_dropdown"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="8dp"
|
||||
android:src="@drawable/blue_arrow_down" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<ImageView
|
||||
android:id="@+id/duration_icon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="11dp"
|
||||
android:src="@drawable/left_swipe"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_swipe_duration_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_interval_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_swipe_duration_label" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/default_advanced_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="87dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_cycle_container">
|
||||
<TextView
|
||||
android:id="@+id/tv_swipe_duration_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Swipe duration"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_interval_label"
|
||||
app:layout_constraintTop_toBottomOf="@id/input_interval" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/default_advanced_title"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="41dp"
|
||||
android:text="@string/preview"
|
||||
android:textColor="@color/blue"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_swipe_duration_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_swipe_duration_label" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/input_with_unit_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/rounded_edittext_background"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_swipe_duration_label">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_duration_value"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/unit_selector_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_selected_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="milliseconds"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_unit_dropdown"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="8dp"
|
||||
android:src="@drawable/blue_arrow_down" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/default_cycle_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Advanced"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/advanced_icon"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:src="@drawable/detection"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/advanced_text"
|
||||
app:layout_constraintEnd_toStartOf="@+id/advanced_text"
|
||||
app:layout_constraintTop_toTopOf="@+id/advanced_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/advanced_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Anti-Detection"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_advanced_title" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/advanced_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="35dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/advanced_text"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="23dp"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
android:paddingBottom="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/advanced_text"
|
||||
app:thumbTint="@color/switch_thumb_selector"
|
||||
app:trackTint="@color/switch_track_selector" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_actions_container">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:id="@+id/default_cycle_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Default cycle"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repeat_icon"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:src="@drawable/cycle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/repeat_text"
|
||||
app:layout_constraintEnd_toStartOf="@+id/repeat_text"
|
||||
app:layout_constraintTop_toTopOf="@+id/repeat_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repeat_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Repeat mode"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_cycle_title" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/repeat_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/repeat_text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/repeat_text"
|
||||
app:layout_constraintVertical_bias="0.31"
|
||||
app:thumbTint="@color/switch_thumb_selector"
|
||||
app:trackTint="@color/switch_track_selector" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repeat_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/repeat_text">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_repeat_value"
|
||||
android:layout_width="123dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/rounded_edittext_background"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repeat_selector_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="62dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repeat_selected_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="4dp"
|
||||
android:text="infinitely"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repeat_unit_dropdown"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="8dp"
|
||||
android:src="@drawable/blue_arrow_down" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/default_advanced_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="87dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_cycle_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/default_advanced_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Advanced"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/advanced_icon"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:src="@drawable/detection"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/advanced_text"
|
||||
app:layout_constraintEnd_toStartOf="@+id/advanced_text"
|
||||
app:layout_constraintTop_toTopOf="@+id/advanced_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/advanced_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="Anti-Detection"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/default_advanced_title" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/advanced_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="35dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/advanced_text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/advanced_text"
|
||||
app:thumbTint="@color/switch_thumb_selector"
|
||||
app:trackTint="@color/switch_track_selector" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -1,6 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="292dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
android:backgroundTint="#164958"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="My Script 1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/mode"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="1-point Mode"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/play"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/solution_play"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/option"
|
||||
android:layout_marginEnd="32dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/script_option"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
45
app/src/main/res/layout/item_solution.xml
Normal file
45
app/src/main/res/layout/item_solution.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_rounded_rect"
|
||||
android:backgroundTint="#164958"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewTopLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="My Script 1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textViewBottomLeft"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewBottomLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="1-point Mode"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewTopLeft" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageViewRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/solution_play"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -48,7 +48,7 @@
|
||||
android:id="@+id/close"
|
||||
android:layout_width="223dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/btn_border_background"
|
||||
android:background="@drawable/close_bg"
|
||||
android:text="Close"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="18sp"
|
||||
|
||||
@ -48,4 +48,7 @@ functionalities.</string>
|
||||
<string name="milliseconds_unit">milliseconds</string>
|
||||
<string name="seconds_unit">seconds</string>
|
||||
<string name="minutes_unit">minutes</string>
|
||||
<string name="infinitely_unit">infinitely</string>
|
||||
<string name="duration_unit">Duration</string>
|
||||
<string name="cycle_unit">Cycle</string>
|
||||
</resources>
|
||||
Loading…
Reference in New Issue
Block a user