规则编辑列表显示优化
This commit is contained in:
parent
219c6614be
commit
7de8a4f084
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Jun 28 13:20:38 HKT 2025
|
#Sat Jun 28 11:53:41 GMT 2025
|
||||||
stageCount=7
|
stageCount=7
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.3
|
baseVersion=15.3
|
||||||
publishVersion=15.3.6
|
publishVersion=15.3.6
|
||||||
buildCount=0
|
buildCount=14
|
||||||
baseBetaVersion=15.3.7
|
baseBetaVersion=15.3.7
|
||||||
|
@ -330,4 +330,8 @@ public class SettingsActivity extends AppCompatActivity implements IWinBoLLActiv
|
|||||||
public void onAbout(View view) {
|
public void onAbout(View view) {
|
||||||
App.getWinBoLLActivityManager().startWinBoLLActivity(this, AboutActivity.class);
|
App.getWinBoLLActivityManager().startWinBoLLActivity(this, AboutActivity.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onLogView(View view) {
|
||||||
|
App.getWinBoLLActivityManager().startLogActivity(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ package cc.winboll.studio.contacts.adapters;
|
|||||||
*/
|
*/
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -20,6 +21,7 @@ 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 cc.winboll.studio.contacts.views.LeftScrollView;
|
import cc.winboll.studio.contacts.views.LeftScrollView;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -60,6 +62,10 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
final SimpleViewHolder simpleViewHolder = (SimpleViewHolder) holder;
|
final SimpleViewHolder simpleViewHolder = (SimpleViewHolder) holder;
|
||||||
String szView = model.getRuleText().trim().equals("") ?"[NULL]": model.getRuleText();
|
String szView = model.getRuleText().trim().equals("") ?"[NULL]": model.getRuleText();
|
||||||
simpleViewHolder.tvRuleText.setText(szView);
|
simpleViewHolder.tvRuleText.setText(szView);
|
||||||
|
simpleViewHolder.checkBoxAllow.setChecked(model.isAllowConnection());
|
||||||
|
simpleViewHolder.checkBoxAllow.setEnabled(false);
|
||||||
|
simpleViewHolder.checkBoxEnable.setChecked(model.isEnable());
|
||||||
|
simpleViewHolder.checkBoxEnable.setEnabled(false);
|
||||||
simpleViewHolder.scrollView.setOnActionListener(new LeftScrollView.OnActionListener(){
|
simpleViewHolder.scrollView.setOnActionListener(new LeftScrollView.OnActionListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -215,16 +221,22 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
|
|
||||||
private final LeftScrollView scrollView;
|
private final LeftScrollView scrollView;
|
||||||
private final TextView tvRuleText;
|
private final TextView tvRuleText;
|
||||||
|
CheckBox checkBoxAllow;
|
||||||
|
CheckBox checkBoxEnable;
|
||||||
|
|
||||||
|
|
||||||
public SimpleViewHolder(@NonNull ViewGroup parent, @NonNull View itemView) {
|
public SimpleViewHolder(@NonNull ViewGroup parent, @NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
scrollView = itemView.findViewById(R.id.scrollView);
|
scrollView = itemView.findViewById(R.id.scrollView);
|
||||||
//tvRuleText = itemView.findViewById(R.id.ruletext_tv);
|
LayoutInflater inflater = LayoutInflater.from(itemView.getContext());
|
||||||
tvRuleText = new TextView(itemView.getContext());
|
View viewContent = inflater.inflate(R.layout.view_phone_connect_rule_simple_content, parent, false);
|
||||||
|
tvRuleText = viewContent.findViewById(R.id.ruletext_tv);
|
||||||
|
checkBoxAllow = viewContent.findViewById(R.id.checkbox_allow);
|
||||||
|
checkBoxEnable = viewContent.findViewById(R.id.checkbox_enable);
|
||||||
|
//tvRuleText = new TextView(itemView.getContext());
|
||||||
scrollView.setContentWidth(parent.getWidth());
|
scrollView.setContentWidth(parent.getWidth());
|
||||||
//scrollView.setContentWidth(600);
|
//scrollView.setContentWidth(600);
|
||||||
scrollView.addContentLayout(tvRuleText);
|
scrollView.addContentLayout(viewContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -243,5 +255,9 @@ public class PhoneConnectRuleAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||||||
buttonConfirm = itemView.findViewById(R.id.button_confirm);
|
buttonConfirm = itemView.findViewById(R.id.button_confirm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setCheckBoxTouchListener(CheckBox checkBox) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ public class LeftScrollView extends HorizontalScrollView {
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addContentLayout(TextView textView) {
|
public void addContentLayout(View viewContent) {
|
||||||
contentLayout.addView(textView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
contentLayout.addView(viewContent, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContentWidth(int contentWidth) {
|
public void setContentWidth(int contentWidth) {
|
||||||
|
@ -300,6 +300,12 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right">
|
android:gravity="right">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="LogView"
|
||||||
|
android:onClick="onLogView"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
android:id="@+id/checkbox_allow"
|
android:id="@+id/checkbox_allow"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="允许连接"/>
|
android:text="连接"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkbox_enable"
|
android:id="@+id/checkbox_enable"
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
<?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>
|
|
@ -0,0 +1,35 @@
|
|||||||
|
<?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:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Text"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/ruletext_tv"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkbox_allow"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="连接"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkbox_enable"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="启用"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user