Compare commits
14 Commits
mymessagem
...
appbase-v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 08eb360dbd | |||
| 819018b149 | |||
| 6e6b262e86 | |||
| 9665856b1b | |||
| 052bbce839 | |||
| 90102f4eea | |||
| 759a08cec9 | |||
| 42cc7a2822 | |||
| c9c95d6ab0 | |||
| bc9bd47daa | |||
| 4bec8c3e9e | |||
| e726c9d435 | |||
| 5277913606 | |||
| c1bd31df2f |
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:left="2dp"
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#0F000000"
|
||||
android:startColor="#0F000000" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:left="3dp"
|
||||
android:top="3dp"
|
||||
android:right="3dp"
|
||||
android:bottom="5dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#00000000"
|
||||
android:startColor="#1AFFFFFF" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FF666666" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -12,7 +12,11 @@
|
||||
android:angle="270"
|
||||
android:endColor="#0F000000"
|
||||
android:startColor="#0F000000" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 背景部分 -->
|
||||
@@ -27,7 +31,11 @@
|
||||
android:angle="270"
|
||||
android:endColor="#0FFFFFFF"
|
||||
android:startColor="#FFFFFFFF" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libaes.views.ADsControlView
|
||||
android:id="@+id/ads_control_view"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -24,7 +24,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.appbase"
|
||||
minSdkVersion 21
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Apr 28 17:08:30 HKT 2026
|
||||
stageCount=22
|
||||
#Sun May 10 04:07:17 HKT 2026
|
||||
stageCount=24
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.15
|
||||
publishVersion=15.15.21
|
||||
publishVersion=15.15.23
|
||||
buildCount=0
|
||||
baseBetaVersion=15.15.22
|
||||
baseBetaVersion=15.15.24
|
||||
|
||||
@@ -19,28 +19,16 @@
|
||||
android:launchMode="singleTop"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation">
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".MainActivityAlias"
|
||||
android:label="@string/app_name"
|
||||
android:exported="true"
|
||||
android:resizeableActivity="true"
|
||||
android:launchMode="singleTop"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".Main2Activity"
|
||||
android:label="@string/app_name"
|
||||
|
||||
@@ -162,25 +162,7 @@ public class MainActivity extends Activity {
|
||||
startActivity(aboutIntent);
|
||||
}
|
||||
|
||||
public void onSplitScreenMode(View view) {
|
||||
LogUtils.d(TAG, "onSplitScreenMode() 分屏测试按钮已点击");
|
||||
ToastUtils.show("分屏测试:已启动新窗口");
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
|
||||
android.graphics.Rect bounds = new android.graphics.Rect();
|
||||
getWindow().getDecorView().getDisplay().getRectSize(bounds);
|
||||
int height = bounds.height();
|
||||
int width = bounds.width();
|
||||
bounds.set(0, 0, width, height / 2);
|
||||
LogUtils.d(TAG, "onSplitScreenMode() 分屏窗口范围: " + bounds);
|
||||
android.content.Intent intent = new android.content.Intent(this, MainActivityAlias.class);
|
||||
intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
LogUtils.d(TAG, "onSplitScreenMode() 准备启动MainActivityAlias");
|
||||
android.app.ActivityOptions options = android.app.ActivityOptions.makeBasic();
|
||||
options.setLaunchBounds(bounds);
|
||||
startActivity(intent, options.toBundle());
|
||||
LogUtils.d(TAG, "onSplitScreenMode() MainActivityAlias已启动");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onMultiInstance(View view) {
|
||||
LogUtils.d(TAG, "onMultiInstance() 多开窗口按钮已点击");
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package cc.winboll.studio.appbase;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
|
||||
public class MainActivityAlias extends MainActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setActionBar(toolbar);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke android:width="1dp" android:color="#FFB0B0B0" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
</shape>
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp" android:background="@drawable/bg_container_border">
|
||||
android:padding="16dp">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
@@ -14,21 +14,21 @@
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0" android:background="@drawable/bg_container_border">
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:spacing="12dp" android:background="@drawable/bg_container_border">
|
||||
android:spacing="12dp">
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关于应用"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:textColor="@android:color/white"
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
@@ -40,7 +40,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="应用崩溃测试"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:textColor="@android:color/white"
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
@@ -52,7 +52,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="应用日志测试"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:textColor="@android:color/white"
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
@@ -64,7 +64,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="应用日志测试(新窗口)"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:textColor="@android:color/white"
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
@@ -76,31 +76,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="应用吐司测试"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:textColor="@android:color/white"
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:onClick="onToastUtilsTest"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="分屏测试"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:onClick="onSplitScreenMode"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="多开窗口"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:textColor="@android:color/white"
|
||||
android:background="#81C7F5"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Main2Activity"
|
||||
android:textSize="24sp"
|
||||
/>
|
||||
android:textColor="@color/gray_900"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -4,6 +4,6 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<attr name="borderCornerRadius" format="dimension" />
|
||||
<declare-styleable name="AboutView">
|
||||
<attr name="app_name" format="string" />
|
||||
<attr name="app_apkfoldername" format="string" />
|
||||
|
||||
@@ -98,7 +98,6 @@ allprojects {
|
||||
options.compilerArgs << "-parameters"
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
// 可选:确保编码一致
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +49,6 @@ public class ASupportToolbar extends Toolbar {
|
||||
// 工具栏描边
|
||||
int nStroke = 5;
|
||||
|
||||
TypedArray taBorder = getContext().obtainStyledAttributes(new int[]{R.attr.borderCornerRadius});
|
||||
float cornerRadius = taBorder.getDimension(0, 6 * getResources().getDisplayMetrics().density);
|
||||
taBorder.recycle();
|
||||
|
||||
//分别为开始颜色,中间夜色,结束颜色
|
||||
int colors0[] = { mEndColor , mCenterColor, mStartColor};
|
||||
GradientDrawable gradientDrawable0;
|
||||
@@ -61,7 +57,7 @@ public class ASupportToolbar extends Toolbar {
|
||||
gradientDrawable0.setShape(GradientDrawable.RECTANGLE);
|
||||
gradientDrawable0.setColors(colors0); //添加颜色组
|
||||
gradientDrawable0.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
|
||||
gradientDrawable0.setCornerRadius(cornerRadius);
|
||||
gradientDrawable0.setCornerRadius(20);
|
||||
|
||||
int colors1[] = { mCenterColor , mCenterColor, mCenterColor };
|
||||
GradientDrawable gradientDrawable1;
|
||||
@@ -70,7 +66,7 @@ public class ASupportToolbar extends Toolbar {
|
||||
gradientDrawable1.setShape(GradientDrawable.RECTANGLE);
|
||||
gradientDrawable1.setColors(colors1); //添加颜色组
|
||||
gradientDrawable1.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
|
||||
gradientDrawable1.setCornerRadius(cornerRadius);
|
||||
gradientDrawable1.setCornerRadius(20);
|
||||
|
||||
int colors2[] = { mEndColor, mCenterColor, mStartColor };
|
||||
GradientDrawable gradientDrawable2;
|
||||
@@ -79,7 +75,7 @@ public class ASupportToolbar extends Toolbar {
|
||||
gradientDrawable2.setShape(GradientDrawable.RECTANGLE);
|
||||
gradientDrawable2.setColors(colors2); //添加颜色组
|
||||
gradientDrawable2.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
|
||||
gradientDrawable2.setCornerRadius(cornerRadius);
|
||||
gradientDrawable2.setCornerRadius(20);
|
||||
|
||||
ld = new LayerDrawable(array); //参数为上面的Drawable数组
|
||||
ld.setLayerInset(2, nStroke * 2, nStroke * 2, getWidth() + nStroke * 2, getHeight() + nStroke * 2);
|
||||
|
||||
@@ -51,10 +51,6 @@ public class AToolbar extends Toolbar {
|
||||
// 工具栏描边
|
||||
int nStroke = 5;
|
||||
|
||||
TypedArray taBorder = getContext().obtainStyledAttributes(new int[]{R.attr.borderCornerRadius});
|
||||
float cornerRadius = taBorder.getDimension(0, 6 * getResources().getDisplayMetrics().density);
|
||||
taBorder.recycle();
|
||||
|
||||
//分别为开始颜色,中间夜色,结束颜色
|
||||
int colors0[] = { mEndColor , mCenterColor, mStartColor};
|
||||
GradientDrawable gradientDrawable0;
|
||||
@@ -63,7 +59,7 @@ public class AToolbar extends Toolbar {
|
||||
gradientDrawable0.setShape(GradientDrawable.RECTANGLE);
|
||||
gradientDrawable0.setColors(colors0); //添加颜色组
|
||||
gradientDrawable0.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
|
||||
gradientDrawable0.setCornerRadius(cornerRadius);
|
||||
gradientDrawable0.setCornerRadius(20);
|
||||
|
||||
int colors1[] = { mCenterColor , mCenterColor, mCenterColor };
|
||||
GradientDrawable gradientDrawable1;
|
||||
@@ -72,7 +68,7 @@ public class AToolbar extends Toolbar {
|
||||
gradientDrawable1.setShape(GradientDrawable.RECTANGLE);
|
||||
gradientDrawable1.setColors(colors1); //添加颜色组
|
||||
gradientDrawable1.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
|
||||
gradientDrawable1.setCornerRadius(cornerRadius);
|
||||
gradientDrawable1.setCornerRadius(20);
|
||||
|
||||
int colors2[] = { mEndColor, mCenterColor, mStartColor };
|
||||
GradientDrawable gradientDrawable2;
|
||||
@@ -81,7 +77,7 @@ public class AToolbar extends Toolbar {
|
||||
gradientDrawable2.setShape(GradientDrawable.RECTANGLE);
|
||||
gradientDrawable2.setColors(colors2); //添加颜色组
|
||||
gradientDrawable2.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
|
||||
gradientDrawable2.setCornerRadius(cornerRadius);
|
||||
gradientDrawable2.setCornerRadius(20);
|
||||
|
||||
|
||||
ld = new LayerDrawable(array); //参数为上面的Drawable数组
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
android:startColor="@color/colorACardShadow"
|
||||
android:centerColor="@color/colorACardShadow"
|
||||
android:endColor="@color/colorACardShadow"/>
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 边框部分 -->
|
||||
@@ -28,7 +32,11 @@
|
||||
android:startColor="@color/colorACardFrame"
|
||||
android:centerColor="@color/colorACardFrame"
|
||||
android:endColor="@color/colorACardFrame"/>
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 背景主体部分 -->
|
||||
@@ -44,7 +52,11 @@
|
||||
android:startColor="@color/colorACardBackgroung"
|
||||
android:centerColor="@color/colorACardBackgroung"
|
||||
android:endColor="@color/colorACardBackgroung"/>
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
android:startColor="?attr/attrAToolbarEndColor"
|
||||
android:centerColor="?attr/attrAToolbarCenterColor"
|
||||
android:endColor="?attr/attrAToolbarStartColor"/>
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 边框部分 -->
|
||||
@@ -28,7 +32,11 @@
|
||||
android:startColor="?attr/attrAToolbarCenterColor"
|
||||
android:centerColor="?attr/attrAToolbarCenterColor"
|
||||
android:endColor="?attr/attrAToolbarCenterColor"/>
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 背景主体部分 -->
|
||||
@@ -44,7 +52,11 @@
|
||||
android:startColor="?attr/attrAToolbarStartColor"
|
||||
android:centerColor="?attr/attrAToolbarCenterColor"
|
||||
android:endColor="?attr/attrAToolbarEndColor"/>
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke android:width="1dp" android:color="#FFB0B0B0" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
</shape>
|
||||
@@ -12,7 +12,11 @@
|
||||
android:angle="270"
|
||||
android:endColor="#0F000000"
|
||||
android:startColor="#0F000000" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 背景部分 -->
|
||||
@@ -27,7 +31,11 @@
|
||||
android:angle="270"
|
||||
android:endColor="@color/colorAccent"
|
||||
android:startColor="@color/colorAccent" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:startColor="@color/colorOHPCTSBackground"
|
||||
android:centerColor="@color/colorOHPCTSBackground"
|
||||
android:endColor="@color/colorOHPCTSBackground"/>
|
||||
<corners android:radius="?attr/borderCornerRadius"/>
|
||||
<corners android:radius="6dip"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 第二进度条 -->
|
||||
@@ -22,7 +22,7 @@
|
||||
android:startColor="@color/colorOHPCTSSecondaryProgress"
|
||||
android:centerColor="@color/colorOHPCTSSecondaryProgress"
|
||||
android:endColor="@color/colorOHPCTSSecondaryProgress"/>
|
||||
<corners android:radius="?attr/borderCornerRadius"/>
|
||||
<corners android:radius="6dip"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
@@ -36,7 +36,7 @@
|
||||
android:startColor="@color/colorOHPCTSProgress"
|
||||
android:centerColor="@color/colorOHPCTSProgress"
|
||||
android:endColor="@color/colorOHPCTSProgress"/>
|
||||
<corners android:radius="?attr/borderCornerRadius"/>
|
||||
<corners android:radius="6dip"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||
android:layout_width="match_parent"
|
||||
@@ -16,6 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/aboutviewroot_ll" android:background="@drawable/bg_container_border" />
|
||||
android:id="@+id/aboutviewroot_ll"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||
android:layout_width="match_parent"
|
||||
@@ -19,13 +19,13 @@
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/activitydrawerLinearLayout1" android:background="@drawable/bg_container_border" />
|
||||
android:id="@+id/activitydrawerLinearLayout1"/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.baoyz.widget.PullRefreshLayout
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||
android:layout_width="match_parent"
|
||||
@@ -15,7 +15,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0" android:background="@drawable/bg_container_border">
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -26,7 +26,7 @@
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/activitydrawerfragmentFrameLayout1" android:background="@drawable/bg_container_border" />
|
||||
android:id="@+id/activitydrawerfragmentFrameLayout1"/>
|
||||
|
||||
<com.baoyz.widget.PullRefreshLayout
|
||||
android:orientation="vertical"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/activitytestaboutfragmentFrameLayout1" android:background="@drawable/bg_container_border" />
|
||||
android:id="@+id/activitytestaboutfragmentFrameLayout1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libaes.views.AToolbar
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用户须知"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
@@ -21,13 +22,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="20dp" android:background="@drawable/bg_container_border">
|
||||
android:layout_marginBottom="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="小米广告SDK隐私政策: "
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray" />
|
||||
|
||||
<!-- 可点击链接(用TextView承载,通过代码设置蓝色+下划线) -->
|
||||
<TextView
|
||||
@@ -42,7 +44,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=",点击链接查看完整政策"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 按钮容器(水平排列) -->
|
||||
@@ -50,7 +53,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end" android:background="@drawable/bg_container_border">
|
||||
android:gravity="end">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_disagree"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -22,7 +22,7 @@
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end" android:background="@drawable/bg_container_border">
|
||||
android:gravity="end">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical" android:background="@drawable/bg_container_border">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -23,7 +23,7 @@
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:id="@+id/fragmentviewpageLinearLayout1" android:background="@drawable/bg_container_border">
|
||||
android:id="@+id/fragmentviewpageLinearLayout1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" android:background="@drawable/bg_container_border">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_centerVertical="true"
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/ads_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ads_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" android:background="@drawable/bg_container_border" />
|
||||
android:orientation="vertical"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp" android:background="@drawable/bg_container_border">
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="应用支持模式设置:"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
|
||||
<RadioGroup
|
||||
@@ -25,6 +26,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="无扰单机模式"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<RadioButton
|
||||
@@ -33,6 +35,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="米盟广告模式"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<RadioButton
|
||||
@@ -40,7 +43,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="云宝物语模式"
|
||||
android:textSize="14sp"/>
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray"/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
@@ -50,7 +54,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="0dp"> <!-- 移除顶部多余间距 -- android:background="@drawable/bg_container_border">
|
||||
android:layout_marginTop="0dp"> <!-- 移除顶部多余间距 -->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_winboll_store"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center" android:background="@drawable/bg_container_border">
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -15,7 +15,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center" android:background="@drawable/bg_container_border">
|
||||
android:gravity="center">
|
||||
|
||||
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
|
||||
android:layout_width="300dp"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<attr name="borderCornerRadius" format="dimension" />
|
||||
<attr name="colorTextColor" format="color" />
|
||||
<attr name="colorPrimary" format="color" />
|
||||
<attr name="colorPrimaryDark" format="color" />
|
||||
|
||||
@@ -9,7 +9,7 @@ android {
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 30
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Apr 28 17:08:04 HKT 2026
|
||||
stageCount=22
|
||||
#Sun May 10 04:07:17 HKT 2026
|
||||
stageCount=24
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.15
|
||||
publishVersion=15.15.21
|
||||
publishVersion=15.15.23
|
||||
buildCount=0
|
||||
baseBetaVersion=15.15.22
|
||||
baseBetaVersion=15.15.24
|
||||
|
||||
@@ -456,6 +456,7 @@ public final class CrashHandler {
|
||||
int padding = dp2px(16); // 内边距 16dp(适配不同屏幕)
|
||||
message.setPadding(padding, padding, padding, padding);
|
||||
message.setText(mLog); // 设置崩溃日志
|
||||
message.setTextColor(Color.BLACK); // 文字黑色
|
||||
message.setTextIsSelectable(true); // 支持文本选择(便于手动复制)
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ public class GlobalCrashReportView extends LinearLayout {
|
||||
// 设置默认配色
|
||||
mTitleColor = Color.WHITE;
|
||||
mTitleBackgroundColor = Color.BLACK;
|
||||
mTextColor = Color.BLACK;
|
||||
mTextBackgroundColor = Color.WHITE;
|
||||
// 加载布局
|
||||
inflateView();
|
||||
@@ -209,7 +210,7 @@ public class GlobalCrashReportView extends LinearLayout {
|
||||
);
|
||||
mTextColor = typedArray.getColor(
|
||||
R.styleable.GlobalCrashActivity_colorText,
|
||||
0
|
||||
Color.BLACK
|
||||
);
|
||||
mTextBackgroundColor = typedArray.getColor(
|
||||
R.styleable.GlobalCrashActivity_colorTextBackgound, // 注:原拼写错误,保持与 attrs.xml 一致
|
||||
@@ -252,7 +253,7 @@ public class GlobalCrashReportView extends LinearLayout {
|
||||
|
||||
// 配置日志文本控件样式
|
||||
if (mTvReport != null) {
|
||||
if (mTextColor != 0) mTvReport.setTextColor(mTextColor);
|
||||
mTvReport.setTextColor(mTextColor);
|
||||
mTvReport.setBackgroundColor(mTextBackgroundColor);
|
||||
// 可选:设置日志文本换行方式(默认已换行,此处增强可读性)
|
||||
mTvReport.setSingleLine(false);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -116,6 +116,7 @@ public class LogView extends RelativeLayout {
|
||||
// 获取Log Level spinner实例
|
||||
mLogLevelSpinner = findViewById(cc.winboll.studio.libappbase.R.id.viewlogSpinner1);
|
||||
|
||||
metTagSearch.setTextColor(mContext.getResources().getColor(R.color.white));
|
||||
metTagSearch.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
@Override
|
||||
@@ -247,6 +248,7 @@ public class LogView extends RelativeLayout {
|
||||
}
|
||||
mSelectAllTAGCheckBox.setLayoutParams(layoutParams2);
|
||||
//mSelectAllTAGCheckBox.setPadding(0,0,0,0);
|
||||
mSelectAllTAGCheckBox.setTextColor(mContext.getResources().getColor(R.color.white));
|
||||
mSelectAllTAGCheckBox.setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -500,6 +502,7 @@ public class LogView extends RelativeLayout {
|
||||
}
|
||||
holder.tvText.setLayoutParams(layoutParams);
|
||||
holder.tvText.setPadding(0,0,0,0);
|
||||
holder.tvText.setTextColor(mContext.getResources().getColor(R.color.white));
|
||||
holder.cbChecked.setChecked(item.isChecked());
|
||||
holder.cbChecked.setLayoutParams(layoutParams);
|
||||
holder.cbChecked.setPadding(0,0,0,0);
|
||||
|
||||
@@ -3,7 +3,6 @@ package cc.winboll.studio.libappbase.views;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.TypedArray;
|
||||
import android.net.Uri;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
@@ -422,11 +421,8 @@ public class AboutView extends LinearLayout {
|
||||
*/
|
||||
private android.graphics.drawable.Drawable create_item_background() {
|
||||
android.graphics.drawable.GradientDrawable drawable = new android.graphics.drawable.GradientDrawable();
|
||||
TypedArray taBorder = mItemContext.obtainStyledAttributes(new int[]{R.attr.borderCornerRadius});
|
||||
float cornerRadius = taBorder.getDimension(0, 6 * mItemContext.getResources().getDisplayMetrics().density);
|
||||
taBorder.recycle();
|
||||
drawable.setStroke(1, mItemContext.getResources().getColor(R.color.gray_200));
|
||||
drawable.setCornerRadius(cornerRadius);
|
||||
drawable.setCornerRadius(4);
|
||||
drawable.setColor(mItemContext.getResources().getColor(android.R.color.white));
|
||||
return drawable;
|
||||
}
|
||||
@@ -453,6 +449,7 @@ public class AboutView extends LinearLayout {
|
||||
TextView tvTitle = new TextView(mItemContext);
|
||||
tvTitle.setText(mTitle);
|
||||
tvTitle.setTextSize(16);
|
||||
tvTitle.setTextColor(mItemContext.getResources().getColor(R.color.gray_900));
|
||||
llText.addView(tvTitle);
|
||||
// 内容
|
||||
TextView tvContent = new TextView(mItemContext);
|
||||
|
||||
@@ -154,6 +154,7 @@ public class LogTagSpinner extends Spinner {
|
||||
// 4. 文字对齐(垂直居中+靠左,符合常规 UI 设计)
|
||||
//itemTv.setGravity(View.GRAVITY_CENTER_VERTICAL | View.GRAVITY_START);
|
||||
// 5. 文字颜色(统一深色,可改为项目颜色资源)
|
||||
itemTv.setTextColor(this.mContext.getColor(R.color.white));
|
||||
itemTv.setBackgroundColor(this.mContext.getColor(R.color.btn_gray_normal));
|
||||
// 6. 文字溢出处理(最多 2 行,超出省略,避免长标签换行过多)
|
||||
itemTv.setSingleLine(false);
|
||||
|
||||
@@ -5,5 +5,9 @@
|
||||
android:width="1dp"
|
||||
android:color="#000000" /> <!-- 这里可调整边框宽度和颜色 -->
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke android:width="1dp" android:color="#FFB0B0B0" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
</shape>
|
||||
@@ -12,7 +12,11 @@
|
||||
android:angle="270"
|
||||
android:endColor="@color/colorPrimary"
|
||||
android:startColor="@color/colorPrimary" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 背景部分 -->
|
||||
@@ -27,7 +31,11 @@
|
||||
android:angle="270"
|
||||
android:endColor="@color/colorPrimary"
|
||||
android:startColor="@color/colorPrimary" />
|
||||
<corners android:radius="?attr/borderCornerRadius" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
@@ -16,5 +16,5 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/aboutviewroot_ll" android:background="@drawable/bg_container_border" />
|
||||
android:id="@+id/aboutviewroot_ll"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libappbase.GlobalCrashReportView
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
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="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="正在监听NFC卡片,请贴近设备检测密钥..."
|
||||
android:textSize="17sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:layout_marginBottom="30dp"/>
|
||||
@@ -25,6 +26,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="私钥内容:无"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:maxLines="5"
|
||||
android:ellipsize="end"/>
|
||||
@@ -36,6 +38,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="公钥内容:无"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:maxLines="5"
|
||||
android:ellipsize="end"/>
|
||||
@@ -47,6 +50,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="功能按钮待激活"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:backgroundTint="@android:color/holo_blue_light"
|
||||
android:padding="14dp"
|
||||
android:enabled="false"/>
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="应用指纹校验"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/gray_900"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_sign_fingerprint"
|
||||
@@ -44,7 +45,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:textSize="11sp"
|
||||
android:gravity="center"/>
|
||||
android:gravity="center"
|
||||
android:textColor="@color/gray_900"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="设置服务器地址"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#212121"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end" android:background="@drawable/bg_container_border">
|
||||
android:gravity="end">
|
||||
|
||||
<!-- 取消按钮 -->
|
||||
<Button
|
||||
@@ -50,7 +51,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="确认"
|
||||
android:textSize="14sp"
|
||||
android:backgroundTint="#2196F3"/>
|
||||
android:backgroundTint="#2196F3"
|
||||
android:textColor="#FFFFFF"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -12,7 +12,7 @@
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="16dp" android:background="@drawable/bg_container_border">
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<cc.winboll.studio.libappbase.views.DebugSwitchImageView
|
||||
android:id="@+id/iv_app_icon"
|
||||
@@ -25,7 +25,8 @@
|
||||
android:id="@+id/tv_app_name_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"/>
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/gray_900"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app_desc"
|
||||
@@ -33,7 +34,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textSize="14sp"/>
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_500"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -46,7 +48,7 @@
|
||||
android:id="@+id/ll_function_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" android:background="@drawable/bg_container_border" />
|
||||
android:orientation="vertical"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
@@ -54,7 +56,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:spacing="20dp" android:background="@drawable/bg_container_border">
|
||||
android:spacing="20dp">
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="48dp"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/viewglobalcrashreportLinearLayout1" android:background="@drawable/bg_container_border">
|
||||
android:id="@+id/viewglobalcrashreportLinearLayout1">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
@@ -15,11 +15,11 @@
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0" android:background="@drawable/bg_container_border">
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
android:layout_height="@dimen/log_button_height"
|
||||
android:textSize="@dimen/log_text_size"
|
||||
android:text="Clean"
|
||||
android:textColor="@color/white"
|
||||
android:backgroundTint="@drawable/btn_gray_bg"
|
||||
android:layout_centerVertical="true"
|
||||
android:id="@+id/viewlogButtonClean"
|
||||
@@ -33,7 +34,8 @@
|
||||
android:layout_toRightOf="@+id/viewlogButtonClean"
|
||||
android:layout_centerVertical="true"
|
||||
android:id="@+id/viewlogTextView1"
|
||||
android:background="@color/btn_gray_normal"/>
|
||||
android:background="@color/btn_gray_normal"
|
||||
android:textColor="@color/black"/>
|
||||
|
||||
<cc.winboll.studio.libappbase.widget.LogTagSpinner
|
||||
android:layout_width="wrap_content"
|
||||
@@ -52,13 +54,14 @@
|
||||
android:text="Selectable"
|
||||
android:background="@color/btn_gray_normal"
|
||||
android:id="@+id/viewlogCheckBoxSelectable"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:padding="@dimen/log_text_padding"/>
|
||||
android:padding="@dimen/log_text_padding"
|
||||
android:textColor="@color/white"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="@dimen/log_button_width"
|
||||
android:layout_height="@dimen/log_button_height"
|
||||
android:textSize="@dimen/log_text_size"
|
||||
android:textColor="@color/white"
|
||||
android:backgroundTint="@drawable/btn_gray_bg"
|
||||
android:text="Copy"
|
||||
android:layout_alignParentRight="true"
|
||||
@@ -86,7 +89,6 @@
|
||||
android:id="@+id/viewlogCheckBox1"
|
||||
android:background="@drawable/bg_border_round"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
<EditText
|
||||
@@ -121,7 +123,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_below="@+id/viewlogLinearLayout1" android:background="@drawable/bg_container_border">
|
||||
android:layout_below="@+id/viewlogLinearLayout1">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
@@ -134,6 +136,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="@dimen/log_text_size"
|
||||
android:text="Text"
|
||||
android:textColor="#FF00FF00"
|
||||
android:textIsSelectable="true"
|
||||
android:id="@+id/viewlogTextViewLog"/>
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<attr name="borderCornerRadius" format="dimension" />
|
||||
<attr name="themeGlobalCrashActivity" format="reference"/>
|
||||
|
||||
<declare-styleable name="GlobalCrashActivity">
|
||||
|
||||
38
libwinboll/build.gradle
Normal file
38
libwinboll/build.gradle
Normal file
@@ -0,0 +1,38 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven-publish'
|
||||
apply from: '../.winboll/winboll_lib_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
android {
|
||||
// 适配MIUI12
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 30
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// 网络连接类库
|
||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
// Gson
|
||||
api 'com.google.code.gson:gson:2.8.9'
|
||||
// Html 解析
|
||||
api 'org.jsoup:jsoup:1.13.1'
|
||||
// 添加JSch依赖(SFTP核心,com.jcraft:jsch:0.1.54)
|
||||
api 'com.jcraft:jsch:0.1.54'
|
||||
|
||||
// WinBoLL库 nexus.winboll.cc 地址
|
||||
api 'cc.winboll.studio:libaes:15.15.2'
|
||||
api 'cc.winboll.studio:libappbase:15.15.11'
|
||||
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
8
libwinboll/build.properties
Normal file
8
libwinboll/build.properties
Normal file
@@ -0,0 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat May 09 19:01:46 GMT 2026
|
||||
stageCount=27
|
||||
libraryProject=libwinboll
|
||||
baseVersion=15.11
|
||||
publishVersion=15.11.26
|
||||
buildCount=29
|
||||
baseBetaVersion=15.11.27
|
||||
17
libwinboll/proguard-rules.pro
vendored
Normal file
17
libwinboll/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in C:/tools/adt-bundle-windows-x86_64-20131030/sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
12
libwinboll/src/main/AndroidManifest.xml
Normal file
12
libwinboll/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="cc.winboll.studio.libwinboll" >
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".WinBoLLLibraryActivity">
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package cc.winboll.studio.libwinboll;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
|
||||
public class WinBoLLLibraryActivity extends Activity
|
||||
{
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_winbolllibrary);
|
||||
|
||||
ToastUtils.show("WinBoLLLibraryActivity onCreate");
|
||||
}
|
||||
}
|
||||
BIN
libwinboll/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
BIN
libwinboll/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
libwinboll/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
libwinboll/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
11
libwinboll/src/main/res/layout/activity_winbolllibrary.xml
Normal file
11
libwinboll/src/main/res/layout/activity_winbolllibrary.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="cc.winboll.studio.libwinboll.WinBoLLLibraryActivity"/>
|
||||
|
||||
</LinearLayout>
|
||||
5
libwinboll/src/main/res/values-v21/styles.xml
Normal file
5
libwinboll/src/main/res/values-v21/styles.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="@android:style/Theme.Material.Light">
|
||||
</style>
|
||||
</resources>
|
||||
7
libwinboll/src/main/res/values/strings.xml
Normal file
7
libwinboll/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="lib_name">libwinboll</string>
|
||||
<string name="hello_world">Hello world!</string>
|
||||
|
||||
</resources>
|
||||
5
libwinboll/src/main/res/values/styles.xml
Normal file
5
libwinboll/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,45 +0,0 @@
|
||||
# MyMessageManager
|
||||
|
||||
#### 介绍
|
||||
用正则表达式方法自定义短信过滤和语音播报的短信应用。
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码:ZhanGSKen(ZhanGSKen<zhangsken@188.com>)
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
#### 参考文档
|
||||
|
||||
使用GitHub Actions实现Android自动打包apk
|
||||
https://blog.csdn.net/ZZL23333/article/details/115798615?app_version=6.0.0&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22115798615%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
|
||||
|
||||
Android中assets的使用(用于读取内容)
|
||||
https://blog.csdn.net/qq_27664947/article/details/103924058?app_version=6.0.0&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22103924058%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply from: '../.winboll/winboll_app_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
def genVersionName(def versionName){
|
||||
// 检查编译标志位配置
|
||||
assert (winbollBuildProps['stageCount'] != null)
|
||||
assert (winbollBuildProps['baseVersion'] != null)
|
||||
// 保存基础版本号
|
||||
winbollBuildProps.setProperty("baseVersion", "${versionName}");
|
||||
//保存编译标志配置
|
||||
FileOutputStream fos = new FileOutputStream(winbollBuildPropsFile)
|
||||
winbollBuildProps.store(fos, "${winbollBuildPropsDesc}");
|
||||
fos.close();
|
||||
|
||||
// 返回编译版本号
|
||||
return "${versionName}." + winbollBuildProps['stageCount']
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
compileSdkVersion 30
|
||||
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.mymessagemanager"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 30
|
||||
versionCode 8
|
||||
// versionName 更新后需要手动设置
|
||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "15.12"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
}
|
||||
|
||||
// 米盟 SDK
|
||||
packagingOptions {
|
||||
doNotStrip "*/*/libmimo_1011.so"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
// 米盟
|
||||
api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
|
||||
//注意:以下5个库必须要引入
|
||||
//api 'androidx.appcompat:appcompat:1.4.1'
|
||||
api 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
api 'com.google.code.gson:gson:2.8.5'
|
||||
api 'com.github.bumptech.glide:glide:4.9.0'
|
||||
//annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
|
||||
|
||||
api 'io.github.medyo:android-about-page:2.0.0'
|
||||
api 'com.jcraft:jsch:0.1.55'
|
||||
api 'org.jsoup:jsoup:1.13.1'
|
||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
|
||||
api 'com.belerweb:pinyin4j:2.5.1'
|
||||
|
||||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
||||
api 'com.github.getActivity:XXPermissions:18.63'
|
||||
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
||||
|
||||
// AndroidX 类库
|
||||
api 'androidx.appcompat:appcompat:1.1.0'
|
||||
api 'com.google.android.material:material:1.4.0'
|
||||
//api 'androidx.viewpager:viewpager:1.0.0'
|
||||
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||
//api 'androidx.fragment:fragment:1.1.0'
|
||||
api 'com.google.android.material:material:1.0.0'
|
||||
|
||||
// WinBoLL库 nexus.winboll.cc 地址
|
||||
api 'cc.winboll.studio:libaes:15.15.9'
|
||||
api 'cc.winboll.studio:libappbase:15.15.21'
|
||||
|
||||
// WinBoLL备用库 jitpack.io 地址
|
||||
//api 'com.github.ZhanGSKen:AES:aes-v15.12.9'
|
||||
//api 'com.github.ZhanGSKen:APPBase:appbase-v15.14.1'
|
||||
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat May 09 14:21:58 HKT 2026
|
||||
stageCount=12
|
||||
libraryProject=
|
||||
baseVersion=15.12
|
||||
publishVersion=15.12.11
|
||||
buildCount=0
|
||||
baseBetaVersion=15.12.12
|
||||
143
mymessagemanager/proguard-rules.pro
vendored
143
mymessagemanager/proguard-rules.pro
vendored
@@ -1,143 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# ============================== 基础通用规则 ==============================
|
||||
# 保留系统组件
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends android.app.Service
|
||||
-keep public class * extends android.content.BroadcastReceiver
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
-keep public class * extends android.app.backup.BackupAgentHelper
|
||||
-keep public class * extends android.preference.Preference
|
||||
|
||||
# 保留 WinBoLL 核心包及子类(合并简化规则)
|
||||
-keep class cc.winboll.studio.** { *; }
|
||||
-keepclassmembers class cc.winboll.studio.** { *; }
|
||||
|
||||
# 保留所有类中的 public static final String TAG 字段(便于日志定位)
|
||||
-keepclassmembers class * {
|
||||
public static final java.lang.String TAG;
|
||||
}
|
||||
|
||||
# 保留序列化类(避免Parcelable/Gson解析异常)
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
-keepclassmembers class * implements java.io.Serializable {
|
||||
static final long serialVersionUID;
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
java.lang.Object writeReplace();
|
||||
java.lang.Object readResolve();
|
||||
}
|
||||
|
||||
# 保留 R 文件(避免资源ID混淆)
|
||||
-keepclassmembers class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
|
||||
# 保留 native 方法(避免JNI调用失败)
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
# 保留注解和泛型(避免反射/序列化异常)
|
||||
-keepattributes *Annotation*
|
||||
-keepattributes Signature
|
||||
|
||||
# 屏蔽 Java 8+ 警告(适配 Java 7 语法)
|
||||
-dontwarn java.lang.invoke.*
|
||||
-dontwarn android.support.v8.renderscript.*
|
||||
-dontwarn java.util.function.**
|
||||
|
||||
# ============================== 第三方框架专项规则 ==============================
|
||||
# OkHttp 4.4.1(米盟广告请求依赖,完善Lambda兼容)
|
||||
-keep class okhttp3.** { *; }
|
||||
-keep interface okhttp3.** { *; }
|
||||
-keep class okhttp3.internal.** { *; }
|
||||
-keep class okio.** { *; }
|
||||
-dontwarn okhttp3.internal.platform.**
|
||||
-dontwarn okio.**
|
||||
# ============================== 必要补充规则 ==============================
|
||||
# OkHttp 4.4.1 补充规则(Java 7 兼容)
|
||||
-keep class okhttp3.internal.concurrent.** { *; }
|
||||
-keep class okhttp3.internal.connection.** { *; }
|
||||
-dontwarn okhttp3.internal.concurrent.TaskRunner
|
||||
-dontwarn okhttp3.internal.connection.RealCall
|
||||
|
||||
# Glide 4.9.0(米盟广告图片加载依赖)
|
||||
-keep public class * implements com.bumptech.glide.module.GlideModule
|
||||
-keep public class * extends com.bumptech.glide.module.AppGlideModule
|
||||
-keep public enum com.bumptech.glide.load.ImageHeaderParser$ImageType {
|
||||
**[] $VALUES;
|
||||
public *;
|
||||
}
|
||||
-keepclassmembers class * implements com.bumptech.glide.module.AppGlideModule {
|
||||
<init>();
|
||||
}
|
||||
-dontwarn com.bumptech.glide.**
|
||||
|
||||
# Gson 2.8.5(米盟广告数据序列化依赖)
|
||||
-keep class com.google.gson.** { *; }
|
||||
-keep interface com.google.gson.** { *; }
|
||||
-keepclassmembers class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# 米盟 SDK(核心广告组件,完整保留避免加载失败)
|
||||
-keep class com.miui.zeus.** { *; }
|
||||
-keep interface com.miui.zeus.** { *; }
|
||||
# 保留米盟日志字段(便于广告加载失败排查)
|
||||
-keepclassmembers class com.miui.zeus.mimo.sdk.** {
|
||||
public static final java.lang.String TAG;
|
||||
}
|
||||
|
||||
# RecyclerView 1.0.0(米盟广告布局渲染依赖)
|
||||
-keep class androidx.recyclerview.** { *; }
|
||||
-keep interface androidx.recyclerview.** { *; }
|
||||
-keepclassmembers class androidx.recyclerview.widget.RecyclerView$Adapter {
|
||||
public *;
|
||||
}
|
||||
|
||||
# 其他第三方框架(按引入依赖保留,无则可删除)
|
||||
# XXPermissions 18.63
|
||||
-keep class com.hjq.permissions.** { *; }
|
||||
-keep interface com.hjq.permissions.** { *; }
|
||||
|
||||
# ZXing 二维码(核心解析组件)
|
||||
-keep class com.google.zxing.** { *; }
|
||||
-keep class com.journeyapps.zxing.** { *; }
|
||||
|
||||
# Jsoup HTML解析
|
||||
-keep class org.jsoup.** { *; }
|
||||
|
||||
# Pinyin4j 拼音搜索
|
||||
-keep class net.sourceforge.pinyin4j.** { *; }
|
||||
|
||||
# JSch SSH组件
|
||||
-keep class com.jcraft.jsch.** { *; }
|
||||
|
||||
# AndroidX 基础组件
|
||||
-keep class androidx.appcompat.** { *; }
|
||||
-keep interface androidx.appcompat.** { *; }
|
||||
|
||||
# ============================== 优化与调试配置 ==============================
|
||||
# 优化级别(平衡混淆效果与性能)
|
||||
-optimizationpasses 5
|
||||
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
|
||||
|
||||
# 调试辅助(保留行号便于崩溃定位)
|
||||
-verbose
|
||||
-dontpreverify
|
||||
-dontusemixedcaseclassnames
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" >
|
||||
|
||||
<application>
|
||||
|
||||
<!-- Put flavor specific code here -->
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="cc.winboll.studio.mymessagemanager.beta.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_provider"/>
|
||||
|
||||
</provider>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">我的短信管家 ☆</string>
|
||||
|
||||
</resources>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">My Message Manager +</string>
|
||||
|
||||
</resources>
|
||||
@@ -1,227 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="cc.winboll.studio.mymessagemanager">
|
||||
|
||||
<!-- 发送短信 -->
|
||||
<uses-permission android:name="android.permission.SEND_SMS"/>
|
||||
|
||||
<!-- 接收讯息(短信) -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||
|
||||
<!-- 读取短信 -->
|
||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
||||
|
||||
<!-- WRITE_SMS -->
|
||||
<uses-permission android:name="android.permission.WRITE_SMS"/>
|
||||
|
||||
<!-- 接收讯息(彩信) -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_MMS"/>
|
||||
|
||||
<!-- 开机启动 -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
|
||||
<!-- 运行前台服务 -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||
|
||||
<!-- 读取联系人 -->
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
|
||||
<!-- 读取您共享存储空间中的内容 -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
|
||||
<!-- 修改或删除您共享存储空间中的内容 -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<!-- 接收讯息 (WAP) -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH"/>
|
||||
|
||||
<!-- MANAGE_EXTERNAL_STORAGE -->
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<!-- 此应用可显示在其他应用上方 -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||
|
||||
<queries>
|
||||
|
||||
<intent>
|
||||
|
||||
<action android:name="android.intent.action.TTS_SERVICE"/>
|
||||
|
||||
</intent>
|
||||
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:roundIcon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MyAppTheme"
|
||||
android:persistent="true"
|
||||
android:resizeableActivity="true"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config">
|
||||
|
||||
<activity android:name=".activitys.SMSActivity"/>
|
||||
|
||||
<activity android:name=".activitys.SMSReceiveRuleActivity">
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activitys.SharedJSONReceiveActivity"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
|
||||
<action android:name="android.intent.action.EDIT"/>
|
||||
|
||||
<data android:mimeType="application/json"/>
|
||||
|
||||
<data android:mimeType="text/x-json"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".activitys.TTSPlayRuleActivity"/>
|
||||
|
||||
<activity android:name=".activitys.AboutActivity"/>
|
||||
|
||||
<activity
|
||||
android:name=".activitys.MainActivity"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activitys.ComposeSMSActivity"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
|
||||
<action android:name="android.intent.action.SENDTO"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
|
||||
<data android:scheme="sms"/>
|
||||
|
||||
<data android:scheme="smsto"/>
|
||||
|
||||
<data android:scheme="mms"/>
|
||||
|
||||
<data android:scheme="mmsto"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".activitys.AppSettingsActivity"/>
|
||||
|
||||
<service android:name=".services.TTSPlayService"/>
|
||||
|
||||
<service android:name=".services.MainService"/>
|
||||
|
||||
<service android:name=".services.AssistantService"/>
|
||||
|
||||
<service
|
||||
android:name=".services.DefaultSMSManagerService"
|
||||
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
|
||||
<data android:scheme="sms"/>
|
||||
|
||||
<data android:scheme="smsto"/>
|
||||
|
||||
<data android:scheme="mms"/>
|
||||
|
||||
<data android:scheme="mmsto"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</service>
|
||||
|
||||
<receiver
|
||||
android:name=".receivers.MainReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false"
|
||||
android:directBootAware="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".receivers.SMSRecevier"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BROADCAST_SMS">
|
||||
|
||||
<intent-filter android:priority="1">
|
||||
|
||||
<action android:name="android.provider.Telephony.SMS_DELIVER"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".receivers.MmsReceiver"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BROADCAST_WAP_PUSH">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER"/>
|
||||
|
||||
<data android:mimeType="application/vnd.wap.mms-message"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</receiver>
|
||||
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="4.0"/>
|
||||
|
||||
<activity android:name="cc.winboll.studio.mymessagemanager.activitys.SMSRecycleActivity"/>
|
||||
|
||||
<activity android:name="cc.winboll.studio.mymessagemanager.activitys.SMSRecycle2Activity"/>
|
||||
|
||||
<activity android:name="cc.winboll.studio.mymessagemanager.unittest.UnitTestActivity"/>
|
||||
|
||||
<activity android:name="cc.winboll.studio.mymessagemanager.activitys.TTSFloatSettingsActivity"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,7 +0,0 @@
|
||||
[
|
||||
{
|
||||
"userId": -1,
|
||||
"ruleData": ".*",
|
||||
"isEnable": true
|
||||
}
|
||||
]
|
||||
@@ -1,38 +0,0 @@
|
||||
[
|
||||
{
|
||||
"userId": 1,
|
||||
"ruleName": "规则1",
|
||||
"demoSMSText": "【短信应用A】验证码123456",
|
||||
"patternText": "^(【.*】)验证码(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)$",
|
||||
"ttdRuleText": "$1验证码是($2)($3)($4)($5)($6)($7)。",
|
||||
"isSimpleView": false,
|
||||
"isEnable": true
|
||||
},
|
||||
{
|
||||
"userId": 1,
|
||||
"ruleName": "规则2",
|
||||
"demoSMSText": "[短信应用A]验证码123456",
|
||||
"patternText": "^(\\[.*\\])验证码(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)$",
|
||||
"ttdRuleText": "$1验证码是($2)($3)($4)($5)($6)($7)。",
|
||||
"isSimpleView": false,
|
||||
"isEnable": true
|
||||
},
|
||||
{
|
||||
"userId": 1,
|
||||
"ruleName": "规则3",
|
||||
"demoSMSText": "【短信应用A】验证码123456",
|
||||
"patternText": ".*(【.+】).*",
|
||||
"ttdRuleText": "短信来自$1。",
|
||||
"isSimpleView": false,
|
||||
"isEnable": true
|
||||
},
|
||||
{
|
||||
"userId": 1,
|
||||
"ruleName": "规则4",
|
||||
"demoSMSText": "[短信应用A]验证码123456",
|
||||
"patternText": ".*(\\[.*\\]).*",
|
||||
"ttdRuleText": "短信来自$1。",
|
||||
"isSimpleView": false,
|
||||
"isEnable": true
|
||||
}
|
||||
]
|
||||
@@ -1,52 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2023/07/24 01:46:59
|
||||
* @Describe 全局应用类
|
||||
*/
|
||||
import android.view.Gravity;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import java.io.File;
|
||||
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
||||
|
||||
public class App extends GlobalApplication {
|
||||
|
||||
public static final String TAG = "GlobalApplication";
|
||||
|
||||
static String _mszAppExternalFilesDir;
|
||||
static String _mszConfigUtilFileName = "ConfigUtil.json";
|
||||
static String _mszConfigUtilPath;
|
||||
static String _mszSMSReceiveRuleUtilFileName = "SMSReceiveRuleUtil.json";
|
||||
static String _mszSMSReceiveRuleUtilPath;
|
||||
|
||||
public static final int USER_ID = -1;
|
||||
Long mszVersionName = 1L;
|
||||
Long mszDataVersionName = 1L;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
setIsDebugging(BuildConfig.DEBUG);
|
||||
//setIsDebugging(false);
|
||||
|
||||
// 初始化窗口管理类
|
||||
WinBoLLActivityManager.init(this);
|
||||
|
||||
// 初始化 Toast 框架
|
||||
ToastUtils.init(this);
|
||||
|
||||
_mszAppExternalFilesDir = getExternalFilesDir(TAG).toString();
|
||||
_mszConfigUtilPath = _mszAppExternalFilesDir + File.separator + _mszConfigUtilFileName;
|
||||
_mszSMSReceiveRuleUtilPath = _mszAppExternalFilesDir + File.separator + _mszSMSReceiveRuleUtilFileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
super.onTerminate();
|
||||
ToastUtils.release();
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.models.APPInfo;
|
||||
import cc.winboll.studio.libappbase.views.AboutView;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
|
||||
public static final String TAG = "AboutActivity";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
AboutView aboutView = findViewById(R.id.aboutview);
|
||||
aboutView.setAPPInfo(genDefaultAppInfo());
|
||||
}
|
||||
|
||||
private APPInfo genDefaultAppInfo() {
|
||||
LogUtils.d(TAG, "genDefaultAppInfo() 调用");
|
||||
String branchName = "mymessagemanager";
|
||||
APPInfo appInfo = new APPInfo();
|
||||
appInfo.setAppName("MyMessageManager");
|
||||
appInfo.setAppIcon(R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription(getString(R.string.app_description));
|
||||
appInfo.setAppGitName("WinBoLL");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(branchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(branchName);
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/apks/index.php?project=MyMessageManager");
|
||||
appInfo.setAppAPKName("MyMessageManager");
|
||||
appInfo.setAppAPKFolderName("MyMessageManager");
|
||||
LogUtils.d(TAG, "genDefaultAppInfo: 应用信息已生成");
|
||||
return appInfo;
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen<zhangsken@qq.com>
|
||||
* @Date 2024/05/12 20:03:42
|
||||
* @Describe 应用设置窗口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.Switch;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||
import cc.winboll.studio.libaes.views.AToolbar;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.dialogs.CharsetRefuseEditDialog;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.PermissionUtil;
|
||||
|
||||
public class AppSettingsActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
|
||||
public static final String TAG = "AppSettingsActivity";
|
||||
|
||||
// 讯飞语记官网下载页链接
|
||||
private static final String XUNFEI_YUJI_DOWNLOAD_URL = "https://iflynote.com/h/share-download-app.html";
|
||||
|
||||
AppConfigUtil mAppConfigUtil;
|
||||
AToolbar mAToolbar;
|
||||
AOHPCTCSeekBar mAOHPCTCSeekBar;
|
||||
EditText metTTSPlayDelayTimes;
|
||||
EditText metPhoneMergePrefix;
|
||||
Switch mswMergePrefixPhone;
|
||||
Switch mswSMSRecycleProtectMode;
|
||||
//EditText metProtectModerRefuseChars;
|
||||
EditText metProtectModerReplaceChars;
|
||||
String mszProtectModerRefuseChars = "";
|
||||
RadioGroup mRadioGroupRecycleBin;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_appsettings);
|
||||
|
||||
// 初始化属性
|
||||
mAppConfigUtil = AppConfigUtil.getInstance(this);
|
||||
int nTtsPlayDelayTimes = mAppConfigUtil.mAppConfigBean.getTtsPlayDelayTimes();
|
||||
metTTSPlayDelayTimes = findViewById(R.id.activityappsettingsEditText1);
|
||||
metTTSPlayDelayTimes.setText(Integer.toString(nTtsPlayDelayTimes / 1000));
|
||||
|
||||
// 初始化标题栏
|
||||
mAToolbar = findViewById(R.id.activityappsettingsAToolbar1);
|
||||
mAToolbar.setSubtitle(getString(R.string.activity_name_appsettings));
|
||||
setActionBar(mAToolbar);
|
||||
|
||||
metPhoneMergePrefix = findViewById(R.id.activityappsettingsEditText2);
|
||||
metPhoneMergePrefix.setText(mAppConfigUtil.mAppConfigBean.getCountryCode());
|
||||
|
||||
mswMergePrefixPhone = findViewById(R.id.activityappsettingsSwitch1);
|
||||
mswMergePrefixPhone.setChecked(mAppConfigUtil.mAppConfigBean.isMergeCountryCodePrefix());
|
||||
|
||||
mswSMSRecycleProtectMode = findViewById(R.id.activityappsettingsSwitch3);
|
||||
mswSMSRecycleProtectMode.setChecked(mAppConfigUtil.mAppConfigBean.isSMSRecycleProtectMode());
|
||||
|
||||
//metProtectModerRefuseChars = findViewById(R.id.activityappsettingsEditText3);
|
||||
//metProtectModerRefuseChars.setText(mAppConfigUtil.mAppConfigBean.getProtectModerRefuseChars());
|
||||
mszProtectModerRefuseChars = mAppConfigUtil.mAppConfigBean.getProtectModerRefuseChars();
|
||||
|
||||
metProtectModerReplaceChars = findViewById(R.id.activityappsettingsEditText4);
|
||||
metProtectModerReplaceChars.setText(mAppConfigUtil.mAppConfigBean.getProtectModerReplaceChars());
|
||||
|
||||
mRadioGroupRecycleBin = findViewById(R.id.activityappsettingsRadioGroup1);
|
||||
if (mAppConfigUtil.mAppConfigBean.getRecycleBinClass().equals("SMSRecycle2Activity")) {
|
||||
mRadioGroupRecycleBin.check(R.id.activityappsettingsRadioButton2);
|
||||
} else {
|
||||
mRadioGroupRecycleBin.check(R.id.activityappsettingsRadioButton1);
|
||||
}
|
||||
|
||||
mAOHPCTCSeekBar = findViewById(R.id.activityappsettingsAOHPCTCSeekBar1);
|
||||
mAOHPCTCSeekBar.setThumb(getDrawable(R.drawable.cursor_pointer));
|
||||
mAOHPCTCSeekBar.setThumbOffset(0);
|
||||
mAOHPCTCSeekBar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener(){
|
||||
|
||||
@Override
|
||||
public void onOHPCommit() {
|
||||
mAppConfigUtil.reLoadConfig();
|
||||
mAppConfigUtil.mAppConfigBean.setIsSMSRecycleProtectMode(mswSMSRecycleProtectMode.isChecked());
|
||||
if (mRadioGroupRecycleBin.getCheckedRadioButtonId() == R.id.activityappsettingsRadioButton2) {
|
||||
mAppConfigUtil.mAppConfigBean.setRecycleBinClass("SMSRecycle2Activity");
|
||||
} else {
|
||||
mAppConfigUtil.mAppConfigBean.setRecycleBinClass("SMSRecycleActivity");
|
||||
}
|
||||
//mAppConfigUtil.mAppConfigBean.setProtectModerRefuseChars(metProtectModerRefuseChars.getText().toString());
|
||||
mAppConfigUtil.mAppConfigBean.setProtectModerRefuseChars(mszProtectModerRefuseChars);
|
||||
mAppConfigUtil.mAppConfigBean.setProtectModerReplaceChars(metProtectModerReplaceChars.getText().toString());
|
||||
mAppConfigUtil.mAppConfigBean.setCountryCode(metPhoneMergePrefix.getText().toString());
|
||||
mAppConfigUtil.mAppConfigBean.setIsMergeCountryCodePrefix(mswMergePrefixPhone.isChecked());
|
||||
int nTtsPlayDelayTimes = 1000 * Integer.parseInt(metTTSPlayDelayTimes.getText().toString());
|
||||
mAppConfigUtil.mAppConfigBean.setTtsPlayDelayTimes(nTtsPlayDelayTimes);
|
||||
mAppConfigUtil.saveConfig();
|
||||
Toast.makeText(getApplication(), "App config data is saved.", Toast.LENGTH_SHORT).show();
|
||||
//LogUtils.d(TAG, "TTS Play Delay Times is setting to : " + Integer.toString(mAppConfigData.getTtsPlayDelayTimes()));Toast.makeText(getApplication(), "onOHPCommit", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
public void onOpenSystemDefaultAppSettings(View view) {
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
public void onCheckAndGetAppPermission(View view) {
|
||||
//LogUtils.d(TAG, "onCheckAndGetAppPermission");
|
||||
if (PermissionUtil.checkAndGetAppPermission(this)) {
|
||||
Toast.makeText(getApplication(), "应用已获得所需权限。", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public void onAddTTSSupport(View view) {
|
||||
try {
|
||||
// 1. 创建Intent,Action为“打开网页”
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
// 2. 设置要跳转的URL
|
||||
intent.setData(Uri.parse(XUNFEI_YUJI_DOWNLOAD_URL));
|
||||
// 3. 确保Intent可被解析(避免无浏览器时崩溃)
|
||||
if (intent.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(intent); // 跳转至浏览器打开下载页
|
||||
} else {
|
||||
// 无浏览器时的提示
|
||||
Toast.makeText(this, "未找到浏览器应用,请安装后重试", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, "无法打开下载页面,请稍后再试", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public void onCharsetRefuseEditDialog(View view) {
|
||||
CharsetRefuseEditDialog dlg = new CharsetRefuseEditDialog(this, new CharsetRefuseEditDialog.OnTextConfirmListener(){
|
||||
@Override
|
||||
public void onTextConfirmed(String editText) {
|
||||
//ToastUtils.show(editText);
|
||||
mszProtectModerRefuseChars = editText;
|
||||
}
|
||||
}, mszProtectModerRefuseChars);
|
||||
dlg.show();
|
||||
}
|
||||
|
||||
public void onTTSFloatSettingsActivity(View view) {
|
||||
Intent intent = new Intent(this, TTSFloatSettingsActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
@@ -1,368 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
|
||||
* @Date 2025/08/30 14:32
|
||||
* @Describe 联系人查询与短信发送窗口
|
||||
*/
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.beans.PhoneBean;
|
||||
import cc.winboll.studio.mymessagemanager.utils.PhoneUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import android.app.Activity;
|
||||
|
||||
public class ComposeSMSActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
|
||||
public static String TAG = "ComposeSMSActivity";
|
||||
public static String EXTRA_SMSBODY = "sms_body";
|
||||
private static final String MAP_NAME = "NAME";
|
||||
private static final String MAP_PHONE = "PHONE";
|
||||
|
||||
private String mszSMSBody;
|
||||
private String mszScheme;
|
||||
private String mszPhoneTo;
|
||||
private TextView mtvTOName;
|
||||
private EditText metTONameSearch;
|
||||
private EditText metTO;
|
||||
private EditText metSMSBody;
|
||||
private SimpleAdapter mSimpleAdapter;
|
||||
private List<Map<String, Object>> mAdapterData = new ArrayList<Map<String, Object>>();
|
||||
private ListView mlvContracts;
|
||||
private List<PhoneBean> mListPhoneBeanContracts;
|
||||
private Toolbar mToolbar;
|
||||
private AOHPCTCSeekBar mAOHPCTCSeekBar;
|
||||
private RelativeLayout mrlContracts;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
LogUtils.d(TAG, "onCreate");
|
||||
setContentView(R.layout.activity_composesms);
|
||||
|
||||
// 初始化Intent数据(增加空判断,避免NullPointerException)
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
mszSMSBody = intent.getStringExtra(EXTRA_SMSBODY);
|
||||
if (intent.getData() != null) {
|
||||
mszScheme = intent.getData().getScheme();
|
||||
mszPhoneTo = intent.getData().getSchemeSpecificPart();
|
||||
}
|
||||
}
|
||||
|
||||
// 校验启动方式,非smsto则退出
|
||||
if (mszScheme == null || !"smsto".equals(mszScheme)) {
|
||||
ToastUtils.show("不支持的启动方式");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
initView();
|
||||
initAdapter(null); // 初始加载所有联系人
|
||||
setListViewPrePositionByPhone();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
// 初始化标题栏
|
||||
mToolbar = (Toolbar) findViewById(R.id.activitycomposesmsASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_composesms));
|
||||
setActionBar(mToolbar);
|
||||
|
||||
// 初始化联系人姓名显示和搜索栏
|
||||
mtvTOName = (TextView) findViewById(R.id.activitycomposesmsTextView2);
|
||||
mrlContracts = (RelativeLayout) findViewById(R.id.activitycomposesmsRelativeLayout1);
|
||||
metTONameSearch = (EditText) findViewById(R.id.activitycomposesmsEditText2);
|
||||
|
||||
// 姓名搜索框文本变化监听
|
||||
metTONameSearch.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
metTO.setText(""); // 清空号码输入框,避免冲突
|
||||
String input = s == null ? "" : s.toString().trim();
|
||||
if (input.isEmpty()) {
|
||||
initAdapter(null); // 空搜索时显示所有联系人
|
||||
} else {
|
||||
setListViewPrePositionByName(); // 按姓名搜索
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
// 无操作
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// 无操作
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化联系人列表(关键:设置单选模式,确保选中状态生效)
|
||||
mlvContracts = (ListView) findViewById(R.id.activitycomposesmsListView1);
|
||||
mlvContracts.setChoiceMode(ListView.CHOICE_MODE_SINGLE); // 开启单选,与布局中一致
|
||||
|
||||
// 初始化号码输入框(核心:优化文本变化监听逻辑)
|
||||
metTO = (EditText) findViewById(R.id.activitycomposesmsEditText1);
|
||||
if (mszPhoneTo != null) {
|
||||
metTO.setText(mszPhoneTo);
|
||||
}
|
||||
metTO.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
mtvTOName.setText(""); // 清空姓名显示
|
||||
String inputPhone = s == null ? "" : s.toString().trim();
|
||||
|
||||
if (inputPhone.isEmpty()) {
|
||||
// 输入为空时,显示所有联系人
|
||||
initAdapter(null);
|
||||
} else {
|
||||
// 输入非空时,按号码搜索并更新列表(无结果则清空)
|
||||
filterListByPhone(inputPhone);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
// 无操作
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// 无操作
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化发送控件
|
||||
mAOHPCTCSeekBar = (AOHPCTCSeekBar) findViewById(R.id.viewsmssendpart1AOHPCTCSeekBar1);
|
||||
Drawable thumbDrawable = getResources().getDrawable(R.drawable.ic_message); // Java 7兼容写法
|
||||
mAOHPCTCSeekBar.setThumb(thumbDrawable);
|
||||
mAOHPCTCSeekBar.setThumbOffset(20);
|
||||
mAOHPCTCSeekBar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||
@Override
|
||||
public void onOHPCommit() {
|
||||
sendSMS();
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化短信内容输入框
|
||||
TextView tvAOHPCTCSeekBarMSG = (TextView) findViewById(R.id.viewsmssendpart1TextView1);
|
||||
tvAOHPCTCSeekBarMSG.setText(R.string.msg_100sendmsg);
|
||||
metSMSBody = (EditText) findViewById(R.id.viewsmssendpart1EditText1);
|
||||
if (mszSMSBody != null) {
|
||||
metSMSBody.setText(mszSMSBody);
|
||||
}
|
||||
}
|
||||
|
||||
// 核心优化:根据输入号码筛选列表(无结果则显示空列表,优化选中逻辑)
|
||||
private void filterListByPhone(String inputPhone) {
|
||||
PhoneUtil phoneUtil = new PhoneUtil(this);
|
||||
List<PhoneBean> allContacts = phoneUtil.getPhoneList();
|
||||
List<PhoneBean> matchedContacts = new ArrayList<PhoneBean>();
|
||||
|
||||
// 遍历所有联系人,匹配包含输入号码的联系人
|
||||
for (PhoneBean contact : allContacts) {
|
||||
if (contact.getTelPhone().contains(inputPhone)
|
||||
|| phoneUtil.isTheSamePhoneNumber(contact.getTelPhone(), inputPhone)) {
|
||||
matchedContacts.add(contact);
|
||||
}
|
||||
}
|
||||
|
||||
LogUtils.d(TAG, "号码搜索:输入'" + inputPhone + "', 匹配" + matchedContacts.size() + "个结果");
|
||||
|
||||
// 用筛选结果更新列表(无结果则传入空列表)
|
||||
initAdapter(matchedContacts.isEmpty() ? new ArrayList<PhoneBean>() : matchedContacts);
|
||||
|
||||
// 定位并选中匹配项(如果有)
|
||||
if (!matchedContacts.isEmpty()) {
|
||||
boolean isFound = false;
|
||||
for (int i = 0; i < matchedContacts.size(); i++) {
|
||||
PhoneBean item = matchedContacts.get(i);
|
||||
// 精确匹配号码(兼容区域码格式)
|
||||
if (phoneUtil.isTheSamePhoneNumber(item.getTelPhone(), inputPhone)) {
|
||||
mtvTOName.setText(item.getName());
|
||||
// 关键:先滚动到目标位置,再设置选中状态
|
||||
mlvContracts.setSelection(i);
|
||||
// 主动设置选中(确保样式生效,兼容部分系统)
|
||||
mlvContracts.setItemChecked(i, true);
|
||||
LogUtils.d(TAG, String.format("%s 匹配 %s,选中位置:%d", inputPhone, item.getTelPhone(), i));
|
||||
isFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 若未精确匹配,选中第一个结果
|
||||
/*if (!isFound) {
|
||||
mlvContracts.setSelection(0);
|
||||
mlvContracts.setItemChecked(0, true);
|
||||
mtvTOName.setText(matchedContacts.get(0).getName());
|
||||
}*/
|
||||
} else {
|
||||
mtvTOName.setText(""); // 无结果时清空姓名显示
|
||||
}
|
||||
}
|
||||
|
||||
// 根据姓名搜索联系人
|
||||
private void setListViewPrePositionByName() {
|
||||
String searchName = metTONameSearch.getText().toString().trim();
|
||||
PhoneUtil phoneUtil = new PhoneUtil(this);
|
||||
List<PhoneBean> matchedContacts = phoneUtil.getPhonesByName(searchName);
|
||||
initAdapter(matchedContacts);
|
||||
if (!matchedContacts.isEmpty()) {
|
||||
// 选中第一个结果并设置样式
|
||||
mlvContracts.setSelection(0);
|
||||
mlvContracts.setItemChecked(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
// 初始定位号码对应的联系人
|
||||
private void setListViewPrePositionByPhone() {
|
||||
String inputPhone = metTO.getText().toString().trim();
|
||||
if (inputPhone.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
filterListByPhone(inputPhone); // 复用筛选逻辑
|
||||
}
|
||||
|
||||
// 获取号码匹配的位置(兼容旧逻辑)
|
||||
private int getContractsDataPrePositionByPhone(String szPhone) {
|
||||
if (mListPhoneBeanContracts == null || mListPhoneBeanContracts.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < mListPhoneBeanContracts.size(); i++) {
|
||||
PhoneBean bean = mListPhoneBeanContracts.get(i);
|
||||
if (bean.getTelPhone().compareTo(szPhone) >= 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 获取姓名匹配的位置(兼容旧逻辑)
|
||||
private int getContractsDataPrePositionByName(String szName) {
|
||||
if (mListPhoneBeanContracts == null || mListPhoneBeanContracts.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < mListPhoneBeanContracts.size(); i++) {
|
||||
if (mListPhoneBeanContracts.get(i).getName().startsWith(szName)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 初始化或更新列表适配器
|
||||
private void initAdapter(List<PhoneBean> initData) {
|
||||
mAdapterData.clear(); // 清空旧数据
|
||||
final PhoneUtil phoneUtil = new PhoneUtil(this);
|
||||
|
||||
// 确定数据源:传入的筛选数据或所有联系人
|
||||
if (initData != null) {
|
||||
mListPhoneBeanContracts = initData;
|
||||
} else {
|
||||
mListPhoneBeanContracts = phoneUtil.getPhoneList();
|
||||
}
|
||||
|
||||
// 转换数据为SimpleAdapter所需格式
|
||||
if (mListPhoneBeanContracts != null) {
|
||||
for (PhoneBean bean : mListPhoneBeanContracts) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put(MAP_NAME, bean.getName());
|
||||
map.put(MAP_PHONE, bean.getTelPhone());
|
||||
mAdapterData.add(map);
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化或更新适配器
|
||||
if (mSimpleAdapter == null) {
|
||||
mSimpleAdapter = new SimpleAdapter(
|
||||
ComposeSMSActivity.this,
|
||||
mAdapterData,
|
||||
R.layout.listview_contracts,
|
||||
new String[]{MAP_NAME, MAP_PHONE},
|
||||
new int[]{R.id.listviewcontractsTextView1, R.id.listviewcontractsTextView2}
|
||||
);
|
||||
mSimpleAdapter.setDropDownViewResource(R.layout.listview_contracts);
|
||||
mlvContracts.setAdapter(mSimpleAdapter);
|
||||
|
||||
// 列表项点击事件:点击时主动设置选中状态,确保样式突显
|
||||
mlvContracts.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
if (position < mAdapterData.size()) {
|
||||
// 1. 主动设置当前项为选中状态
|
||||
mlvContracts.setItemChecked(position, true);
|
||||
// 2. 更新号码输入框和姓名显示
|
||||
String phone = mAdapterData.get(position).get(MAP_PHONE).toString();
|
||||
metTO.setText(phone);
|
||||
mtvTOName.setText(phoneUtil.getNameByPhone(phone));
|
||||
// 3. 滚动到点击位置(确保可见)
|
||||
mlvContracts.setSelection(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 列表项选中状态变化监听(可选,增强选中反馈)
|
||||
mlvContracts.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
// 未选中时无操作
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 数据更新时,先取消所有旧选中状态,再通知适配器刷新
|
||||
mlvContracts.clearChoices();
|
||||
mSimpleAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// 发送短信逻辑
|
||||
private void sendSMS() {
|
||||
String phoneTo = metTO.getText().toString().trim();
|
||||
if (phoneTo.isEmpty()) {
|
||||
ToastUtils.show("没有设置接收号码。");
|
||||
return;
|
||||
}
|
||||
String smsBody = metSMSBody.getText().toString().trim();
|
||||
if (smsBody.isEmpty()) {
|
||||
ToastUtils.show("没有消息内容可发送。");
|
||||
return;
|
||||
}
|
||||
if (SMSUtil.sendMessageByInterface2(ComposeSMSActivity.this, phoneTo, smsBody)) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,346 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ScrollView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||
import cc.winboll.studio.libaes.utils.DevelopUtils;
|
||||
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
||||
import cc.winboll.studio.libaes.views.ADsBannerView;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.mymessagemanager.App;
|
||||
import cc.winboll.studio.mymessagemanager.BuildConfig;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.MainActivity;
|
||||
import cc.winboll.studio.mymessagemanager.adapters.PhoneArrayAdapter;
|
||||
import cc.winboll.studio.mymessagemanager.services.MainService;
|
||||
import cc.winboll.studio.mymessagemanager.unittest.UnitTestActivity;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AppGoToSettingsUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.PermissionUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.ViewUtil;
|
||||
import cc.winboll.studio.mymessagemanager.views.ConfirmSwitchView;
|
||||
import cc.winboll.studio.mymessagemanager.views.PhoneListViewForScrollView;
|
||||
import com.baoyz.widget.PullRefreshLayout;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MainActivity extends WinBoLLActivity {
|
||||
|
||||
public final static String TAG = "MainActivity";
|
||||
|
||||
public static final int ACTIVITY_RESULT_APP_SETTINGS = -1;
|
||||
|
||||
public final static int MSG_RELOADSMS = 0;
|
||||
|
||||
public static final int PERMISSION_SETTING_FOR_RESULT = 0;
|
||||
public static final int MY_PERMISSIONS_REQUEST = 0;
|
||||
|
||||
static MainActivity _mMainActivity;
|
||||
ADsBannerView mADsBannerView;
|
||||
|
||||
//LogView mLogView;
|
||||
AppConfigUtil mAppConfigUtil;
|
||||
ConfirmSwitchView msvEnableService;
|
||||
ConfirmSwitchView msvOnlyReceiveContacts;
|
||||
ConfirmSwitchView msvEnableTTS;
|
||||
ConfirmSwitchView msvEnableTTSRuleMode;
|
||||
PhoneListViewForScrollView mListViewPhone;
|
||||
Toolbar mToolbar;
|
||||
PhoneArrayAdapter mPhoneArrayAdapter;
|
||||
AppGoToSettingsUtil mAppGoToSettingsUtil;
|
||||
String[] mPermissionList = {Manifest.permission.READ_CONTACTS,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_SMS};
|
||||
ArrayList<String> listPerms;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
_mMainActivity = MainActivity.this;
|
||||
|
||||
// 米盟广告栏
|
||||
mADsBannerView = findViewById(R.id.adsbanner);
|
||||
|
||||
mAppConfigUtil = AppConfigUtil.getInstance(this);
|
||||
initView();
|
||||
|
||||
// 调用调试检查函数
|
||||
onOnceAndroidStory(null);
|
||||
}
|
||||
|
||||
//
|
||||
// 这是一个测试函数,
|
||||
// 用于调试读取 string.xml string-array使用。
|
||||
//
|
||||
public void onOnceAndroidStory(View view) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
// 获取strings.xml文件中的tab_names数组
|
||||
String[] tab_names = getResources().getStringArray(R.array.strings_OnceAndroidStory);
|
||||
// 这里R.array.tab_names是你在XML文件中定义的数组资源ID
|
||||
// 例如,在strings.xml中可能这样定义:
|
||||
/*/ <!-- strings.xml -->
|
||||
<resources>
|
||||
<string-array name="tab_names">
|
||||
<item>Tab 1</item>
|
||||
<item>Tab 2</item>
|
||||
<item>Tab 3</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
*/
|
||||
// 现在你可以遍历这个数组来访问每个元素
|
||||
for (int i = 0; i < tab_names.length; i++) {
|
||||
// 创建Random实例并传入任意非负种子(这里是1)
|
||||
java.util.Random r = new java.util.Random(1);
|
||||
// 调用nextInt(6),范围是0到5(包括0和5),加1后得到1到5
|
||||
int randomNum = r.nextInt(6) + 1;
|
||||
System.out.println("Random number between 1 and 5: " + randomNum);
|
||||
LogUtils.d("OnceAndroidStory", tab_names[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void scrollScrollView() {
|
||||
ScrollView sv = findViewById(R.id.activitymainScrollView1);
|
||||
ViewUtil.scrollScrollView(sv);
|
||||
}
|
||||
|
||||
void genTestData() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
SMSUtil.saveReceiveSms(this, "13172887736", "调试阶段生成的短信" + Integer.toString(i), "0", -1, "inbox");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 初始化视图控件
|
||||
//
|
||||
void initView() {
|
||||
// 设置调试日志
|
||||
// mLogView = findViewById(R.id.logview);
|
||||
// mLogView.start();
|
||||
|
||||
// 设置消息处理函数
|
||||
setOnActivityMessageReceived(mIOnActivityMessageReceived);
|
||||
|
||||
// 设置标题栏
|
||||
mToolbar = findViewById(R.id.activitymainASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_main));
|
||||
setSupportActionBar(mToolbar);
|
||||
|
||||
boolean isEnableService = mAppConfigUtil.mAppConfigBean.isEnableService();
|
||||
msvEnableService = findViewById(R.id.activitymainSwitchView1);
|
||||
msvEnableService.setChecked(isEnableService);
|
||||
msvEnableService.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isEnable = ((ConfirmSwitchView)v).isChecked();
|
||||
mAppConfigUtil.reLoadConfig();
|
||||
mAppConfigUtil.mAppConfigBean.setIsEnableService(isEnable);
|
||||
mAppConfigUtil.saveConfig();
|
||||
initService(isEnable);
|
||||
}
|
||||
});
|
||||
|
||||
boolean isOnlyReceiveContacts = mAppConfigUtil.mAppConfigBean.isEnableOnlyReceiveContacts();
|
||||
msvOnlyReceiveContacts = findViewById(R.id.activitymainSwitchView2);
|
||||
msvOnlyReceiveContacts.setChecked(isOnlyReceiveContacts);
|
||||
msvOnlyReceiveContacts.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isEnable = ((ConfirmSwitchView)v).isChecked();
|
||||
mAppConfigUtil.reLoadConfig();
|
||||
mAppConfigUtil.mAppConfigBean.setIsEnableOnlyReceiveContacts(isEnable);
|
||||
mAppConfigUtil.saveConfig();
|
||||
}
|
||||
});
|
||||
|
||||
boolean isEnableTTS = mAppConfigUtil.mAppConfigBean.isEnableTTS();
|
||||
msvEnableTTS = findViewById(R.id.activitymainSwitchView3);
|
||||
msvEnableTTS.setChecked(isEnableTTS);
|
||||
msvEnableTTS.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isEnable = ((ConfirmSwitchView)v).isChecked();
|
||||
mAppConfigUtil.reLoadConfig();
|
||||
mAppConfigUtil.mAppConfigBean.setIsEnableTTS(isEnable);
|
||||
mAppConfigUtil.saveConfig();
|
||||
}
|
||||
});
|
||||
|
||||
boolean isEnableTTSRuleMode = mAppConfigUtil.mAppConfigBean.isEnableTTSRuleMode();
|
||||
msvEnableTTSRuleMode = findViewById(R.id.activitymainSwitchView4);
|
||||
msvEnableTTSRuleMode.setChecked(isEnableTTSRuleMode);
|
||||
msvEnableTTSRuleMode.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isEnable = ((ConfirmSwitchView)v).isChecked();
|
||||
mAppConfigUtil.reLoadConfig();
|
||||
mAppConfigUtil.mAppConfigBean.setIsEnableTTSRuleMode(isEnable);
|
||||
mAppConfigUtil.saveConfig();
|
||||
}
|
||||
});
|
||||
|
||||
initService(isEnableService);
|
||||
|
||||
// 短信发送窗口按钮
|
||||
Button btnSendSMS = findViewById(R.id.activitymainButton1);
|
||||
btnSendSMS.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Uri uri = Uri.parse("smsto:");
|
||||
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
|
||||
it.putExtra("sms_body", "");
|
||||
startActivity(it);
|
||||
}
|
||||
});
|
||||
|
||||
mListViewPhone = (PhoneListViewForScrollView) findViewById(R.id.activitymainListView1);
|
||||
//准备数据
|
||||
mPhoneArrayAdapter = new PhoneArrayAdapter(MainActivity.this);
|
||||
|
||||
final PullRefreshLayout layout = (PullRefreshLayout) findViewById(R.id.activitymainPullRefreshLayout1);
|
||||
//将适配器加载到控件中
|
||||
mListViewPhone.setAdapter(mPhoneArrayAdapter);
|
||||
|
||||
// listen refresh event
|
||||
layout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
// start refresh
|
||||
reloadSMS();
|
||||
layout.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initService(boolean isEnableService) {
|
||||
if (isEnableService) {
|
||||
Intent service = new Intent(this, MainService.class);
|
||||
startService(service);
|
||||
} else {
|
||||
Intent service = new Intent(this, MainService.class);
|
||||
stopService(service);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 定义应用内消息处理函数
|
||||
//
|
||||
IOnActivityMessageReceived mIOnActivityMessageReceived = new IOnActivityMessageReceived(){
|
||||
|
||||
@Override
|
||||
public void onActivityMessageReceived(Message msg) {
|
||||
switch (msg.arg1) {
|
||||
case MSG_RELOADSMS : {
|
||||
LogUtils.d(TAG, "MSG_RELOADSMS");
|
||||
if (PermissionUtil.checkAppPermission(MainActivity.this)) {
|
||||
mPhoneArrayAdapter.loadData();
|
||||
mPhoneArrayAdapter.notifyDataSetChanged();
|
||||
} else {
|
||||
LogUtils.i(TAG, "遇到应用权限问题,请打开应用设置检查一下应用权限。");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onCreatePanelMenu(int featureId, Menu menu) {
|
||||
return super.onCreatePanelMenu(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mADsBannerView != null) {
|
||||
mADsBannerView.releaseAdResources();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
reloadSMS();
|
||||
if (mADsBannerView != null) {
|
||||
mADsBannerView.resumeADs(MainActivity.this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_main_first, menu);
|
||||
// 主题菜单
|
||||
AESThemeUtil.inflateMenu(this, menu);
|
||||
// 调试工具菜单
|
||||
if (App.isDebugging()) {
|
||||
DevelopUtils.inflateMenu(this, menu);
|
||||
getMenuInflater().inflate(R.menu.toolbar_main_debug, menu);
|
||||
}
|
||||
getMenuInflater().inflate(R.menu.toolbar_main_last, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void reloadSMS() {
|
||||
if (_mMainActivity != null) {
|
||||
Message msg = new Message();
|
||||
msg.arg1 = MSG_RELOADSMS;
|
||||
_mMainActivity.sendActivityMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
int menuItemId = item.getItemId();
|
||||
if (AESThemeUtil.onAppThemeItemSelected(this, item)) {
|
||||
recreate();
|
||||
} if (DevelopUtils.onDevelopItemSelected(this, item)) {
|
||||
LogUtils.d(TAG, String.format("onOptionsItemSelected item.getItemId() %d ", item.getItemId()));
|
||||
} else if (nItemId == R.id.app_ttsrule) {
|
||||
Intent i = new Intent(MainActivity.this, TTSPlayRuleActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_smsrule) {
|
||||
Intent i = new Intent(MainActivity.this, SMSReceiveRuleActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_appsettings) {
|
||||
Intent i = new Intent(MainActivity.this, AppSettingsActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_unittest) {
|
||||
Intent i = new Intent(MainActivity.this, UnitTestActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_about) {
|
||||
Intent i = new Intent(MainActivity.this, AboutActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_smsrecycle) {
|
||||
Class<?> recycleClass;
|
||||
if (mAppConfigUtil.mAppConfigBean.getRecycleBinClass().equals("SMSRecycle2Activity")) {
|
||||
recycleClass = SMSRecycle2Activity.class;
|
||||
} else {
|
||||
recycleClass = SMSRecycleActivity.class;
|
||||
}
|
||||
Intent i = new Intent(MainActivity.this, recycleClass);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,281 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Toolbar;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.adapters.SMSArrayAdapter;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.ViewUtil;
|
||||
import cc.winboll.studio.mymessagemanager.views.BottomPositionFixedScrollView;
|
||||
import cc.winboll.studio.mymessagemanager.views.SMSListViewForScrollView;
|
||||
import android.app.Activity;
|
||||
|
||||
public class SMSActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
public static String TAG = "SMSActivity";
|
||||
public static final String ACTION_NOTIFY_SMS_CHANGED = "cc.winboll.studio.mymessagemanager.activitys.SMSActivity.ACTION_NOTIFY_SMS_CHANGED";
|
||||
public static final String EXTRA_PHONE = "Phone";
|
||||
final static int MSG_SET_FOCUS = 0;
|
||||
|
||||
SMSListViewForScrollView mlvSMS;
|
||||
Toolbar mToolbar;
|
||||
String mszPhoneTo;
|
||||
SMSArrayAdapter mSMSArrayAdapter;
|
||||
BottomPositionFixedScrollView mScrollView1;
|
||||
EditText metSMSBody;
|
||||
SMSActivityBroadcastReceiver mSMSActivityBroadcastReceiver;
|
||||
Handler mSetFocusHandler;
|
||||
private boolean isImeVisible = false;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_sms);
|
||||
|
||||
initView();
|
||||
scrollScrollView();
|
||||
setupImeStatusListener();
|
||||
|
||||
// 新增:监听窗口加载完成,触发mScrollView1滚动到底部
|
||||
setupScrollToBottomAfterWindowLoaded();
|
||||
}
|
||||
|
||||
// 新增:窗口加载完成后让mScrollView1滚动到底部
|
||||
private void setupScrollToBottomAfterWindowLoaded() {
|
||||
final View rootView = findViewById(android.R.id.content);
|
||||
// 监听根布局绘制完成(窗口加载完成的标志)
|
||||
rootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
// 滚动到底部
|
||||
mScrollView1.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mScrollView1.fullScroll(ScrollView.FOCUS_DOWN);
|
||||
}
|
||||
});
|
||||
|
||||
// 移除监听,避免重复触发
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
rootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
} else {
|
||||
rootView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setupImeStatusListener() {
|
||||
final View rootView = findViewById(android.R.id.content);
|
||||
rootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
int rootViewHeight = rootView.getHeight();
|
||||
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
int imeThreshold = dp2px(200);
|
||||
|
||||
boolean currentImeVisible = (screenHeight - rootViewHeight) > imeThreshold;
|
||||
|
||||
if (currentImeVisible != isImeVisible) {
|
||||
isImeVisible = currentImeVisible;
|
||||
setupScrollView1Height();
|
||||
if (!isImeVisible) {
|
||||
metSMSBody.clearFocus();
|
||||
}
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
rootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
} else {
|
||||
rootView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
|
||||
}
|
||||
setupImeStatusListener();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int dp2px(int dp) {
|
||||
return (int) (dp * getResources().getDisplayMetrics().density + 0.5f);
|
||||
}
|
||||
|
||||
/*static class MyHandler extends Handler {
|
||||
WeakReference<SMSActivity> mActivity;
|
||||
MyHandler(SMSActivity activity) {
|
||||
mActivity = new WeakReference<SMSActivity>(activity);
|
||||
}
|
||||
public void handleMessage(Message msg) {
|
||||
SMSActivity theActivity = mActivity.get();
|
||||
switch (msg.what) {
|
||||
case MSG_SET_FOCUS:
|
||||
theActivity.metSMSBody.setFocusable(true);
|
||||
theActivity.metSMSBody.requestFocus();
|
||||
theActivity.setupScrollView1Height();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
super.handleMessage(msg);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(mSMSActivityBroadcastReceiver);
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mszPhoneTo = getIntent().getStringExtra(EXTRA_PHONE);
|
||||
if (mszPhoneTo == null || mszPhoneTo.trim().equals("")) {
|
||||
finish();
|
||||
}
|
||||
|
||||
mToolbar = (Toolbar) findViewById(R.id.activitysmsASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_smsinphone) + " < Phone : " + AddressUtils.getFormattedAddress(mszPhoneTo) + " >");
|
||||
setActionBar(mToolbar);
|
||||
|
||||
mScrollView1 = (BottomPositionFixedScrollView) findViewById(R.id.activitysmsScrollView1);
|
||||
|
||||
metSMSBody = (EditText) findViewById(R.id.viewsmssendpart1EditText1);
|
||||
metSMSBody.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
setupScrollView1Height();
|
||||
}
|
||||
});
|
||||
metSMSBody.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
setupScrollView1Height();
|
||||
}
|
||||
});
|
||||
|
||||
final AOHPCTCSeekBar aOHPCTCSeekBar = (AOHPCTCSeekBar) findViewById(R.id.viewsmssendpart1AOHPCTCSeekBar1);
|
||||
aOHPCTCSeekBar.setThumb(getDrawable(R.drawable.ic_message));
|
||||
aOHPCTCSeekBar.setThumbOffset(20);
|
||||
aOHPCTCSeekBar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||
@Override
|
||||
public void onOHPCommit() {
|
||||
sendSMS();
|
||||
}
|
||||
});
|
||||
|
||||
TextView tvAOHPCTCSeekBarMSG = (TextView) findViewById(R.id.viewsmssendpart1TextView1);
|
||||
tvAOHPCTCSeekBarMSG.setText(R.string.msg_100sendmsg);
|
||||
|
||||
mlvSMS = (SMSListViewForScrollView) findViewById(R.id.activitysmsSMSListViewForScrollView1);
|
||||
mSMSArrayAdapter = new SMSArrayAdapter(SMSActivity.this, mszPhoneTo);
|
||||
mlvSMS.setAdapter(mSMSArrayAdapter);
|
||||
|
||||
mlvSMS.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
if (firstVisibleItem + visibleItemCount == totalItemCount && totalItemCount > 0) {
|
||||
mSMSArrayAdapter.cancelMessageNotification();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mSMSActivityBroadcastReceiver = new SMSActivityBroadcastReceiver();
|
||||
IntentFilter intentFilter = new IntentFilter(ACTION_NOTIFY_SMS_CHANGED);
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(mSMSActivityBroadcastReceiver, intentFilter);
|
||||
}
|
||||
|
||||
private void setupScrollView1Height() {
|
||||
mScrollView1.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final ScrollView scrollView2 = (ScrollView) findViewById(R.id.activitysmsScrollView2);
|
||||
final BottomPositionFixedScrollView scrollView1 = (BottomPositionFixedScrollView) findViewById(R.id.activitysmsScrollView1);
|
||||
final View includeView = findViewById(R.id.activitysmsinclude1);
|
||||
|
||||
scrollView2.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int scrollView2Height = scrollView2.getHeight();
|
||||
int includeHeight = includeView.getHeight();
|
||||
int targetHeight = Math.max(scrollView2Height - includeHeight, 0);
|
||||
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) scrollView1.getLayoutParams();
|
||||
params.height = targetHeight;
|
||||
scrollView1.setLayoutParams(params);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
public void updateSMSView() {
|
||||
mSMSArrayAdapter.reLoadSMSList(SMSActivity.this, mszPhoneTo);
|
||||
mSMSArrayAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
void scrollScrollView() {
|
||||
ViewUtil.scrollScrollView(mScrollView1);
|
||||
}
|
||||
|
||||
void sendSMS() {
|
||||
String szSMSBody = metSMSBody.getText().toString();
|
||||
if (szSMSBody.equals("")) {
|
||||
Toast.makeText(getApplication(), "没有消息内容可发送。", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (SMSUtil.sendMessageByInterface2(this, mszPhoneTo, szSMSBody)) {
|
||||
metSMSBody.setText("");
|
||||
metSMSBody.clearFocus();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateSMSView();
|
||||
ViewUtil.scrollScrollView(mScrollView1);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
class SMSActivityBroadcastReceiver extends BroadcastReceiver {
|
||||
public SMSActivityBroadcastReceiver() {}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (ACTION_NOTIFY_SMS_CHANGED.equals(intent.getAction())) {
|
||||
updateSMSView();
|
||||
ViewUtil.scrollScrollView(mScrollView1);
|
||||
} else {
|
||||
throw new IllegalStateException("Unexpected value: " + intent.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen<zhangsken@qq.com>
|
||||
* @Date 2024/07/19 12:50:52
|
||||
* @Describe 短信匹配过滤规则设置窗口
|
||||
*/
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.mymessagemanager.App;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.SMSReceiveRuleActivity;
|
||||
import cc.winboll.studio.mymessagemanager.adapters.SMSAcceptRuleArrayAdapter;
|
||||
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
|
||||
import cc.winboll.studio.mymessagemanager.utils.FileUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil;
|
||||
import com.baoyz.widget.PullRefreshLayout;
|
||||
import android.app.Activity;
|
||||
|
||||
public class SMSReceiveRuleActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
|
||||
public static final String TAG = "SMSReceiveRuleActivity";
|
||||
|
||||
Context mContext;
|
||||
RecyclerView mRecyclerView;
|
||||
Toolbar mToolbar;
|
||||
RadioButton mrbAccept;
|
||||
RadioButton mrbRefuse;
|
||||
CheckBox mcbEnable;
|
||||
SMSAcceptRuleBean mSMSAcceptRuleBeanAdd;
|
||||
SMSAcceptRuleArrayAdapter mSMSAcceptRuleArrayAdapter;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_smsacceptrulesetting);
|
||||
mContext = SMSReceiveRuleActivity.this;
|
||||
initSMSAcceptRuleBeanAdd();
|
||||
// 初始化视图
|
||||
initView();
|
||||
}
|
||||
|
||||
//
|
||||
// 初始化视图
|
||||
//
|
||||
public void initView() {
|
||||
// 初始化标题栏
|
||||
mToolbar = findViewById(R.id.activitysmsacceptrulesettingASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.text_smsrule));
|
||||
setSupportActionBar(mToolbar);
|
||||
|
||||
mrbAccept = findViewById(R.id.activitysmsacceptrulesettingRadioButton1);
|
||||
mrbRefuse = findViewById(R.id.activitysmsacceptrulesettingRadioButton2);
|
||||
mcbEnable = findViewById(R.id.activitysmsacceptrulesettingCheckBox1);
|
||||
if (mSMSAcceptRuleBeanAdd.getRuleType() == SMSAcceptRuleBean.RuleType.ACCEPT) {
|
||||
mrbAccept.setChecked(true);
|
||||
mrbRefuse.setChecked(false);
|
||||
}
|
||||
if (mSMSAcceptRuleBeanAdd.getRuleType() == SMSAcceptRuleBean.RuleType.REFUSE) {
|
||||
mrbAccept.setChecked(false);
|
||||
mrbRefuse.setChecked(true);
|
||||
}
|
||||
mcbEnable.setChecked(mSMSAcceptRuleBeanAdd.isEnable());
|
||||
|
||||
Button btnAddSMSAcceptRule = findViewById(R.id.activitysmsacceptrulesettingButton1);
|
||||
btnAddSMSAcceptRule.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
EditText et = findViewById(R.id.activitysmsacceptrulesettingEditText1);
|
||||
String szRule = et.getText().toString().trim();
|
||||
if (szRule.equals("")) {
|
||||
Toast.makeText(getApplication(), "空字符串规则不能添加", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
mSMSAcceptRuleBeanAdd.setRuleData(et.getText().toString());
|
||||
mSMSAcceptRuleBeanAdd.setIsEnable(mcbEnable.isChecked());
|
||||
mSMSAcceptRuleBeanAdd.setRuleType(mrbRefuse.isChecked() ?SMSAcceptRuleBean.RuleType.REFUSE: SMSAcceptRuleBean.RuleType.ACCEPT);
|
||||
mSMSAcceptRuleArrayAdapter.addSMSAcceptRule(mSMSAcceptRuleBeanAdd);
|
||||
initSMSAcceptRuleBeanAdd();
|
||||
et.setText("");
|
||||
Toast.makeText(getApplication(), "已添加规则 : " + szRule, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 绑定控件
|
||||
mRecyclerView = findViewById(R.id.activitysmsacceptrulesettingRecyclerView1);
|
||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
mSMSAcceptRuleArrayAdapter = new SMSAcceptRuleArrayAdapter(this);
|
||||
mRecyclerView.setAdapter(mSMSAcceptRuleArrayAdapter);
|
||||
|
||||
final PullRefreshLayout pullRefreshLayout = findViewById(R.id.activitysmsacceptrulesettingPullRefreshLayout1);
|
||||
pullRefreshLayout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener(){
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
pullRefreshLayout.setRefreshing(false);
|
||||
mSMSAcceptRuleArrayAdapter.loadConfigData();
|
||||
mSMSAcceptRuleArrayAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initSMSAcceptRuleBeanAdd() {
|
||||
mSMSAcceptRuleBeanAdd = new SMSAcceptRuleBean(App.USER_ID, "", true, SMSAcceptRuleBean.RuleType.REFUSE, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
//return super.onCreateOptionsMenu(menu);
|
||||
getMenuInflater().inflate(R.menu.toolbar_rule, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
if (nItemId == R.id.item_rule_share) {
|
||||
//SMSReceiveRuleUtil smsAcceptRuleConfig = SMSReceiveRuleUtil.getInstance(this, false);
|
||||
SMSAcceptRuleBean beanTemp = new SMSAcceptRuleBean();
|
||||
String szConfigPath = beanTemp.getBeanListJsonFilePath(mContext);
|
||||
FileUtil.shareJSONFile(SMSReceiveRuleActivity.this, szConfigPath);
|
||||
} else if (nItemId == R.id.item_rule_reset) {
|
||||
showResetConfigDialog();
|
||||
} else if (nItemId == R.id.item_rule_clean) {
|
||||
showCleanConfigDialog();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// 短信匹配过滤规则数据重置对话框
|
||||
//
|
||||
void showResetConfigDialog() {
|
||||
Dialog alertDialog = new AlertDialog.Builder(this).
|
||||
setTitle("确定重置?").
|
||||
setMessage("您确定重置短信接收规则为默认设置吗?").
|
||||
setIcon(R.drawable.ic_launcher).
|
||||
setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
SMSReceiveRuleUtil smsAcceptRuleConfig = SMSReceiveRuleUtil.getInstance(getApplicationContext(), false);
|
||||
smsAcceptRuleConfig.resetConfig();
|
||||
mSMSAcceptRuleArrayAdapter.notifyDataSetChanged();
|
||||
Toast.makeText(getApplication(), "Rules Reset", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).
|
||||
setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}).
|
||||
/*setNeutralButton("查看详情", new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}).*/
|
||||
create();
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
//
|
||||
// 短信匹配过滤规则数据清空对话框
|
||||
//
|
||||
void showCleanConfigDialog() {
|
||||
Dialog alertDialog = new AlertDialog.Builder(this).
|
||||
setTitle("确定清理").
|
||||
setMessage("您确定清理所有短信接收规则吗?").
|
||||
setIcon(R.drawable.ic_launcher).
|
||||
setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
SMSReceiveRuleUtil smsAcceptRuleConfig = SMSReceiveRuleUtil.getInstance(getApplicationContext(), false);
|
||||
smsAcceptRuleConfig.cleanConfig();
|
||||
mSMSAcceptRuleArrayAdapter.notifyDataSetChanged();
|
||||
Toast.makeText(getApplication(), "Rules Cleaned.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).
|
||||
setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}).
|
||||
/*setNeutralButton("查看详情", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}).*/
|
||||
create();
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
public void onAcceptRuleType(View view) {
|
||||
mrbRefuse.setChecked(false);
|
||||
}
|
||||
|
||||
public void onRefuseRuleType(View view) {
|
||||
mrbAccept.setChecked(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mSMSAcceptRuleArrayAdapter.loadConfigData();
|
||||
mSMSAcceptRuleArrayAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.adapters.SMSRecycle2Adapter;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil;
|
||||
import cc.winboll.studio.mymessagemanager.views.ProtectModeTextView;
|
||||
import com.baoyz.widget.PullRefreshLayout;
|
||||
import java.io.File;
|
||||
|
||||
public class SMSRecycle2Activity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
|
||||
public static final String TAG = "SMSRecycle2Activity";
|
||||
private static final String SP_NAME = "smsrecycle2_config";
|
||||
private static final String KEY_SCALE = "recycle2_scale";
|
||||
|
||||
Toolbar mToolbar;
|
||||
RecyclerView mRecyclerView;
|
||||
SMSRecycle2Adapter mSMSRecycle2Adapter;
|
||||
ProtectModeTextView mSampleProtectModeTextView;
|
||||
SharedPreferences mSP;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_smsrecycle2);
|
||||
mToolbar = findViewById(R.id.activitysmsrecycle2ASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_about));
|
||||
setSupportActionBar(mToolbar);
|
||||
|
||||
mSP = getSharedPreferences(SP_NAME, MODE_PRIVATE);
|
||||
|
||||
mSampleProtectModeTextView = findViewById(R.id.activitysmsrecycle2SampleProtectModeTextView);
|
||||
mSampleProtectModeTextView.setContentTextWithScale(
|
||||
"调节本短信下方刻度滑条,可预览文本打乱效果;同时该进度条数值将作为回收站短信全局默认初始值。\n"
|
||||
+ "刻度0 = 保持原文不打乱;\n"
|
||||
+ "刻度数值越小,字符分组越细碎,文本打乱混乱程度越大;\n"
|
||||
+ "刻度数值越大,字符连串分组越长,文本打乱混乱程度越小。",
|
||||
mSP.getInt(KEY_SCALE, 0));
|
||||
|
||||
mSampleProtectModeTextView.setOnScaleChangedListener(new ProtectModeTextView.OnScaleChangedListener() {
|
||||
@Override
|
||||
public void onScaleChanged(int progress) {
|
||||
mSP.edit().putInt(KEY_SCALE, progress).apply();
|
||||
mSMSRecycle2Adapter.setScaleProgress(progress);
|
||||
mSMSRecycle2Adapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
initView();
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mRecyclerView = findViewById(R.id.activitysmsrecycle2RecyclerView1);
|
||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
mSMSRecycle2Adapter = new SMSRecycle2Adapter(this, mSP.getInt(KEY_SCALE, 0));
|
||||
mRecyclerView.setAdapter(mSMSRecycle2Adapter);
|
||||
|
||||
final PullRefreshLayout pullRefreshLayout = findViewById(R.id.activitysmsrecycle2PullRefreshLayout1);
|
||||
pullRefreshLayout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
mSMSRecycle2Adapter.loadSMSRecycleList();
|
||||
mSMSRecycle2Adapter.notifyDataSetChanged();
|
||||
pullRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_smsrecycle, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
if (nItemId == R.id.item_cleansmsrecycle) {
|
||||
YesNoAlertDialog.show(this, "回收站清空确认", "是否清空回收站", mDeleteListener);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
YesNoAlertDialog.OnDialogResultListener mDeleteListener = new YesNoAlertDialog.OnDialogResultListener() {
|
||||
|
||||
@Override
|
||||
public void onNo() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onYes() {
|
||||
File file = new File(SMSRecycleUtil.getSMSRecycleListDataPath(SMSRecycle2Activity.this));
|
||||
file.delete();
|
||||
mSMSRecycle2Adapter.loadSMSRecycleList();
|
||||
mSMSRecycle2Adapter.notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen<zhangsken@qq.com>
|
||||
* @Date 2024/07/19 16:56:18
|
||||
* @Describe 短信回收站
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.SMSRecycleActivity;
|
||||
import cc.winboll.studio.mymessagemanager.adapters.SMSRecycleAdapter;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil;
|
||||
import com.baoyz.widget.PullRefreshLayout;
|
||||
import java.io.File;
|
||||
|
||||
public class SMSRecycleActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
|
||||
public static final String TAG = "SMSRecycleActivity";
|
||||
|
||||
Toolbar mToolbar;
|
||||
RecyclerView mRecyclerView;
|
||||
SMSRecycleAdapter mSMSRecycleAdapter;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_smsrecycle);
|
||||
// 初始化标题栏
|
||||
mToolbar = findViewById(R.id.activitysmsrecycleASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_about));
|
||||
setSupportActionBar(mToolbar);
|
||||
initView();
|
||||
}
|
||||
|
||||
void initView() {
|
||||
// 绑定控件
|
||||
mRecyclerView = findViewById(R.id.activitysmsrecycleRecyclerView1);
|
||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
mSMSRecycleAdapter = new SMSRecycleAdapter(this);
|
||||
mRecyclerView.setAdapter(mSMSRecycleAdapter);
|
||||
|
||||
final PullRefreshLayout pullRefreshLayout = findViewById(R.id.activitysmsrecyclePullRefreshLayout1);
|
||||
pullRefreshLayout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
mSMSRecycleAdapter.loadSMSRecycleList();
|
||||
mSMSRecycleAdapter.notifyDataSetChanged();
|
||||
pullRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
//return super.onCreateOptionsMenu(menu);
|
||||
getMenuInflater().inflate(R.menu.toolbar_smsrecycle, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
if (nItemId == R.id.item_cleansmsrecycle) {
|
||||
YesNoAlertDialog.show(this, "回收站清空确认", "是否清空回收站", mDeleteListener);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
YesNoAlertDialog.OnDialogResultListener mDeleteListener = new YesNoAlertDialog.OnDialogResultListener() {
|
||||
|
||||
@Override
|
||||
public void onNo() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onYes() {
|
||||
File file = new File(SMSRecycleUtil.getSMSRecycleListDataPath(SMSRecycleActivity.this));
|
||||
file.delete();
|
||||
mSMSRecycleAdapter.loadSMSRecycleList();
|
||||
mSMSRecycleAdapter.notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
|
||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.SMSReceiveRuleActivity;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.SharedJSONReceiveActivity;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity;
|
||||
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
|
||||
import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean;
|
||||
import cc.winboll.studio.mymessagemanager.utils.UriUtil;
|
||||
import java.util.ArrayList;
|
||||
import android.app.Activity;
|
||||
|
||||
public class SharedJSONReceiveActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||
|
||||
public static final String TAG = "SharedJSONReceive";
|
||||
|
||||
Toolbar mToolbar;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_sharedjsonreceive);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 接收分享数据
|
||||
Intent intent = getIntent();
|
||||
String action = intent.getAction();//action
|
||||
String type = intent.getType();//类型
|
||||
//LogUtils.d(TAG, "action is " + action);
|
||||
//LogUtils.d(TAG, "type is " + type);
|
||||
if ((Intent.ACTION_SEND.equals(action) || Intent.ACTION_VIEW.equals(action) || Intent.ACTION_EDIT.equals(action))
|
||||
&& type != null && (("application/json".equals(type)) || ("text/x-json".equals(type)))) {
|
||||
|
||||
//取出文件uri
|
||||
Uri uri = intent.getData();
|
||||
if (uri == null) {
|
||||
uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
}
|
||||
//获取文件真实地址
|
||||
String szSrcJSON = UriUtil.getFileFromUri(getApplication(), uri);
|
||||
if (TextUtils.isEmpty(szSrcJSON)) {
|
||||
return;
|
||||
}
|
||||
|
||||
String szCheck = TTSPlayRuleBean.checkIsTheSameBeanListAndFile(szSrcJSON, TTSPlayRuleBean.class);
|
||||
if (szCheck.equals("")) {
|
||||
importTTSPlayRuleBean(szSrcJSON);
|
||||
} else {
|
||||
sb.append("\n语音规则数据检测结果\n");
|
||||
sb.append(szCheck);
|
||||
}
|
||||
//LogUtils.d(TAG, "szCheck is " + szCheck);
|
||||
|
||||
szCheck = SMSAcceptRuleBean.checkIsTheSameBeanListAndFile(szSrcJSON, SMSAcceptRuleBean.class);
|
||||
if (szCheck.equals("")) {
|
||||
importSMSAcceptRuleBean(szSrcJSON);
|
||||
} else {
|
||||
sb.append("\n短信接收规则数据检测结果\n");
|
||||
sb.append(szCheck);
|
||||
}
|
||||
//LogUtils.d(TAG, "szCheck is " + szCheck);
|
||||
} else {
|
||||
sb.append("Not supported action.");
|
||||
}
|
||||
|
||||
mToolbar = findViewById(R.id.activitysharedjsonreceiveASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_sharedjsonreceive));
|
||||
setActionBar(mToolbar);
|
||||
|
||||
TextView tvMessage = findViewById(R.id.activitysharedjsonreceiveTextView1);
|
||||
tvMessage.setText(sb.toString());
|
||||
}
|
||||
|
||||
void importSMSAcceptRuleBean(final String szSrcJSON) {
|
||||
ArrayList<SMSAcceptRuleBean> beanList = new ArrayList<SMSAcceptRuleBean>();
|
||||
boolean bCheck = SMSAcceptRuleBean.loadBeanListFromFile(szSrcJSON, beanList, SMSAcceptRuleBean.class);
|
||||
if (bCheck && beanList.size() > 0) {
|
||||
YesNoAlertDialog.show(SharedJSONReceiveActivity.this,
|
||||
"短信接收规则共享提示",
|
||||
"已收到短信接收规则" + Integer.toString(beanList.size()) + "个,\n是否导入应用?"
|
||||
, (new YesNoAlertDialog.OnDialogResultListener(){
|
||||
|
||||
@Override
|
||||
public void onYes() {
|
||||
ArrayList<SMSAcceptRuleBean> beanListShare = new ArrayList<SMSAcceptRuleBean>();
|
||||
SMSAcceptRuleBean.loadBeanListFromFile(szSrcJSON, beanListShare, SMSAcceptRuleBean.class);
|
||||
ArrayList<SMSAcceptRuleBean> beanListApp = new ArrayList<SMSAcceptRuleBean>();
|
||||
SMSAcceptRuleBean.loadBeanList(SharedJSONReceiveActivity.this, beanListApp, SMSAcceptRuleBean.class);
|
||||
beanListApp.addAll(0, beanListShare);
|
||||
SMSAcceptRuleBean.saveBeanList(SharedJSONReceiveActivity.this, beanListApp, SMSAcceptRuleBean.class);
|
||||
Toast.makeText(getApplication(), "已导入" + Integer.toString(beanListShare.size()) + "个数据。", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
Intent intent = new Intent(SharedJSONReceiveActivity.this, SMSReceiveRuleActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNo() {
|
||||
finish();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
void importTTSPlayRuleBean(final String szSrcJSON) {
|
||||
ArrayList<TTSPlayRuleBean> beanList = new ArrayList<TTSPlayRuleBean>();
|
||||
boolean bCheck = TTSPlayRuleBean.loadBeanListFromFile(szSrcJSON, beanList, TTSPlayRuleBean.class);
|
||||
if (bCheck && beanList.size() > 0) {
|
||||
YesNoAlertDialog.show(SharedJSONReceiveActivity.this,
|
||||
"语音规则共享提示",
|
||||
"已收到语音规则" + Integer.toString(beanList.size()) + "个,\n是否导入应用?"
|
||||
, (new YesNoAlertDialog.OnDialogResultListener(){
|
||||
|
||||
@Override
|
||||
public void onYes() {
|
||||
ArrayList<TTSPlayRuleBean> beanListShare = new ArrayList<TTSPlayRuleBean>();
|
||||
TTSPlayRuleBean.loadBeanListFromFile(szSrcJSON, beanListShare, TTSPlayRuleBean.class);
|
||||
ArrayList<TTSPlayRuleBean> beanListApp = new ArrayList<TTSPlayRuleBean>();
|
||||
TTSPlayRuleBean.loadBeanList(SharedJSONReceiveActivity.this, beanListApp, TTSPlayRuleBean.class);
|
||||
beanListApp.addAll(0, beanListShare);
|
||||
TTSPlayRuleBean.saveBeanList(SharedJSONReceiveActivity.this, beanListApp, TTSPlayRuleBean.class);
|
||||
Toast.makeText(getApplication(), "已导入" + Integer.toString(beanListShare.size()) + "个数据。", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
Intent intent = new Intent(SharedJSONReceiveActivity.this, TTSPlayRuleActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNo() {
|
||||
finish();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package cc.winboll.studio.mymessagemanager.activitys;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
|
||||
/**
|
||||
* @Author 豆包&ZhanGSKen<zhangsken@qq.com>
|
||||
* @Date 2026/02/11 03:45
|
||||
* @Describe TTS悬浮窗设置类(使用可拖动自定义控件)
|
||||
*/
|
||||
public class TTSFloatSettingsActivity extends Activity {
|
||||
|
||||
public static final String TAG = "TTSFloatSettingsActivity";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// 直接加载包含自定义拖动控件的布局
|
||||
setContentView(R.layout.activity_ttsfloatsettings);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user