Compare commits
	
		
			7 Commits
		
	
	
		
			a40dbcfb61
			...
			powerbell-
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					8cf610962e | ||
| 
						 | 
					3071d186ec | ||
| 
						 | 
					df10306059 | ||
| 
						 | 
					ccdb9c5abd | ||
| 
						 | 
					f27209ab87 | ||
| 
						 | 
					2a819e94e4 | ||
| 
						 | 
					6635358ec5 | 
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Tue Jun 24 09:54:47 HKT 2025
 | 
			
		||||
stageCount=3
 | 
			
		||||
#Sun May 04 05:32:00 GMT 2025
 | 
			
		||||
stageCount=1
 | 
			
		||||
libraryProject=
 | 
			
		||||
baseVersion=15.2
 | 
			
		||||
publishVersion=15.2.2
 | 
			
		||||
buildCount=0
 | 
			
		||||
baseBetaVersion=15.2.3
 | 
			
		||||
publishVersion=15.2.0
 | 
			
		||||
buildCount=74
 | 
			
		||||
baseBetaVersion=15.2.1
 | 
			
		||||
 
 | 
			
		||||
@@ -42,24 +42,23 @@ android {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /*compileOptions {
 | 
			
		||||
    compileOptions {
 | 
			
		||||
        sourceCompatibility JavaVersion.VERSION_11
 | 
			
		||||
        targetCompatibility JavaVersion.VERSION_11
 | 
			
		||||
    }*/
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dependencies {
 | 
			
		||||
    api fileTree(dir: 'libs', include: ['*.jar'])
 | 
			
		||||
	api project(':libjc')
 | 
			
		||||
	api 'cc.winboll.studio:libaes:15.9.1'
 | 
			
		||||
	api 'cc.winboll.studio:libapputils:15.8.4'
 | 
			
		||||
	api 'cc.winboll.studio:libappbase:15.8.4'
 | 
			
		||||
	
 | 
			
		||||
    // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
 | 
			
		||||
    //implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
 | 
			
		||||
    implementation 'org.bouncycastle:bcprov-jdk15to18:1.69'
 | 
			
		||||
    implementation 'org.bouncycastle:bcpkix-jdk15to18:1.69'
 | 
			
		||||
 | 
			
		||||
	api project(':libjc')
 | 
			
		||||
    api 'androidx.appcompat:appcompat:1.0.0'
 | 
			
		||||
	api 'com.google.android.material:material:1.0.0'
 | 
			
		||||
    
 | 
			
		||||
    api 'cc.winboll.studio:libapputils:9.1.0'
 | 
			
		||||
    api 'cc.winboll.studio:libappbase:1.0.3'
 | 
			
		||||
    api fileTree(dir: 'libs', include: ['*.jar'])
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Tue Jun 24 11:17:30 GMT 2025
 | 
			
		||||
#Fri Jan 10 22:03:57 GMT 2025
 | 
			
		||||
stageCount=0
 | 
			
		||||
libraryProject=libjc
 | 
			
		||||
baseVersion=1.0
 | 
			
		||||
publishVersion=1.0.0
 | 
			
		||||
buildCount=135
 | 
			
		||||
buildCount=133
 | 
			
		||||
baseBetaVersion=1.0.1
 | 
			
		||||
 
 | 
			
		||||
@@ -15,10 +15,10 @@ import android.widget.LinearLayout;
 | 
			
		||||
import android.widget.ScrollView;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import cc.winboll.studio.jc.R;
 | 
			
		||||
import cc.winboll.studio.libapputils.log.LogUtils;
 | 
			
		||||
import cc.winboll.studio.libjc.JAR_RUNNING_MODE;
 | 
			
		||||
import cc.winboll.studio.libjc.JCMainThread;
 | 
			
		||||
import cc.winboll.studio.libjc.net.JCSocketClient;
 | 
			
		||||
import cc.winboll.studio.libjc.util.LogUtils;
 | 
			
		||||
import cc.winboll.studio.libjc.Main;
 | 
			
		||||
 | 
			
		||||
final public class MainActivity extends Activity implements JCMainThread.OnMessageListener {
 | 
			
		||||
 | 
			
		||||
@@ -77,7 +77,7 @@ final public class MainActivity extends Activity implements JCMainThread.OnMessa
 | 
			
		||||
        // 启动主线程
 | 
			
		||||
        _JCMainThread = JCMainThread.getInstance(getPackageName());
 | 
			
		||||
        _JCMainThread.setOnLogListener(this);
 | 
			
		||||
        //_JCMainThread.setRunningMode(Main.JAR_RUNNING_MODE.JC);
 | 
			
		||||
        _JCMainThread.setRunningMode(JAR_RUNNING_MODE.JC);
 | 
			
		||||
        _JCMainThread.start();
 | 
			
		||||
 | 
			
		||||
        // 设置 WinBoll 应用 UI 类型
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Tue Jun 24 11:17:30 GMT 2025
 | 
			
		||||
#Fri Jan 10 22:03:57 GMT 2025
 | 
			
		||||
stageCount=0
 | 
			
		||||
libraryProject=libjc
 | 
			
		||||
baseVersion=1.0
 | 
			
		||||
publishVersion=1.0.0
 | 
			
		||||
buildCount=135
 | 
			
		||||
buildCount=133
 | 
			
		||||
baseBetaVersion=1.0.1
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ public class Main {
 | 
			
		||||
    public final static int JAR_RUNNING_MODE_JCNDK_DEBUG = 4;
 | 
			
		||||
    public final static int JAR_RUNNING_MODE_JC = 5;
 | 
			
		||||
    public final static int JAR_RUNNING_MODE_JC_DEBUG = 6;
 | 
			
		||||
    public static enum JAR_RUNNING_MODE {
 | 
			
		||||
    public enum JAR_RUNNING_MODE {
 | 
			
		||||
        UNKNOWN(JAR_RUNNING_MODE_UNKNOWN),
 | 
			
		||||
        CONSOLE(JAR_RUNNING_MODE_CONSOLE),
 | 
			
		||||
        CONSOLE_DEBUG(JAR_RUNNING_MODE_CONSOLE_DEBUG),
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ android {
 | 
			
		||||
        // versionName 更新后需要手动设置 
 | 
			
		||||
        // .winboll/winbollBuildProps.properties 文件的 stageCount=0
 | 
			
		||||
        // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
 | 
			
		||||
        versionName "15.3" 
 | 
			
		||||
        versionName "15.2" 
 | 
			
		||||
        if(true) {
 | 
			
		||||
            versionName = genVersionName("${versionName}")
 | 
			
		||||
        }
 | 
			
		||||
@@ -45,17 +45,15 @@ android {
 | 
			
		||||
 | 
			
		||||
dependencies {
 | 
			
		||||
    api fileTree(dir: 'libs', include: ['*.jar'])
 | 
			
		||||
    api 'cc.winboll.studio:libaes:15.9.3'
 | 
			
		||||
    api 'cc.winboll.studio:libapputils:15.8.6'
 | 
			
		||||
    api 'cc.winboll.studio:libappbase:15.9.5'
 | 
			
		||||
    api 'cc.winboll.studio:libaes:15.8.0'
 | 
			
		||||
    api 'cc.winboll.studio:libapputils:15.8.1'
 | 
			
		||||
    api 'cc.winboll.studio:libappbase:15.8.1'
 | 
			
		||||
    
 | 
			
		||||
	api 'io.github.medyo:android-about-page:2.0.0'
 | 
			
		||||
    api 'com.github.getActivity:ToastUtils:10.5'
 | 
			
		||||
    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'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Sat Sep 06 01:57:20 HKT 2025
 | 
			
		||||
stageCount=9
 | 
			
		||||
#Tue May 20 20:39:06 HKT 2025
 | 
			
		||||
stageCount=6
 | 
			
		||||
libraryProject=
 | 
			
		||||
baseVersion=15.3
 | 
			
		||||
publishVersion=15.3.8
 | 
			
		||||
baseVersion=15.2
 | 
			
		||||
publishVersion=15.2.5
 | 
			
		||||
buildCount=0
 | 
			
		||||
baseBetaVersion=15.3.9
 | 
			
		||||
baseBetaVersion=15.2.6
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.App;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.R;
 | 
			
		||||
 | 
			
		||||
public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
 | 
			
		||||
public class AboutActivity extends WinBollActivity implements IWinBoLLActivity {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "AboutActivity";
 | 
			
		||||
 | 
			
		||||
@@ -79,11 +79,11 @@ public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
 | 
			
		||||
        appInfo.setAppName(getString(R.string.app_name));
 | 
			
		||||
        appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll);
 | 
			
		||||
        appInfo.setAppDescription(getString(R.string.app_description));
 | 
			
		||||
        appInfo.setAppGitName("APPBase");
 | 
			
		||||
        appInfo.setAppGitName("APP");
 | 
			
		||||
        appInfo.setAppGitOwner("Studio");
 | 
			
		||||
        appInfo.setAppGitAPPBranch(szBranchName);
 | 
			
		||||
        appInfo.setAppGitAPPSubProjectFolder(szBranchName);
 | 
			
		||||
        appInfo.setAppHomePage("https://discuz.winboll.cc/forum.php?mod=viewthread&tid=5&extra=page%3D1");
 | 
			
		||||
        appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=MyMessageManager");
 | 
			
		||||
        appInfo.setAppAPKName("MyMessageManager");
 | 
			
		||||
        appInfo.setAppAPKFolderName("MyMessageManager");
 | 
			
		||||
        return new AboutView(mContext, appInfo);
 | 
			
		||||
 
 | 
			
		||||
@@ -103,9 +103,6 @@ abstract public class BaseActivity extends AppCompatActivity {
 | 
			
		||||
        } else if (R.id.item_defaulttheme == item.getItemId()) {
 | 
			
		||||
            AESThemeUtil.saveThemeStyleID(this, R.style.MyAppTheme);
 | 
			
		||||
            recreate();
 | 
			
		||||
        } else if (R.id.item_defaulttheme == item.getItemId()) {
 | 
			
		||||
            AESThemeUtil.saveThemeStyleID(this, R.style.MyAppTheme);
 | 
			
		||||
            recreate();
 | 
			
		||||
        }
 | 
			
		||||
        //ToastUtils.show("nThemeStyleID " + Integer.toString(nThemeStyleID));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,5 @@
 | 
			
		||||
package cc.winboll.studio.mymessagemanager.activitys;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen&豆包大模型<zhangsken@188.com>
 | 
			
		||||
 * @Date 2025/08/30 14:32
 | 
			
		||||
 * @Describe 联系人查询与短信发送窗口
 | 
			
		||||
 */
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.text.Editable;
 | 
			
		||||
import android.text.TextWatcher;
 | 
			
		||||
@@ -16,17 +11,13 @@ import android.widget.RelativeLayout;
 | 
			
		||||
import android.widget.SimpleAdapter;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toolbar;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.graphics.drawable.Drawable;
 | 
			
		||||
 | 
			
		||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.R;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.activitys.ComposeSMSActivity;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.beans.PhoneBean;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.utils.PhoneUtil;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
 | 
			
		||||
import com.hjq.toast.ToastUtils;
 | 
			
		||||
import cc.winboll.studio.libappbase.LogUtils;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -35,331 +26,166 @@ import java.util.Map;
 | 
			
		||||
public class ComposeSMSActivity extends BaseActivity {
 | 
			
		||||
 | 
			
		||||
    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;
 | 
			
		||||
    public static String EXTRA_SMSBODY = "sms_body";
 | 
			
		||||
 | 
			
		||||
    static String MAP_NAME = "NAME";
 | 
			
		||||
    static String MAP_PHONE = "PHONE";
 | 
			
		||||
 | 
			
		||||
    String mszSMSBody;
 | 
			
		||||
    String mszScheme;
 | 
			
		||||
    String mszPhoneTo;
 | 
			
		||||
    EditText metTO;
 | 
			
		||||
    EditText metSMSBody;
 | 
			
		||||
    SimpleAdapter mSimpleAdapter;
 | 
			
		||||
    List<Map<String,Object>> mAdapterData = new ArrayList<>();
 | 
			
		||||
    ListView mlvContracts;
 | 
			
		||||
    List<PhoneBean> mListPhoneBeanContracts;
 | 
			
		||||
    Toolbar mToolbar;
 | 
			
		||||
    AOHPCTCSeekBar mAOHPCTCSeekBar;
 | 
			
		||||
    RelativeLayout mrlContracts;
 | 
			
		||||
 | 
			
		||||
    @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("不支持的启动方式");
 | 
			
		||||
        mszSMSBody = getIntent().getStringExtra(EXTRA_SMSBODY);
 | 
			
		||||
        mszScheme = getIntent().getData().getScheme();
 | 
			
		||||
        mszPhoneTo = getIntent().getData().getSchemeSpecificPart();
 | 
			
		||||
        if (!mszScheme.equals("smsto")) {
 | 
			
		||||
            // 其他方式未支持就退出
 | 
			
		||||
            finish();
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 初始化视图
 | 
			
		||||
        initView();
 | 
			
		||||
        initAdapter(null); // 初始加载所有联系人
 | 
			
		||||
        setListViewPrePositionByPhone();
 | 
			
		||||
        // 设置适配器
 | 
			
		||||
        initAdapter();
 | 
			
		||||
        // 设置搜索到的匹配位置
 | 
			
		||||
        setListViewPrePosition();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void initView() {
 | 
			
		||||
    //
 | 
			
		||||
    // 初始化视图
 | 
			
		||||
    //
 | 
			
		||||
    void initView() {
 | 
			
		||||
        //Drawable drawableFrame = AppCompatResources.getDrawable(this, R.drawable.bg_frame);
 | 
			
		||||
 | 
			
		||||
        // 初始化标题栏
 | 
			
		||||
        mToolbar = (Toolbar) findViewById(R.id.activitycomposesmsASupportToolbar1);
 | 
			
		||||
        mToolbar = 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);
 | 
			
		||||
        // 初始化联系人栏目框
 | 
			
		||||
        mrlContracts = findViewById(R.id.activitycomposesmsRelativeLayout1);
 | 
			
		||||
        //mrlContracts.setBackground(drawableFrame);
 | 
			
		||||
 | 
			
		||||
        // 姓名搜索框文本变化监听
 | 
			
		||||
        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(); // 按姓名搜索
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
        // 初始化联系人列表
 | 
			
		||||
        mlvContracts = findViewById(R.id.activitycomposesmsListView1);
 | 
			
		||||
 | 
			
		||||
				@Override
 | 
			
		||||
				public void beforeTextChanged(CharSequence s, int start, int count, int after) {
 | 
			
		||||
					// 无操作
 | 
			
		||||
				}
 | 
			
		||||
        // 初始化联系人输入框
 | 
			
		||||
        metTO = findViewById(R.id.activitycomposesmsEditText1);
 | 
			
		||||
        metTO.setText(mszPhoneTo);
 | 
			
		||||
        metTO.addTextChangedListener(new TextWatcher() {           
 | 
			
		||||
                @Override  
 | 
			
		||||
                public void onTextChanged(CharSequence s, int start, int before, int count) {
 | 
			
		||||
                    setListViewPrePosition();
 | 
			
		||||
                }
 | 
			
		||||
                @Override  
 | 
			
		||||
                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
				@Override
 | 
			
		||||
				public void afterTextChanged(Editable s) {
 | 
			
		||||
					// 无操作
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
                @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 = findViewById(R.id.viewsmssendpart1AOHPCTCSeekBar1);
 | 
			
		||||
        mAOHPCTCSeekBar.setThumb(getDrawable(R.drawable.ic_message));
 | 
			
		||||
        mAOHPCTCSeekBar.setThumbOffset(20);
 | 
			
		||||
        mAOHPCTCSeekBar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
 | 
			
		||||
				@Override
 | 
			
		||||
				public void onOHPCommit() {
 | 
			
		||||
					sendSMS();
 | 
			
		||||
				}
 | 
			
		||||
                @Override
 | 
			
		||||
                public void onOHPCommit() {
 | 
			
		||||
                    // 空号码不发送
 | 
			
		||||
                    mszPhoneTo = metTO.getText().toString();
 | 
			
		||||
                    if (mszPhoneTo.trim().equals("")) {
 | 
			
		||||
                        ToastUtils.show("没有设置接收号码。");
 | 
			
		||||
                        return;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 空消息不发送
 | 
			
		||||
                    mszSMSBody = metSMSBody.getText().toString();
 | 
			
		||||
                    if (mszSMSBody.equals("")) {
 | 
			
		||||
                        ToastUtils.show("没有消息内容可发送。");
 | 
			
		||||
                        return;
 | 
			
		||||
                    }
 | 
			
		||||
                    // 发送消息
 | 
			
		||||
                    if (SMSUtil.sendMessageByInterface2(ComposeSMSActivity.this, mszPhoneTo, mszSMSBody)) {
 | 
			
		||||
                        ComposeSMSActivity.this.finish();
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
        // 初始化短信内容输入框
 | 
			
		||||
        TextView tvAOHPCTCSeekBarMSG = (TextView) findViewById(R.id.viewsmssendpart1TextView1);
 | 
			
		||||
        // 初始化提示框
 | 
			
		||||
        TextView tvAOHPCTCSeekBarMSG = findViewById(R.id.viewsmssendpart1TextView1);
 | 
			
		||||
        tvAOHPCTCSeekBarMSG.setText(R.string.msg_100sendmsg);
 | 
			
		||||
        metSMSBody = (EditText) findViewById(R.id.viewsmssendpart1EditText1);
 | 
			
		||||
        if (mszSMSBody != null) {
 | 
			
		||||
            metSMSBody.setText(mszSMSBody);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 初始化发送消息框
 | 
			
		||||
        metSMSBody = findViewById(R.id.viewsmssendpart1EditText1);
 | 
			
		||||
        //metSMSBody.setBackground(drawableFrame);
 | 
			
		||||
        metSMSBody.setText(mszSMSBody);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 核心优化:根据输入号码筛选列表(无结果则显示空列表,优化选中逻辑)
 | 
			
		||||
    private void filterListByPhone(String inputPhone) {
 | 
			
		||||
        PhoneUtil phoneUtil = new PhoneUtil(this);
 | 
			
		||||
        List<PhoneBean> allContacts = phoneUtil.getPhoneList();
 | 
			
		||||
        List<PhoneBean> matchedContacts = new ArrayList<PhoneBean>();
 | 
			
		||||
    //
 | 
			
		||||
    // 设置搜索到的匹配位置
 | 
			
		||||
    //
 | 
			
		||||
    void setListViewPrePosition() {
 | 
			
		||||
        int nPrePosition = getContractsDataPrePosition(metTO.getText().toString());
 | 
			
		||||
        mlvContracts.setSelected(false);
 | 
			
		||||
        mlvContracts.setSelection(nPrePosition);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        // 遍历所有联系人,匹配包含输入号码的联系人
 | 
			
		||||
        for (PhoneBean contact : allContacts) {
 | 
			
		||||
            if (contact.getTelPhone().contains(inputPhone)
 | 
			
		||||
                || phoneUtil.isTheSamePhoneNumber(contact.getTelPhone(), inputPhone)) {
 | 
			
		||||
                matchedContacts.add(contact);
 | 
			
		||||
    //
 | 
			
		||||
    // 返回搜索到的匹配位置
 | 
			
		||||
    //
 | 
			
		||||
    int getContractsDataPrePosition(String szPhone) {
 | 
			
		||||
        for (int i = 0; i < mListPhoneBeanContracts.size(); i++) {
 | 
			
		||||
            if (mListPhoneBeanContracts.get(i).getTelPhone().compareTo(szPhone) > -1) {
 | 
			
		||||
                return i;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        LogUtils.d(TAG, "号码搜索:输入'" + inputPhone + "', 匹配" + matchedContacts.size() + "个结果");
 | 
			
		||||
    //
 | 
			
		||||
    // 初始化适配器
 | 
			
		||||
    //
 | 
			
		||||
    void initAdapter() {
 | 
			
		||||
        // 初始化联系人数据适配器
 | 
			
		||||
        mAdapterData = new ArrayList<>();
 | 
			
		||||
        // 读取联系人数据
 | 
			
		||||
        PhoneUtil phoneUtils = new PhoneUtil(this);
 | 
			
		||||
        mListPhoneBeanContracts = phoneUtils.getPhoneList();
 | 
			
		||||
        // 映射联系人数据给适配器数据对象
 | 
			
		||||
        for (int i = 0;i < mListPhoneBeanContracts.size();i++) {
 | 
			
		||||
            Map<String,Object> map =new HashMap<>();
 | 
			
		||||
            map.put(MAP_NAME, mListPhoneBeanContracts.get(i).getName());
 | 
			
		||||
            map.put(MAP_PHONE, mListPhoneBeanContracts.get(i).getTelPhone());
 | 
			
		||||
            mAdapterData.add(map);
 | 
			
		||||
        }
 | 
			
		||||
        // 绑定适配器与数据
 | 
			
		||||
        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 ListView.OnItemClickListener() {
 | 
			
		||||
 | 
			
		||||
        // 用筛选结果更新列表(无结果则传入空列表)
 | 
			
		||||
        initAdapter(matchedContacts.isEmpty() ? new ArrayList<PhoneBean>() : matchedContacts);
 | 
			
		||||
                @Override
 | 
			
		||||
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
 | 
			
		||||
                    metTO.setText(mAdapterData.get(position).get(MAP_PHONE).toString());
 | 
			
		||||
 | 
			
		||||
        // 定位并选中匹配项(如果有)
 | 
			
		||||
        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) {
 | 
			
		||||
						// 选中时可添加额外反馈(如改变文本颜色,可选)
 | 
			
		||||
						if (view != null) {
 | 
			
		||||
							TextView tvName = (TextView) view.findViewById(R.id.listviewcontractsTextView1);
 | 
			
		||||
							TextView tvPhone = (TextView) view.findViewById(R.id.listviewcontractsTextView2);
 | 
			
		||||
							if (tvName != null) tvName.setTextColor(getResources().getColor(R.color.white));
 | 
			
		||||
							if (tvPhone != null) tvPhone.setTextColor(getResources().getColor(R.color.white));
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					@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();
 | 
			
		||||
        }
 | 
			
		||||
            });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -128,7 +128,7 @@ public class MainActivity extends BaseActivity {
 | 
			
		||||
        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);
 | 
			
		||||
@@ -269,9 +269,17 @@ public class MainActivity extends BaseActivity {
 | 
			
		||||
    public boolean onCreateOptionsMenu(Menu menu) {
 | 
			
		||||
        //return super.onCreateOptionsMenu(menu);
 | 
			
		||||
        getMenuInflater().inflate(R.menu.toolbar_main, menu);
 | 
			
		||||
        super.onCreateOptionsMenu(menu);
 | 
			
		||||
		getMenuInflater().inflate(R.menu.toolbar_main2, menu);
 | 
			
		||||
		return true;
 | 
			
		||||
 | 
			
		||||
        /*ThemeUtil.BaseTheme baseTheme = ThemeUtil.getTheme(mAppConfigUtil.mAppConfigBean.getAppThemeID());
 | 
			
		||||
        if (baseTheme == ThemeUtil.BaseTheme.DEFAULT) {
 | 
			
		||||
            menu.findItem(R.id.app_defaulttheme).setChecked(true);
 | 
			
		||||
        } else if (baseTheme == ThemeUtil.BaseTheme.SKY) {
 | 
			
		||||
            menu.findItem(R.id.app_skytheme).setChecked(true);
 | 
			
		||||
        } else if (baseTheme == ThemeUtil.BaseTheme.GOLDEN) {
 | 
			
		||||
            menu.findItem(R.id.app_goldentheme).setChecked(true);
 | 
			
		||||
        }*/
 | 
			
		||||
 | 
			
		||||
        return super.onCreateOptionsMenu(menu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void reloadSMS() {
 | 
			
		||||
@@ -298,7 +306,7 @@ public class MainActivity extends BaseActivity {
 | 
			
		||||
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 | 
			
		||||
            startActivity(i);
 | 
			
		||||
		} else if (nItemId ==  R.id.app_log) {
 | 
			
		||||
            App.getWinBoLLActivityManager().startLogActivity(this);
 | 
			
		||||
            //App.getWinBoLLActivityManager().startLogActivity(this);
 | 
			
		||||
        } else if (nItemId ==  R.id.app_unittest) {
 | 
			
		||||
            Intent i = new Intent(MainActivity.this, UnitTestActivity.class);
 | 
			
		||||
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 | 
			
		||||
@@ -316,7 +324,7 @@ public class MainActivity extends BaseActivity {
 | 
			
		||||
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 | 
			
		||||
            startActivity(i);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        return super.onOptionsItemSelected(item);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,16 +4,11 @@ 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.os.Message;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.view.ViewTreeObserver;
 | 
			
		||||
import android.view.inputmethod.InputMethodManager;
 | 
			
		||||
import android.widget.AbsListView;
 | 
			
		||||
import android.widget.EditText;
 | 
			
		||||
import android.widget.LinearLayout;
 | 
			
		||||
import android.widget.ScrollView;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
@@ -21,17 +16,19 @@ import android.widget.Toolbar;
 | 
			
		||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
 | 
			
		||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.R;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.activitys.SMSActivity;
 | 
			
		||||
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 java.lang.ref.WeakReference;
 | 
			
		||||
 | 
			
		||||
public class SMSActivity extends BaseActivity {
 | 
			
		||||
    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;
 | 
			
		||||
 | 
			
		||||
@@ -39,11 +36,10 @@ public class SMSActivity extends BaseActivity {
 | 
			
		||||
    Toolbar mToolbar;
 | 
			
		||||
    String mszPhoneTo;
 | 
			
		||||
    SMSArrayAdapter mSMSArrayAdapter;
 | 
			
		||||
    BottomPositionFixedScrollView mScrollView1;
 | 
			
		||||
    ScrollView mScrollView;
 | 
			
		||||
    EditText metSMSBody;
 | 
			
		||||
    SMSActivityBroadcastReceiver mSMSActivityBroadcastReceiver;
 | 
			
		||||
    Handler mSetFocusHandler;
 | 
			
		||||
    private boolean isImeVisible = false;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
@@ -51,90 +47,45 @@ public class SMSActivity extends BaseActivity {
 | 
			
		||||
        setContentView(R.layout.activity_sms);
 | 
			
		||||
 | 
			
		||||
        initView();
 | 
			
		||||
		mSetFocusHandler = new MyHandler(SMSActivity.this);
 | 
			
		||||
        scrollScrollView();
 | 
			
		||||
        setupImeStatusListener();
 | 
			
		||||
 | 
			
		||||
        // 新增:监听窗口加载完成,触发mScrollView1滚动到底部
 | 
			
		||||
        setupScrollToBottomAfterWindowLoaded();
 | 
			
		||||
        // 每隔一定时间设置输入框获得焦点
 | 
			
		||||
        //
 | 
			
		||||
        new Thread() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void run() {
 | 
			
		||||
                while (true) {
 | 
			
		||||
                    try {
 | 
			
		||||
                        Thread.sleep(1500);
 | 
			
		||||
                    } catch (InterruptedException e) {}
 | 
			
		||||
                    Message message = mSetFocusHandler.obtainMessage(MSG_SET_FOCUS);
 | 
			
		||||
                    mSetFocusHandler.sendMessage(message);
 | 
			
		||||
                }
 | 
			
		||||
            }}.start();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 新增:窗口加载完成后让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);
 | 
			
		||||
	 }
 | 
			
		||||
	 }*/
 | 
			
		||||
    //
 | 
			
		||||
    // 设置输入框获得焦点的类
 | 
			
		||||
	//
 | 
			
		||||
	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();
 | 
			
		||||
                    break;
 | 
			
		||||
                default:
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
            super.handleMessage(msg);
 | 
			
		||||
        }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onDestroy() {
 | 
			
		||||
@@ -143,130 +94,135 @@ public class SMSActivity extends BaseActivity {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void initView() {
 | 
			
		||||
        // 发送端空号码退出
 | 
			
		||||
        mszPhoneTo = getIntent().getStringExtra(EXTRA_PHONE);
 | 
			
		||||
        if (mszPhoneTo == null || mszPhoneTo.trim().equals("")) {
 | 
			
		||||
            finish();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        mToolbar = (Toolbar) findViewById(R.id.activitysmsASupportToolbar1);
 | 
			
		||||
        // 初始化标题栏
 | 
			
		||||
        mToolbar = findViewById(R.id.activitysmsASupportToolbar1);
 | 
			
		||||
        mToolbar.setSubtitle(getString(R.string.activity_name_smsinphone) + " < Phone : " + AddressUtils.getFormattedAddress(mszPhoneTo) + " >");
 | 
			
		||||
        setActionBar(mToolbar);
 | 
			
		||||
 | 
			
		||||
        mScrollView1 = (BottomPositionFixedScrollView) findViewById(R.id.activitysmsScrollView1);
 | 
			
		||||
        // 初始化滚动窗口
 | 
			
		||||
        mScrollView = findViewById(R.id.activitysmsinphoneScrollView1);
 | 
			
		||||
 | 
			
		||||
        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();
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
        // 初始化发送消息框
 | 
			
		||||
        //Drawable drawableFrame = AppCompatResources.getDrawable(this, R.drawable.bg_frame);
 | 
			
		||||
        metSMSBody = findViewById(R.id.viewsmssendpart1EditText1);
 | 
			
		||||
        //metSMSBody.setBackground(drawableFrame);
 | 
			
		||||
 | 
			
		||||
        final AOHPCTCSeekBar aOHPCTCSeekBar = (AOHPCTCSeekBar) findViewById(R.id.viewsmssendpart1AOHPCTCSeekBar1);
 | 
			
		||||
        // 初始化发送拉动控件
 | 
			
		||||
        final 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();
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
        aOHPCTCSeekBar.setOnOHPCListener(
 | 
			
		||||
            new AOHPCTCSeekBar.OnOHPCListener(){
 | 
			
		||||
                @Override
 | 
			
		||||
                public void onOHPCommit() {
 | 
			
		||||
                    //Toast.makeText(getApplication(), "Send", Toast.LENGTH_SHORT).show();
 | 
			
		||||
                    sendSMS();
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        TextView tvAOHPCTCSeekBarMSG = (TextView) findViewById(R.id.viewsmssendpart1TextView1);
 | 
			
		||||
        // 初始化提示框
 | 
			
		||||
        TextView tvAOHPCTCSeekBarMSG = findViewById(R.id.viewsmssendpart1TextView1);
 | 
			
		||||
        tvAOHPCTCSeekBarMSG.setText(R.string.msg_100sendmsg);
 | 
			
		||||
 | 
			
		||||
        mlvSMS = (SMSListViewForScrollView) findViewById(R.id.activitysmsSMSListViewForScrollView1);
 | 
			
		||||
        mlvSMS = (SMSListViewForScrollView) findViewById(R.id.activitysmsinphoneListView1);
 | 
			
		||||
 | 
			
		||||
        // 准备数据
 | 
			
		||||
        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 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();
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
                @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);
 | 
			
		||||
        IntentFilter intentFilter = new IntentFilter();
 | 
			
		||||
        intentFilter.addAction(ACTION_NOTIFY_SMS_CHANGED);
 | 
			
		||||
        LocalBroadcastManager.getInstance(this).registerReceiver(mSMSActivityBroadcastReceiver, intentFilter);
 | 
			
		||||
 | 
			
		||||
        /*SMSView mSMSView = findViewById(R.id.viewsmssendSMSView1);
 | 
			
		||||
        mSMSView.setSMSType(SMSView.SMSType.SEND);*/
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    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);
 | 
			
		||||
 | 
			
		||||
        ViewUtil.scrollScrollView(mScrollView);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // 发送短信
 | 
			
		||||
    //
 | 
			
		||||
    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);
 | 
			
		||||
            new Handler().postDelayed(new Runnable(){
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void run() {
 | 
			
		||||
                        updateSMSView();
 | 
			
		||||
                        ViewUtil.scrollScrollView(mScrollView);
 | 
			
		||||
                    }
 | 
			
		||||
                }, 1000);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    class SMSActivityBroadcastReceiver extends BroadcastReceiver {
 | 
			
		||||
        public SMSActivityBroadcastReceiver() {}
 | 
			
		||||
 | 
			
		||||
        public SMSActivityBroadcastReceiver() {
 | 
			
		||||
            //LogUtils.d(TAG, "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());
 | 
			
		||||
            switch (intent.getAction()) {
 | 
			
		||||
                case ACTION_NOTIFY_SMS_CHANGED :
 | 
			
		||||
                    //Toast.makeText(context, "ACTION_NOTIFY_SMS_CHANGED", Toast.LENGTH_SHORT).show();
 | 
			
		||||
                    updateSMSView();
 | 
			
		||||
                    ViewUtil.scrollScrollView(mScrollView);
 | 
			
		||||
                    //LogUtils.d(TAG, "ACTION_NOTIFY_SMS_CHANGED");
 | 
			
		||||
                    break;
 | 
			
		||||
                default:
 | 
			
		||||
                    throw new IllegalStateException("Unexpected value: " + intent.getAction());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,9 +13,9 @@ import cc.winboll.studio.libaes.beans.AESThemeBean;
 | 
			
		||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
 | 
			
		||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
 | 
			
		||||
 | 
			
		||||
public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivity {
 | 
			
		||||
public class WinBollActivity extends AppCompatActivity implements IWinBoLLActivity {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "WinBoLLActivity";
 | 
			
		||||
    public static final String TAG = "WinBollActivity";
 | 
			
		||||
 | 
			
		||||
    protected volatile AESThemeBean.ThemeType mThemeType;
 | 
			
		||||
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package cc.winboll.studio.mymessagemanager.utils;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen&豆包大模型<zhangsken@188.com>
 | 
			
		||||
 * @Date 2025/08/30 14:32
 | 
			
		||||
 * @Author ZhanGSKen<zhangsken@188.com>
 | 
			
		||||
 * @Date 2024/07/19 14:30:57
 | 
			
		||||
 * @Describe 手机联系人工具类
 | 
			
		||||
 */
 | 
			
		||||
import android.content.ContentResolver;
 | 
			
		||||
@@ -11,7 +11,6 @@ import android.database.Cursor;
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
import android.provider.ContactsContract;
 | 
			
		||||
import cc.winboll.studio.libappbase.LogUtils;
 | 
			
		||||
import cc.winboll.studio.libapputils.utils.RegexPPiUtils;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.beans.PhoneBean;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Collections;
 | 
			
		||||
@@ -19,11 +18,6 @@ import java.util.Comparator;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.regex.Matcher;
 | 
			
		||||
import java.util.regex.Pattern;
 | 
			
		||||
import net.sourceforge.pinyin4j.PinyinHelper;
 | 
			
		||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
 | 
			
		||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
 | 
			
		||||
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
 | 
			
		||||
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
 | 
			
		||||
 | 
			
		||||
public class PhoneUtil {
 | 
			
		||||
 | 
			
		||||
@@ -44,137 +38,28 @@ public class PhoneUtil {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 读取所有联系人
 | 
			
		||||
    //
 | 
			
		||||
    public List<PhoneBean> getPhoneList() {
 | 
			
		||||
        List<PhoneBean> listPhoneBean = new ArrayList<>();
 | 
			
		||||
        ContentResolver cr = mContext.getContentResolver();
 | 
			
		||||
        Cursor cursor = cr.query(mUriPhoneContent, new String[]{NUMBER, DISPLAY_NAME}, null, null, null);
 | 
			
		||||
        if (cursor != null) {
 | 
			
		||||
            while (cursor.moveToNext()) {
 | 
			
		||||
                // 去除号码中的空格
 | 
			
		||||
                String phone = cursor.getString(0).replaceAll("\\s", "");
 | 
			
		||||
                String name = cursor.getString(1);
 | 
			
		||||
                PhoneBean phoneBean = new PhoneBean(name, phone);
 | 
			
		||||
                listPhoneBean.add(phoneBean);
 | 
			
		||||
            }
 | 
			
		||||
            cursor.close();
 | 
			
		||||
        }
 | 
			
		||||
        while (cursor.moveToNext()) {
 | 
			
		||||
			PhoneBean phoneBean = new PhoneBean(cursor.getString(1), cursor.getString(0).replaceAll("\\s", ""));
 | 
			
		||||
			listPhoneBean.add(phoneBean);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
		cursor.close();
 | 
			
		||||
 | 
			
		||||
        // 按电话号码排序
 | 
			
		||||
        Collections.sort(listPhoneBean, new Comparator<PhoneBean>() {
 | 
			
		||||
				@Override
 | 
			
		||||
				public int compare(PhoneBean o1, PhoneBean o2) {
 | 
			
		||||
					return o1.getTelPhone().compareTo(o2.getTelPhone());
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
                @Override
 | 
			
		||||
                public int compare(PhoneBean o1, PhoneBean o2) {
 | 
			
		||||
                    return o1.getTelPhone().compareTo(o2.getTelPhone());
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        return listPhoneBean;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据联系人名称查询号码(兼容拼音查询)
 | 
			
		||||
     * @param keyword 搜索关键词(支持汉字、拼音、拼音首字母)
 | 
			
		||||
     * @return 匹配的联系人列表(包含姓名和号码)
 | 
			
		||||
     */
 | 
			
		||||
    public List<PhoneBean> getPhonesByName(String keyword) {
 | 
			
		||||
        List<PhoneBean> result = new ArrayList<>();
 | 
			
		||||
        if (keyword == null || keyword.trim().isEmpty()) {
 | 
			
		||||
            return result; // 关键词为空,返回空列表
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 获取所有联系人
 | 
			
		||||
        List<PhoneBean> allContacts = getPhoneList();
 | 
			
		||||
        // 统一转为小写,忽略大小写
 | 
			
		||||
        String keywordLower = keyword.trim().toLowerCase();
 | 
			
		||||
 | 
			
		||||
        for (PhoneBean contact : allContacts) {
 | 
			
		||||
            String name = contact.getName();
 | 
			
		||||
            if (name == null || name.isEmpty()) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // 1. 直接匹配姓名(包含关键词)
 | 
			
		||||
            if (name.toLowerCase().contains(keywordLower)) {
 | 
			
		||||
                result.add(contact);
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // 2. 匹配姓名的全拼(包含关键词)
 | 
			
		||||
            String namePinyin = getPinyin(name).toLowerCase();
 | 
			
		||||
            if (namePinyin.contains(keywordLower)) {
 | 
			
		||||
                result.add(contact);
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // 3. 匹配姓名的拼音首字母(包含关键词)
 | 
			
		||||
            String namePinyinFirstLetter = getPinyinFirstLetter(name).toLowerCase();
 | 
			
		||||
            if (namePinyinFirstLetter.contains(keywordLower)) {
 | 
			
		||||
                result.add(contact);
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 将汉字转为全拼(不带声调,小写)
 | 
			
		||||
     * 例如:"张三" → "zhangsan"
 | 
			
		||||
     */
 | 
			
		||||
    private String getPinyin(String chinese) {
 | 
			
		||||
        StringBuilder pinyin = new StringBuilder();
 | 
			
		||||
        HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
 | 
			
		||||
        format.setCaseType(HanyuPinyinCaseType.LOWERCASE); // 小写
 | 
			
		||||
        format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); // 不带声调
 | 
			
		||||
 | 
			
		||||
        char[] chars = chinese.toCharArray();
 | 
			
		||||
        for (char c : chars) {
 | 
			
		||||
            // 如果是汉字,转换为拼音;否则直接拼接(如字母、数字、符号)
 | 
			
		||||
            if (Character.toString(c).matches("[\\u4e00-\\u9fa5]")) {
 | 
			
		||||
                try {
 | 
			
		||||
                    String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, format);
 | 
			
		||||
                    if (pinyinArray != null && pinyinArray.length > 0) {
 | 
			
		||||
                        pinyin.append(pinyinArray[0]); // 取第一个拼音(多音字默认取第一个)
 | 
			
		||||
                    }
 | 
			
		||||
                } catch (BadHanyuPinyinOutputFormatCombination e) {
 | 
			
		||||
                    LogUtils.e(TAG, "拼音转换失败:" + e.getMessage());
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                pinyin.append(c);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return pinyin.toString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 将汉字转为拼音首字母(小写)
 | 
			
		||||
     * 例如:"张三" → "zs"
 | 
			
		||||
     */
 | 
			
		||||
    private String getPinyinFirstLetter(String chinese) {
 | 
			
		||||
        StringBuilder firstLetters = new StringBuilder();
 | 
			
		||||
        HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
 | 
			
		||||
        format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
 | 
			
		||||
        format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
 | 
			
		||||
 | 
			
		||||
        char[] chars = chinese.toCharArray();
 | 
			
		||||
        for (char c : chars) {
 | 
			
		||||
            if (Character.toString(c).matches("[\\u4e00-\\u9fa5]")) {
 | 
			
		||||
                try {
 | 
			
		||||
                    String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, format);
 | 
			
		||||
                    if (pinyinArray != null && pinyinArray.length > 0) {
 | 
			
		||||
                        // 取拼音首字母(如"zhang" → "z")
 | 
			
		||||
                        firstLetters.append(pinyinArray[0].charAt(0));
 | 
			
		||||
                    }
 | 
			
		||||
                } catch (BadHanyuPinyinOutputFormatCombination e) {
 | 
			
		||||
                    LogUtils.e(TAG, "拼音首字母转换失败:" + e.getMessage());
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                // 非汉字直接拼接首字符(如"李3" → "l3")
 | 
			
		||||
                firstLetters.append(c);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return firstLetters.toString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean isPhoneInContacts(String szPhone) {
 | 
			
		||||
        List<PhoneBean> listPhoneDto = getPhoneList();
 | 
			
		||||
        LogUtils.d(TAG, String.format("isPhoneInContacts(...) listPhoneDto.size() %d", listPhoneDto.size()));
 | 
			
		||||
@@ -185,56 +70,49 @@ public class PhoneUtil {
 | 
			
		||||
        }
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getNameByPhone(String szPhone) {
 | 
			
		||||
        if (szPhone == null || szPhone.equals("")) {
 | 
			
		||||
            return "";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        List<PhoneBean> listPhoneDto = getPhoneList();
 | 
			
		||||
        LogUtils.d(TAG, String.format("getNameByPhone(...) listPhoneDto.size() %d", listPhoneDto.size()));
 | 
			
		||||
        for (int i = 0; i < listPhoneDto.size(); i++) {
 | 
			
		||||
            if (isTheSamePhoneNumber(listPhoneDto.get(i).getTelPhone(), szPhone)) {
 | 
			
		||||
                return listPhoneDto.get(i).getName();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return "";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean isTheSamePhoneNumber(String szNum1, String szNum2) {
 | 
			
		||||
        if (szNum1.equals(szNum2)) {
 | 
			
		||||
    
 | 
			
		||||
    boolean isTheSamePhoneNumber(String szNum1, String szNum2) {
 | 
			
		||||
        //LogUtils.d(TAG, String.format("szNum1 %s\nszNum2 %s", szNum1, szNum2));
 | 
			
		||||
        if(szNum1.equals(szNum2)) {
 | 
			
		||||
            LogUtils.d(TAG, "szNum1.equals(szNum2)");
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (UnitAreaUtils.getInstance(mContext).isCurrentUnitAreaNumber(szNum1)) {
 | 
			
		||||
            if (szNum1.equals(UnitAreaUtils.getInstance(mContext).genCurrentUnitAreaNumber(szNum2))) {
 | 
			
		||||
        
 | 
			
		||||
        if(UnitAreaUtils.getInstance(mContext).isCurrentUnitAreaNumber(szNum1)) {
 | 
			
		||||
            if(szNum1.equals(UnitAreaUtils.getInstance(mContext).genCurrentUnitAreaNumber(szNum2))) {
 | 
			
		||||
                LogUtils.d(TAG, "szNum1.equals(UnitAreaUtils.genCurrentUnitAreaNumber(szNum2))");
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (UnitAreaUtils.getInstance(mContext).isCurrentUnitAreaNumber(szNum2)) {
 | 
			
		||||
            if (szNum2.equals(UnitAreaUtils.getInstance(mContext).genCurrentUnitAreaNumber(szNum1))) {
 | 
			
		||||
        
 | 
			
		||||
        if(UnitAreaUtils.getInstance(mContext).isCurrentUnitAreaNumber(szNum2)) {
 | 
			
		||||
            if(szNum2.equals(UnitAreaUtils.getInstance(mContext).genCurrentUnitAreaNumber(szNum1))) {
 | 
			
		||||
                LogUtils.d(TAG, "szNum2.equals(UnitAreaUtils.genCurrentUnitAreaNumber(szNum1))");
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        LogUtils.d(TAG, "isTheSamePhoneNumber(...) return false;");
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // 检验电话号码是否是数字
 | 
			
		||||
    //
 | 
			
		||||
    public static boolean isPhoneByDigit(String szPhone) {
 | 
			
		||||
        if (!RegexPPiUtils.isPPiOK(szPhone)) {
 | 
			
		||||
        if(!RegexPPiUtils.isPPiOK(szPhone)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        //String text = "这里是一些任意的文本内容";
 | 
			
		||||
        String regex = "[+]?\\d+";
 | 
			
		||||
        Pattern pattern = Pattern.compile(regex);
 | 
			
		||||
        Matcher matcher = pattern.matcher(szPhone);
 | 
			
		||||
        LogUtils.d(TAG, String.format("matcher.matches() : %s", matcher.matches()));
 | 
			
		||||
        /*if (matcher.matches()) {
 | 
			
		||||
         System.out.println("文本满足该正则表达式模式");
 | 
			
		||||
         } else {
 | 
			
		||||
         System.out.println("文本不满足该正则表达式模式");
 | 
			
		||||
         }*/
 | 
			
		||||
        return matcher.matches();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
package cc.winboll.studio.mymessagemanager.utils;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen<zhangsken@188.com>
 | 
			
		||||
 * @Date 2024/12/09 19:00:21
 | 
			
		||||
 * @Describe .* 前置预防针
 | 
			
		||||
 regex pointer preventive injection
 | 
			
		||||
 简称 RegexPPi
 | 
			
		||||
 */
 | 
			
		||||
import java.util.regex.Matcher;
 | 
			
		||||
import java.util.regex.Pattern;
 | 
			
		||||
 | 
			
		||||
public class RegexPPiUtils {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "RegexPPiUtils";
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // 检验文本是否满足适合正则表达式模式计算
 | 
			
		||||
    //
 | 
			
		||||
    public static boolean isPPiOK(String text) {
 | 
			
		||||
        //String text = "这里是一些任意的文本内容";
 | 
			
		||||
        String regex = ".*";
 | 
			
		||||
        Pattern pattern = Pattern.compile(regex);
 | 
			
		||||
        Matcher matcher = pattern.matcher(text);
 | 
			
		||||
        /*if (matcher.matches()) {
 | 
			
		||||
         System.out.println("文本满足该正则表达式模式");
 | 
			
		||||
         } else {
 | 
			
		||||
         System.out.println("文本不满足该正则表达式模式");
 | 
			
		||||
         }*/
 | 
			
		||||
        return matcher.matches();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -8,7 +8,6 @@ package cc.winboll.studio.mymessagemanager.utils;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.util.JsonReader;
 | 
			
		||||
import cc.winboll.studio.libappbase.LogUtils;
 | 
			
		||||
import cc.winboll.studio.libapputils.utils.RegexPPiUtils;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
 | 
			
		||||
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean_V1;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
 
 | 
			
		||||
@@ -10,9 +10,9 @@ import cc.winboll.studio.mymessagemanager.beans.AppConfigBean;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
 | 
			
		||||
public class UnitAreaUtils {
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public static final String TAG = "UnitAreaUtils";
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    static UnitAreaUtils _UnitAreaUtils;
 | 
			
		||||
    Context mContext;
 | 
			
		||||
 | 
			
		||||
@@ -26,25 +26,19 @@ public class UnitAreaUtils {
 | 
			
		||||
        }
 | 
			
		||||
        return _UnitAreaUtils;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public boolean isCurrentUnitAreaNumber(String szPhoneNumer) {
 | 
			
		||||
        String szUnitArea = getUnitArea();
 | 
			
		||||
		try {
 | 
			
		||||
			String szPhoneNumerUnitArea = szPhoneNumer.substring(1, 3);
 | 
			
		||||
			LogUtils.d(TAG, String.format("szPhoneNumerUnitArea %s", szPhoneNumerUnitArea));
 | 
			
		||||
			return szPhoneNumerUnitArea.equals(szUnitArea);
 | 
			
		||||
		} catch (StringIndexOutOfBoundsException e) {
 | 
			
		||||
			LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
		}
 | 
			
		||||
        return false;
 | 
			
		||||
        LogUtils.d(TAG, String.format("szPhoneNumer.substring(1,3) %s", szPhoneNumer.substring(1,3)));
 | 
			
		||||
        return szPhoneNumer.substring(1,3).equals(szUnitArea);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public String genCurrentUnitAreaNumber(String szPhoneNumer) {
 | 
			
		||||
        String szUnitArea = getUnitArea();
 | 
			
		||||
        LogUtils.d(TAG, String.format("szUnitArea %s", szUnitArea));
 | 
			
		||||
        return "+" + szUnitArea + szPhoneNumer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    String getUnitArea() {
 | 
			
		||||
        String szUnitArea = AppConfigUtil.getInstance(mContext).mAppConfigBean.getCountryCode();
 | 
			
		||||
        LogUtils.d(TAG, String.format("szUnitArea %s", szUnitArea));
 | 
			
		||||
 
 | 
			
		||||
@@ -1,125 +0,0 @@
 | 
			
		||||
package cc.winboll.studio.mymessagemanager.views;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen&豆包大模型<zhangsken@188.com>
 | 
			
		||||
 * @Date 2025/08/23 00:39
 | 
			
		||||
 * @Describe 多级拉动响应自定义控件
 | 
			
		||||
 */
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.util.AttributeSet;
 | 
			
		||||
import android.view.ViewTreeObserver;
 | 
			
		||||
import android.widget.ScrollView;
 | 
			
		||||
 | 
			
		||||
public class BottomPositionFixedScrollView extends ScrollView {
 | 
			
		||||
	public static final String TAG = "BottomPositionFixedScrollView";
 | 
			
		||||
	// 记录底部对应的内容绝对位置(即底部位置在内容中的y坐标,该位置需始终保持在视图底部)
 | 
			
		||||
	private int mBottomContentY = 0;
 | 
			
		||||
	// 标记是否是首次布局(避免初始加载误触发)
 | 
			
		||||
	private boolean isFirstLayout = true;
 | 
			
		||||
 | 
			
		||||
	public BottomPositionFixedScrollView(Context context) {
 | 
			
		||||
		super(context);
 | 
			
		||||
		init();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public BottomPositionFixedScrollView(Context context, AttributeSet attrs) {
 | 
			
		||||
		super(context, attrs);
 | 
			
		||||
		init();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public BottomPositionFixedScrollView(Context context, AttributeSet attrs, int defStyle) {
 | 
			
		||||
		super(context, attrs, defStyle);
 | 
			
		||||
		init();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	private void init() {
 | 
			
		||||
		// 监听布局变化(高度改变时触发)
 | 
			
		||||
		getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
 | 
			
		||||
				@Override
 | 
			
		||||
				public void onGlobalLayout() {
 | 
			
		||||
					if (isFirstLayout) {
 | 
			
		||||
						isFirstLayout = false;
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 布局变化后,恢复底部位置
 | 
			
		||||
					restoreBottomPosition();
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 重写滚动事件,记录“底部对应的内容绝对位置”
 | 
			
		||||
	 * (即当前视图底部边缘对应的内容y坐标,该坐标需始终保持在视图底部)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onScrollChanged(int l, int t, int oldl, int oldt) {
 | 
			
		||||
		super.onScrollChanged(l, t, oldl, oldt);
 | 
			
		||||
		if (getChildCount() == 0) {
 | 
			
		||||
			mBottomContentY = 0;
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 内容总高度
 | 
			
		||||
		int contentHeight = getChildAt(0).getMeasuredHeight();
 | 
			
		||||
		// 视图可视高度(自身高度)
 | 
			
		||||
		int scrollViewHeight = getMeasuredHeight();
 | 
			
		||||
		// 当前视图底部边缘对应的内容y坐标 = 顶部滚动距离(t) + 可视高度
 | 
			
		||||
		// (该坐标就是“底部内容的绝对位置”,需始终保持在视图底部)
 | 
			
		||||
		mBottomContentY = t + scrollViewHeight;
 | 
			
		||||
 | 
			
		||||
		// 避免超过内容总高度(比如内容不足一屏时,底部最多到内容底部)
 | 
			
		||||
		if (mBottomContentY > contentHeight) {
 | 
			
		||||
			mBottomContentY = contentHeight;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 恢复底部位置:让原记录的“底部内容绝对位置”仍保持在视图底部
 | 
			
		||||
	 */
 | 
			
		||||
	private void restoreBottomPosition() {
 | 
			
		||||
		if (getChildCount() == 0) {
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 新的内容总高度
 | 
			
		||||
		int newContentHeight = getChildAt(0).getMeasuredHeight();
 | 
			
		||||
		// 新的视图可视高度
 | 
			
		||||
		int newScrollViewHeight = getMeasuredHeight();
 | 
			
		||||
 | 
			
		||||
		// 目标:让原mBottomContentY(底部内容绝对位置)仍位于视图底部
 | 
			
		||||
		// 此时需要的顶部滚动距离 = mBottomContentY - 新的可视高度
 | 
			
		||||
		int targetScrollY = mBottomContentY - newScrollViewHeight;
 | 
			
		||||
 | 
			
		||||
		// 边界修正:
 | 
			
		||||
		// 1. 不能小于0(避免滚动到负数位置)
 | 
			
		||||
		// 2. 不能大于“最大可滚动距离”(内容高度 - 可视高度,避免超出内容范围)
 | 
			
		||||
		int maxScrollY = Math.max(newContentHeight - newScrollViewHeight, 0);
 | 
			
		||||
		targetScrollY = Math.max(targetScrollY, 0);
 | 
			
		||||
		targetScrollY = Math.min(targetScrollY, maxScrollY);
 | 
			
		||||
 | 
			
		||||
		// 滚动到目标位置,保持底部内容位置不变
 | 
			
		||||
		smoothScrollTo(0, targetScrollY);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 外部手动设置底部内容绝对位置(可选)
 | 
			
		||||
	 */
 | 
			
		||||
	public void setBottomContentY(int bottomContentY) {
 | 
			
		||||
		if (getChildCount() == 0) {
 | 
			
		||||
			mBottomContentY = bottomContentY;
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		// 限制不超过内容总高度
 | 
			
		||||
		int contentHeight = getChildAt(0).getMeasuredHeight();
 | 
			
		||||
		mBottomContentY = Math.min(bottomContentY, contentHeight);
 | 
			
		||||
		restoreBottomPosition();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 获取当前底部内容绝对位置(可选)
 | 
			
		||||
	 */
 | 
			
		||||
	public int getBottomContentY() {
 | 
			
		||||
		return mBottomContentY;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
 | 
			
		||||
    <!-- 选中状态:深灰色背景(可根据需求调整颜色) -->
 | 
			
		||||
    <item android:state_selected="true" android:drawable="@color/list_item_selected"/>
 | 
			
		||||
    <!-- 按压状态:浅灰色背景 -->
 | 
			
		||||
    <item android:state_pressed="true" android:drawable="@color/list_item_pressed"/>
 | 
			
		||||
    <!-- 默认状态:透明背景 -->
 | 
			
		||||
    <item android:drawable="@android:color/transparent"/>
 | 
			
		||||
</selector>
 | 
			
		||||
@@ -1,112 +1,71 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout
 | 
			
		||||
    xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent">
 | 
			
		||||
	xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
	android:orientation="vertical"
 | 
			
		||||
	android:layout_width="match_parent"
 | 
			
		||||
	android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
    <cc.winboll.studio.libaes.views.AToolbar
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="@dimen/toolbar_height"
 | 
			
		||||
        android:id="@+id/activitycomposesmsASupportToolbar1"/>
 | 
			
		||||
	<cc.winboll.studio.libaes.views.AToolbar
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="@dimen/toolbar_height"
 | 
			
		||||
		android:id="@+id/activitycomposesmsASupportToolbar1"/>
 | 
			
		||||
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
        android:orientation="horizontal"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:background="@drawable/bg_frame">
 | 
			
		||||
	<LinearLayout
 | 
			
		||||
		android:orientation="horizontal"
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:background="@drawable/bg_frame">
 | 
			
		||||
 | 
			
		||||
        <RelativeLayout
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:id="@+id/activitycomposesmsRelativeLayout1">
 | 
			
		||||
		<RelativeLayout
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:id="@+id/activitycomposesmsRelativeLayout1">
 | 
			
		||||
 | 
			
		||||
            <LinearLayout
 | 
			
		||||
                android:orientation="horizontal"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:id="@+id/activitycomposesmsLinearLayout1"
 | 
			
		||||
                android:gravity="center_vertical"
 | 
			
		||||
                android:layout_alignParentRight="true"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:layout_marginLeft="10dp"
 | 
			
		||||
                android:layout_alignParentLeft="true">
 | 
			
		||||
			<TextView
 | 
			
		||||
				android:layout_width="wrap_content"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:text="SMS TO : "
 | 
			
		||||
				android:id="@+id/activitycomposesmsTextView1"
 | 
			
		||||
				android:layout_alignParentLeft="true"
 | 
			
		||||
				android:layout_marginLeft="10dp"
 | 
			
		||||
				android:layout_centerVertical="true"/>
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:text="(拼音搜索):"/>
 | 
			
		||||
			<EditText
 | 
			
		||||
				android:layout_toRightOf="@id/activitycomposesmsTextView1"
 | 
			
		||||
				android:layout_width="wrap_content"
 | 
			
		||||
				android:inputType="phone"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:ems="10"
 | 
			
		||||
				android:id="@+id/activitycomposesmsEditText1"
 | 
			
		||||
				android:layout_alignParentRight="true"
 | 
			
		||||
				android:layout_marginRight="10dp"
 | 
			
		||||
				android:layout_centerVertical="true"/>
 | 
			
		||||
 | 
			
		||||
                <EditText
 | 
			
		||||
                    android:layout_width="80dp"
 | 
			
		||||
                    android:ems="10"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:id="@+id/activitycomposesmsEditText2"/>
 | 
			
		||||
		</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:layout_alignParentTop="true"
 | 
			
		||||
                    android:layout_toRightOf="@id/activitycomposesmsEditText2"
 | 
			
		||||
                    android:id="@+id/activitycomposesmsTextView2"
 | 
			
		||||
                    android:layout_weight="1.0"/>
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
            </LinearLayout>
 | 
			
		||||
	<RelativeLayout
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="0dp"
 | 
			
		||||
		android:padding="10dp"
 | 
			
		||||
		android:layout_weight="1.0">
 | 
			
		||||
 | 
			
		||||
            <LinearLayout
 | 
			
		||||
                android:orientation="horizontal"
 | 
			
		||||
                android:layout_below="@id/activitycomposesmsLinearLayout1"
 | 
			
		||||
                android:layout_alignParentRight="true"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:layout_marginLeft="10dp"
 | 
			
		||||
                android:layout_alignParentLeft="true"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:gravity="center_vertical">
 | 
			
		||||
		<ListView
 | 
			
		||||
			android:layout_alignParentTop="true"
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:layout_above="@+id/activitycomposesmsinclude1"
 | 
			
		||||
			android:id="@+id/activitycomposesmsListView1"/>
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:text="(SMS TO) :"
 | 
			
		||||
                    android:id="@+id/activitycomposesmsTextView1"/>
 | 
			
		||||
		<include
 | 
			
		||||
			layout="@layout/view_smssend"
 | 
			
		||||
			android:layout_alignParentBottom="true"
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:id="@+id/activitycomposesmsinclude1"/>
 | 
			
		||||
 | 
			
		||||
                <EditText
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:inputType="phone"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:ems="10"
 | 
			
		||||
                    android:id="@+id/activitycomposesmsEditText1"/>
 | 
			
		||||
 | 
			
		||||
            </LinearLayout>
 | 
			
		||||
 | 
			
		||||
        </RelativeLayout>
 | 
			
		||||
 | 
			
		||||
    </LinearLayout>
 | 
			
		||||
 | 
			
		||||
    <RelativeLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="0dp"
 | 
			
		||||
        android:padding="10dp"
 | 
			
		||||
        android:layout_weight="1.0">
 | 
			
		||||
 | 
			
		||||
        <!-- 关键修改:添加 listSelector 属性,关联选中样式 -->
 | 
			
		||||
        <ListView
 | 
			
		||||
            android:layout_alignParentTop="true"
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:layout_above="@+id/activitycomposesmsinclude1"
 | 
			
		||||
            android:id="@+id/activitycomposesmsListView1"
 | 
			
		||||
            android:listSelector="@drawable/listview_item_selector"
 | 
			
		||||
            android:choiceMode="singleChoice"/> <!-- 开启单选模式,确保选中状态唯一 -->
 | 
			
		||||
 | 
			
		||||
        <include
 | 
			
		||||
            layout="@layout/view_smssend"
 | 
			
		||||
            android:layout_alignParentBottom="true"
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:id="@+id/activitycomposesmsinclude1"/>
 | 
			
		||||
 | 
			
		||||
    </RelativeLayout>
 | 
			
		||||
	</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="60dp"
 | 
			
		||||
			android:padding="10dp"
 | 
			
		||||
			android:text="@string/text_norulesreceivecontacts"
 | 
			
		||||
			android:text="@string/text_onlyreceivecontacts"
 | 
			
		||||
			android:id="@+id/activitymainSwitchView2"/>
 | 
			
		||||
 | 
			
		||||
		<cc.winboll.studio.mymessagemanager.views.ConfirmSwitchView
 | 
			
		||||
 
 | 
			
		||||
@@ -10,40 +10,36 @@
 | 
			
		||||
		android:layout_height="@dimen/toolbar_height"
 | 
			
		||||
		android:id="@+id/activitysmsASupportToolbar1"/>
 | 
			
		||||
 | 
			
		||||
	<ScrollView
 | 
			
		||||
	<RelativeLayout
 | 
			
		||||
		android:orientation="vertical"
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="0dp"
 | 
			
		||||
		android:layout_weight="1.0"
 | 
			
		||||
		android:id="@+id/activitysmsScrollView2">
 | 
			
		||||
		android:layout_height="match_parent"
 | 
			
		||||
		android:paddingBottom="10dp">
 | 
			
		||||
 | 
			
		||||
		<LinearLayout
 | 
			
		||||
			android:orientation="vertical"
 | 
			
		||||
		<ScrollView
 | 
			
		||||
			android:layout_alignParentTop="true"
 | 
			
		||||
			android:layout_above="@+id/activitysmsinclude1"
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="match_parent"
 | 
			
		||||
			android:id="@+id/activitysmsLinearLayout1">
 | 
			
		||||
			android:layout_height="0dp"
 | 
			
		||||
			android:id="@+id/activitysmsinphoneScrollView1"
 | 
			
		||||
			android:layout_weight="1.0"
 | 
			
		||||
			android:isScrollContainer="false">
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.mymessagemanager.views.BottomPositionFixedScrollView
 | 
			
		||||
				android:layout_width="match_parent"
 | 
			
		||||
				android:layout_height="520dp"
 | 
			
		||||
				android:isScrollContainer="false"
 | 
			
		||||
				android:id="@+id/activitysmsScrollView1">
 | 
			
		||||
 | 
			
		||||
				<cc.winboll.studio.mymessagemanager.views.SMSListViewForScrollView
 | 
			
		||||
					android:layout_width="match_parent"
 | 
			
		||||
					android:layout_height="wrap_content"
 | 
			
		||||
					android:id="@+id/activitysmsSMSListViewForScrollView1"/>
 | 
			
		||||
 | 
			
		||||
			</cc.winboll.studio.mymessagemanager.views.BottomPositionFixedScrollView>
 | 
			
		||||
 | 
			
		||||
			<include
 | 
			
		||||
				layout="@layout/view_smssend"
 | 
			
		||||
			<cc.winboll.studio.mymessagemanager.views.SMSListViewForScrollView
 | 
			
		||||
				android:layout_width="match_parent"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:id="@+id/activitysmsinclude1"/>
 | 
			
		||||
			
 | 
			
		||||
		</LinearLayout>
 | 
			
		||||
				android:id="@+id/activitysmsinphoneListView1"/>
 | 
			
		||||
 | 
			
		||||
	</ScrollView>
 | 
			
		||||
		</ScrollView>
 | 
			
		||||
 | 
			
		||||
		<include
 | 
			
		||||
			android:layout_alignParentBottom="true"
 | 
			
		||||
			layout="@layout/view_smssend"
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:id="@+id/activitysmsinclude1"/>
 | 
			
		||||
 | 
			
		||||
	</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
 | 
			
		||||
	</ScrollView>
 | 
			
		||||
 | 
			
		||||
	<cc.winboll.studio.libappbase.LogView
 | 
			
		||||
	<cc.winboll.studio.shared.log.LogView
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="0dp"
 | 
			
		||||
		android:layout_weight="1.0"
 | 
			
		||||
 
 | 
			
		||||
@@ -7,18 +7,6 @@
 | 
			
		||||
	android:layout_height="wrap_content"
 | 
			
		||||
	android:padding="10dp">
 | 
			
		||||
 | 
			
		||||
	<TextView
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:gravity="center"
 | 
			
		||||
		android:textSize="20sp"
 | 
			
		||||
		android:id="@+id/viewsmssendpart1TextView1"/>
 | 
			
		||||
	
 | 
			
		||||
	<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:id="@+id/viewsmssendpart1AOHPCTCSeekBar1"/>
 | 
			
		||||
 | 
			
		||||
	<EditText
 | 
			
		||||
        android:scrollbars="vertical"
 | 
			
		||||
        android:maxHeight="150dp"
 | 
			
		||||
@@ -29,6 +17,17 @@
 | 
			
		||||
		android:id="@+id/viewsmssendpart1EditText1"
 | 
			
		||||
		android:background="@drawable/bg_frame"/>
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
	<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:id="@+id/viewsmssendpart1AOHPCTCSeekBar1"/>
 | 
			
		||||
 | 
			
		||||
	<TextView
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:gravity="center"
 | 
			
		||||
		android:textSize="20sp"
 | 
			
		||||
		android:id="@+id/viewsmssendpart1TextView1"/>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,4 +17,26 @@
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_smsrule"
 | 
			
		||||
        android:title="@string/text_smsrule"/>
 | 
			
		||||
    <item android:title="@string/app_developoptions">
 | 
			
		||||
        <menu>
 | 
			
		||||
            <item
 | 
			
		||||
                android:id="@+id/app_log"
 | 
			
		||||
                android:title="@string/app_log"/>
 | 
			
		||||
            <item
 | 
			
		||||
                android:id="@+id/app_unittest"
 | 
			
		||||
                android:title="@string/app_unittest"/>
 | 
			
		||||
            <item
 | 
			
		||||
                android:id="@+id/app_crashtest"
 | 
			
		||||
                android:title="@string/app_crashtest"/>
 | 
			
		||||
        </menu>
 | 
			
		||||
    </item>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_appsettings"
 | 
			
		||||
        android:title="@string/text_appsettings"/>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_about"
 | 
			
		||||
        android:title="@string/app_about"/>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_smsrecycle"
 | 
			
		||||
        android:title="@string/app_smsrecycle"/>
 | 
			
		||||
</menu>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,26 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
	xmlns:app="http://schemas.android.com/apk/res-auto">
 | 
			
		||||
	<item android:title="@string/app_developoptions">
 | 
			
		||||
        <menu>
 | 
			
		||||
            <item
 | 
			
		||||
                android:id="@+id/app_log"
 | 
			
		||||
                android:title="@string/app_log"/>
 | 
			
		||||
            <item
 | 
			
		||||
                android:id="@+id/app_unittest"
 | 
			
		||||
                android:title="@string/app_unittest"/>
 | 
			
		||||
            <item
 | 
			
		||||
                android:id="@+id/app_crashtest"
 | 
			
		||||
                android:title="@string/app_crashtest"/>
 | 
			
		||||
        </menu>
 | 
			
		||||
    </item>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_appsettings"
 | 
			
		||||
        android:title="@string/text_appsettings"/>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_about"
 | 
			
		||||
        android:title="@string/app_about"/>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/app_smsrecycle"
 | 
			
		||||
        android:title="@string/app_smsrecycle"/>
 | 
			
		||||
</menu>
 | 
			
		||||
@@ -32,7 +32,7 @@
 | 
			
		||||
    <string name="text_item_rule_clean">清理设置</string>
 | 
			
		||||
    <string name="text_sendsms">发送短信</string>
 | 
			
		||||
    <string name="text_mainservice">短信服务管理总开关</string>
 | 
			
		||||
    <string name="text_norulesreceivecontacts">无限制接收联系人短信</string>
 | 
			
		||||
    <string name="text_onlyreceivecontacts">只接收联系人短信</string>
 | 
			
		||||
    <string name="text_usingtts">使用TTS语音播报</string>
 | 
			
		||||
    <string name="text_usingttsrule">使用TTS语音自定义规则</string>
 | 
			
		||||
    <string name="text_iamhere">短信管理服务已启动。</string>
 | 
			
		||||
@@ -41,6 +41,6 @@
 | 
			
		||||
    <string name="text_appsettings">应用设置</string>
 | 
			
		||||
    <string name="text_ttsplaydelaytimes">TTS播放延迟时间(秒):</string>
 | 
			
		||||
    <string name="msg_newsms">接收到新的消息。</string>
 | 
			
		||||
    <string name="msg_100sendmsg">>>>拉动到100%可发信息>>></string>
 | 
			
		||||
    <string name="msg_100applysettings">>>>拉动到100%可应用设置>>></string>
 | 
			
		||||
    <string name="msg_100sendmsg">>>>拉图标动到 100% 以发送信息。>>></string>
 | 
			
		||||
    <string name="msg_100applysettings">>>>拉图标动到 100% 应用设置。>>></string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,5 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<resources>
 | 
			
		||||
 | 
			
		||||
    <color name="white">#FFFFFFFF</color>
 | 
			
		||||
	
 | 
			
		||||
    <color name="colorSMSSendColor">#FFDCDA3D</color>
 | 
			
		||||
    <color name="colorSMSInboxColor">#FF3DDC84</color>
 | 
			
		||||
    <color name="colorTTSRuleViewBackgroundColor">#FFDCDA3D</color>
 | 
			
		||||
@@ -10,11 +7,11 @@
 | 
			
		||||
    <color name="colorSMSSendColorDepth">#FFA28BFF</color>
 | 
			
		||||
    <color name="colorSMSInboxColorDepth">#FF8BAEFF</color>
 | 
			
		||||
    <color name="colorTTSRuleViewBackgroundColorDepth">#FFA28BFF</color>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <color name="colorSMSSendColorSky">#FFFFEB8C</color>
 | 
			
		||||
    <color name="colorSMSInboxColorSky">#FF8CD9FF</color>
 | 
			
		||||
    <color name="colorTTSRuleViewBackgroundColorSky">#FFFFEB8C</color>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <color name="colorSMSSendColorGolden">#FF78BDFF</color>
 | 
			
		||||
    <color name="colorSMSInboxColorGolden">#FFFFED78</color>
 | 
			
		||||
    <color name="colorTTSRuleViewBackgroundColorGolden">#FF78BDFF</color>
 | 
			
		||||
@@ -22,13 +19,9 @@
 | 
			
		||||
    <color name="colorSMSSendColorMemor">#FF5AEB53</color>
 | 
			
		||||
    <color name="colorSMSInboxColorMemor">#FFE653EB</color>
 | 
			
		||||
    <color name="colorTTSRuleViewBackgroundColorMemor">#FF5AEB53</color>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <color name="colorSMSSendColorTao">#FFB4B4B4</color>
 | 
			
		||||
    <color name="colorSMSInboxColorTao">#FFD9D9D9</color>
 | 
			
		||||
    <color name="colorTTSRuleViewBackgroundColorTao">#FFB4B4B4</color>
 | 
			
		||||
 | 
			
		||||
    <!-- 列表项选中颜色(深灰) -->
 | 
			
		||||
    <color name="list_item_selected">#FF696969</color>
 | 
			
		||||
    <!-- 列表项按压颜色(浅灰) -->
 | 
			
		||||
    <color name="list_item_pressed">#FFE0E0E0</color>
 | 
			
		||||
    
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
    <string name="text_item_rule_clean">Clean Setting</string>
 | 
			
		||||
    <string name="text_sendsms">Send SMS</string>
 | 
			
		||||
    <string name="text_mainservice">Main Service</string>
 | 
			
		||||
    <string name="text_norulesreceivecontacts">No rules Receive Contacts</string>
 | 
			
		||||
    <string name="text_onlyreceivecontacts">Only Receive Contacts</string>
 | 
			
		||||
    <string name="text_usingtts">Using TTS</string>
 | 
			
		||||
    <string name="text_usingttsrule">Using TTS Rule</string>
 | 
			
		||||
    <string name="text_iamhere">The main service is start.</string>
 | 
			
		||||
 
 | 
			
		||||
@@ -45,9 +45,9 @@ android {
 | 
			
		||||
 | 
			
		||||
dependencies {
 | 
			
		||||
    api fileTree(dir: 'libs', include: ['*.jar'])
 | 
			
		||||
    api 'cc.winboll.studio:libaes:15.6.0'
 | 
			
		||||
    api 'cc.winboll.studio:libapputils:15.3.4'
 | 
			
		||||
    api 'cc.winboll.studio:libappbase:15.7.6'
 | 
			
		||||
    api 'cc.winboll.studio:libaes:15.9.1'
 | 
			
		||||
    api 'cc.winboll.studio:libapputils:15.8.4'
 | 
			
		||||
    api 'cc.winboll.studio:libappbase:15.8.4'
 | 
			
		||||
    
 | 
			
		||||
    // 吐司提示库
 | 
			
		||||
    api 'com.github.getActivity:ToastUtils:10.5'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Thu May 29 09:43:37 HKT 2025
 | 
			
		||||
stageCount=2
 | 
			
		||||
#Sun Jun 22 16:21:12 HKT 2025
 | 
			
		||||
stageCount=5
 | 
			
		||||
libraryProject=
 | 
			
		||||
baseVersion=15.4
 | 
			
		||||
publishVersion=15.4.1
 | 
			
		||||
publishVersion=15.4.4
 | 
			
		||||
buildCount=0
 | 
			
		||||
baseBetaVersion=15.4.2
 | 
			
		||||
baseBetaVersion=15.4.5
 | 
			
		||||
 
 | 
			
		||||
@@ -121,6 +121,8 @@
 | 
			
		||||
 | 
			
		||||
        <activity android:name="cc.winboll.studio.powerbell.activities.AboutActivity"/>
 | 
			
		||||
 | 
			
		||||
        <activity android:name="cc.winboll.studio.powerbell.activities.PixelPickerActivity"/>
 | 
			
		||||
 | 
			
		||||
    </application>
 | 
			
		||||
 | 
			
		||||
</manifest>
 | 
			
		||||
</manifest>
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
package cc.winboll.studio.powerbell;
 | 
			
		||||
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.os.Environment;
 | 
			
		||||
import android.view.Gravity;
 | 
			
		||||
import cc.winboll.studio.libappbase.GlobalApplication;
 | 
			
		||||
import cc.winboll.studio.powerbell.receivers.GlobalApplicationReceiver;
 | 
			
		||||
@@ -18,7 +19,7 @@ public class App extends GlobalApplication {
 | 
			
		||||
    static AppCacheUtils _mAppCacheUtils;
 | 
			
		||||
    GlobalApplicationReceiver mReceiver;
 | 
			
		||||
    static String szTempDir = "";
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    public static String getTempDirPath() {
 | 
			
		||||
        return szTempDir;
 | 
			
		||||
    }
 | 
			
		||||
@@ -26,15 +27,24 @@ public class App extends GlobalApplication {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onCreate() {
 | 
			
		||||
        super.onCreate();
 | 
			
		||||
 | 
			
		||||
        // 临时文件夹方案1
 | 
			
		||||
        // 获取Pictures文件夹路径(Android 10及以上推荐使用MediaStore,此处为传统方式)
 | 
			
		||||
        File picturesDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
 | 
			
		||||
        // 定义目标文件路径(在Pictures目录下创建"PowerBell"子文件夹及文件)
 | 
			
		||||
        File powerBellDir = new File(picturesDir, "PowerBell");
 | 
			
		||||
        
 | 
			
		||||
        // 初始化临时文件夹目录
 | 
			
		||||
        File fTempDir = new File(getExternalCacheDir(), "TempDir");
 | 
			
		||||
        if(!fTempDir.exists()) {
 | 
			
		||||
            fTempDir.mkdirs();
 | 
			
		||||
        // 临时文件夹方案2 <图片保存失败>
 | 
			
		||||
        // 获取Pictures文件夹路径(Android 10及以上推荐使用MediaStore,此处为传统方式)
 | 
			
		||||
        //File powerBellDir = getExternalFilesDir("TempDir");
 | 
			
		||||
 | 
			
		||||
        // 先创建文件夹(如果不存在)
 | 
			
		||||
        if (!powerBellDir.exists()) {
 | 
			
		||||
            powerBellDir.mkdirs();
 | 
			
		||||
        }
 | 
			
		||||
        szTempDir = fTempDir.getAbsolutePath();
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
        szTempDir = powerBellDir.getAbsolutePath();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // 初始化 Toast 框架
 | 
			
		||||
        ToastUtils.init(this);
 | 
			
		||||
        // 设置 Toast 布局样式
 | 
			
		||||
@@ -45,7 +55,7 @@ public class App extends GlobalApplication {
 | 
			
		||||
        // 设置数据配置存储工具
 | 
			
		||||
        _mAppConfigUtils = getAppConfigUtils(this);
 | 
			
		||||
        _mAppCacheUtils = getAppCacheUtils(this);
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        mReceiver = new GlobalApplicationReceiver(this);
 | 
			
		||||
        mReceiver.registerAction();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -10,23 +10,27 @@ import android.os.Bundle;
 | 
			
		||||
import android.provider.MediaStore;
 | 
			
		||||
import android.view.Menu;
 | 
			
		||||
import android.view.MenuItem;
 | 
			
		||||
import android.widget.RelativeLayout;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
import cc.winboll.studio.libaes.views.AToolbar;
 | 
			
		||||
import cc.winboll.studio.libappbase.LogUtils;
 | 
			
		||||
import cc.winboll.studio.libappbase.LogView;
 | 
			
		||||
import cc.winboll.studio.powerbell.MainActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.AboutActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.BackgroundPictureActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.BatteryReporterActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.ClearRecordActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.WinBoLLActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.beans.BackgroundPictureBean;
 | 
			
		||||
import cc.winboll.studio.powerbell.fragments.MainViewFragment;
 | 
			
		||||
import cc.winboll.studio.powerbell.utils.BackgroundPictureUtils;
 | 
			
		||||
 | 
			
		||||
public class MainActivity extends WinBoLLActivity {
 | 
			
		||||
 | 
			
		||||
public class MainActivity extends Activity {
 | 
			
		||||
    public static final String TAG = "MainActivity";
 | 
			
		||||
    public static final int BACKGROUND_PICTURE_REQUEST_CODE = 0;
 | 
			
		||||
 | 
			
		||||
    public static MainActivity _mMainActivity;
 | 
			
		||||
    LogView mLogView;
 | 
			
		||||
    //LogView mLogView;
 | 
			
		||||
    //ArrayList<Fragment> mlistFragment;
 | 
			
		||||
    App mApplication;
 | 
			
		||||
    //AppConfigUtils mAppConfigUtils;
 | 
			
		||||
@@ -35,6 +39,16 @@ public class MainActivity extends Activity {
 | 
			
		||||
    MainViewFragment mMainViewFragment;
 | 
			
		||||
    AToolbar mAToolbar;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Activity getActivity() {
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getTag() {
 | 
			
		||||
        return TAG;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        //LogUtils.d(TAG, "onCreate(...)");
 | 
			
		||||
@@ -42,10 +56,10 @@ public class MainActivity extends Activity {
 | 
			
		||||
        setContentView(R.layout.activity_main);
 | 
			
		||||
 | 
			
		||||
        // 设置调试日志
 | 
			
		||||
        mLogView = findViewById(R.id.logview);
 | 
			
		||||
        mLogView.start();
 | 
			
		||||
        //LogUtils.d(TAG, "LogView Start.");
 | 
			
		||||
        mLogView.updateLogView();
 | 
			
		||||
//        mLogView = findViewById(R.id.logview);
 | 
			
		||||
//        mLogView.start();
 | 
			
		||||
//        //LogUtils.d(TAG, "LogView Start.");
 | 
			
		||||
//        mLogView.updateLogView();
 | 
			
		||||
 | 
			
		||||
        _mMainActivity = MainActivity.this;
 | 
			
		||||
        mApplication = (App) getApplication();
 | 
			
		||||
@@ -117,8 +131,8 @@ public class MainActivity extends Activity {
 | 
			
		||||
        super.onResume();
 | 
			
		||||
        // 回到窗口自动取消提醒消息
 | 
			
		||||
        //NotificationHelper.cancelRemindNotification(this);
 | 
			
		||||
 | 
			
		||||
        reloadBackground();
 | 
			
		||||
		setBackgroundColor();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Menu icons are inflated just as they were with actionbar
 | 
			
		||||
@@ -157,6 +171,8 @@ public class MainActivity extends Activity {
 | 
			
		||||
            Intent intent = new Intent();
 | 
			
		||||
            intent.setClass(this, BackgroundPictureActivity.class);
 | 
			
		||||
            startActivity(intent);
 | 
			
		||||
        } else if (menuItemId == R.id.action_log) {
 | 
			
		||||
            App.getWinBoLLActivityManager().startLogActivity(this);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return true;
 | 
			
		||||
@@ -193,4 +209,12 @@ public class MainActivity extends Activity {
 | 
			
		||||
            moveTaskToBack(true);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	void setBackgroundColor() {
 | 
			
		||||
		BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(MainActivity.this);
 | 
			
		||||
		BackgroundPictureBean bean = utils.getBackgroundPictureBean();
 | 
			
		||||
		int nPixelColor = bean.getPixelColor();
 | 
			
		||||
		RelativeLayout mainLayout = findViewById(R.id.activitymainRelativeLayout1);
 | 
			
		||||
		mainLayout.setBackgroundColor(nPixelColor);
 | 
			
		||||
	}
 | 
			
		||||
} 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,26 @@
 | 
			
		||||
package cc.winboll.studio.powerbell.activities;
 | 
			
		||||
 | 
			
		||||
import android.Manifest;
 | 
			
		||||
import android.app.Activity;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.content.pm.PackageManager;
 | 
			
		||||
import android.graphics.Bitmap;
 | 
			
		||||
import android.graphics.BitmapFactory;
 | 
			
		||||
import android.graphics.drawable.Drawable;
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
import android.os.Build;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.provider.MediaStore;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.widget.ImageView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
import androidx.core.app.ActivityCompat;
 | 
			
		||||
import androidx.core.content.ContextCompat;
 | 
			
		||||
import cc.winboll.studio.libaes.views.AToolbar;
 | 
			
		||||
import cc.winboll.studio.libappbase.LogUtils;
 | 
			
		||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
 | 
			
		||||
import cc.winboll.studio.powerbell.App;
 | 
			
		||||
import cc.winboll.studio.powerbell.R;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.BackgroundPictureActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.beans.BackgroundPictureBean;
 | 
			
		||||
import cc.winboll.studio.powerbell.dialogs.BackgroundPicturePreviewDialog;
 | 
			
		||||
import cc.winboll.studio.powerbell.utils.BackgroundPictureUtils;
 | 
			
		||||
@@ -24,42 +28,37 @@ import cc.winboll.studio.powerbell.utils.FileUtils;
 | 
			
		||||
import cc.winboll.studio.powerbell.utils.UriUtil;
 | 
			
		||||
import java.io.BufferedOutputStream;
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.FileNotFoundException;
 | 
			
		||||
import java.io.FileOutputStream;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
import android.service.quickaccesswallet.GetWalletCardsError;
 | 
			
		||||
import android.widget.RelativeLayout;
 | 
			
		||||
 | 
			
		||||
public class BackgroundPictureActivity extends Activity
 | 
			
		||||
implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
public class BackgroundPictureActivity extends Activity implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "BackgroundPictureActivity";
 | 
			
		||||
 | 
			
		||||
    public BackgroundPictureUtils mBackgroundPictureUtils;
 | 
			
		||||
 | 
			
		||||
    // 图片选择请求
 | 
			
		||||
    // 图片选择请求码
 | 
			
		||||
    public static final int REQUEST_SELECT_PICTURE = 0;
 | 
			
		||||
    // 照相选择请求
 | 
			
		||||
    public static final int REQUEST_TAKE_PHOTO = 1;
 | 
			
		||||
    // 图片裁剪选择请求
 | 
			
		||||
    public static final int REQUEST_CROP_IMAGE = 2;
 | 
			
		||||
    private static final int STORAGE_PERMISSION_REQUEST = 100;
 | 
			
		||||
 | 
			
		||||
    AToolbar mAToolbar;
 | 
			
		||||
    // 所有图片存储的文件夹
 | 
			
		||||
    File mfBackgroundDir;
 | 
			
		||||
    // 拍照与剪裁的文件夹
 | 
			
		||||
    File mfPictureDir;
 | 
			
		||||
    // 拍照文件类
 | 
			
		||||
    File mfTakePhoto;
 | 
			
		||||
    // 接收到的图片文件类
 | 
			
		||||
    public File mfRecivedPicture;
 | 
			
		||||
    // 剪裁文件类
 | 
			
		||||
    File mfTempCropPicture;
 | 
			
		||||
    // 剪裁接收后的文件的文件名
 | 
			
		||||
    private AToolbar mAToolbar;
 | 
			
		||||
    private File mfBackgroundDir;       // 背景图片存储文件夹
 | 
			
		||||
    private File mfPictureDir;          // 拍照与剪裁临时文件夹
 | 
			
		||||
    private File mfTakePhoto;           // 拍照文件
 | 
			
		||||
    private File mfRecivedPicture;      // 接收的图片文件
 | 
			
		||||
    private File mfTempCropPicture;     // 剪裁临时文件
 | 
			
		||||
    private File mfRecivedCropPicture;  // 剪裁后的目标文件
 | 
			
		||||
 | 
			
		||||
    // 静态变量
 | 
			
		||||
    public static String _mszRecivedCropPicture = "RecivedCrop.jpg";
 | 
			
		||||
    File mfRecivedCropPicture;
 | 
			
		||||
    static String _mszCommonFileType = "jpeg";
 | 
			
		||||
    // 背景图片的压缩比
 | 
			
		||||
    int mnPictureCompress = 100;
 | 
			
		||||
    static String _RecivedPictureFileName;
 | 
			
		||||
    private static String _mszCommonFileType = "jpeg";
 | 
			
		||||
    private int mnPictureCompress = 100;
 | 
			
		||||
    private static String _RecivedPictureFileName;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
@@ -67,30 +66,29 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
        setContentView(R.layout.activity_backgroundpicture);
 | 
			
		||||
        initEnv();
 | 
			
		||||
 | 
			
		||||
        // 初始化工具类和文件夹
 | 
			
		||||
        mBackgroundPictureUtils = BackgroundPictureUtils.getInstance(this);
 | 
			
		||||
        mfBackgroundDir = new File(mBackgroundPictureUtils.getBackgroundDir());
 | 
			
		||||
        if (!mfBackgroundDir.exists()) {
 | 
			
		||||
            mfBackgroundDir.mkdirs();
 | 
			
		||||
        }
 | 
			
		||||
        //mfPictureDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), getString(R.string.app_projectname));
 | 
			
		||||
 | 
			
		||||
        mfPictureDir = new File(App.getTempDirPath());
 | 
			
		||||
        if (!mfPictureDir.exists()) {
 | 
			
		||||
            mfPictureDir.mkdirs();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 初始化文件对象
 | 
			
		||||
        mfTakePhoto = new File(mfPictureDir, "TakePhoto.jpg");
 | 
			
		||||
        mfTempCropPicture = new File(mfPictureDir, "TempCrop.jpg");
 | 
			
		||||
 | 
			
		||||
        mfRecivedPicture = getRecivedPictureFile(this);
 | 
			
		||||
        mfRecivedCropPicture = new File(mfBackgroundDir, _mszRecivedCropPicture);
 | 
			
		||||
 | 
			
		||||
        // 初始化工具栏
 | 
			
		||||
        mAToolbar = (AToolbar) findViewById(R.id.toolbar);
 | 
			
		||||
        setActionBar(mAToolbar);
 | 
			
		||||
        //mAToolbar.setTitle(getTitle() + "-" + getString(R.string.subtitle_activity_backgroundpicture));
 | 
			
		||||
        mAToolbar.setSubtitle(R.string.subtitle_activity_backgroundpicture);
 | 
			
		||||
        //mAToolbar.setTitleTextAppearance(this, R.style.Toolbar_TitleText);
 | 
			
		||||
        //mAToolbar.setSubtitleTextAppearance(this, R.style.Toolbar_SubTitleText);
 | 
			
		||||
        //mAToolbar.setBackgroundColor(getColor(R.color.colorPrimary));
 | 
			
		||||
        setActionBar(mAToolbar);
 | 
			
		||||
        getActionBar().setDisplayHomeAsUpEnabled(true);
 | 
			
		||||
        mAToolbar.setNavigationOnClickListener(new View.OnClickListener() {
 | 
			
		||||
                @Override
 | 
			
		||||
@@ -99,41 +97,30 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        //给按钮设置点击事件
 | 
			
		||||
        // 设置按钮点击事件
 | 
			
		||||
        findViewById(R.id.activitybackgroundpictureAButton5).setOnClickListener(onOriginNullClickListener);
 | 
			
		||||
        findViewById(R.id.activitybackgroundpictureAButton4).setOnClickListener(onReceivedPictureClickListener);
 | 
			
		||||
        findViewById(R.id.activitybackgroundpictureAButton1).setOnClickListener(onTakePhotoClickListener);
 | 
			
		||||
        findViewById(R.id.activitybackgroundpictureAButton2).setOnClickListener(onSelectPictureClickListener);
 | 
			
		||||
        findViewById(R.id.activitybackgroundpictureAButton3).setOnClickListener(onCropPictureClickListener);
 | 
			
		||||
        findViewById(R.id.activitybackgroundpictureAButton6).setOnClickListener(onCropFreePictureClickListener);
 | 
			
		||||
 | 
			
		||||
		findViewById(R.id.activitybackgroundpictureAButton7).setOnClickListener(onPixelPickerClickListener);
 | 
			
		||||
		findViewById(R.id.activitybackgroundpictureAButton8).setOnClickListener(onCleanPixelClickListener);
 | 
			
		||||
		
 | 
			
		||||
        updatePreviewBackground();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // 判断并且处理应用分享到的文件
 | 
			
		||||
        //
 | 
			
		||||
        //ToastUtils.show("Activity Opened.");
 | 
			
		||||
 | 
			
		||||
        // 预备接收参数
 | 
			
		||||
        // 处理分享的图片
 | 
			
		||||
        Intent intent = getIntent();
 | 
			
		||||
        String action = intent.getAction();
 | 
			
		||||
        String type = intent.getType();
 | 
			
		||||
 | 
			
		||||
        //LogUtils.d(TAG, "action : " + action);
 | 
			
		||||
        //LogUtils.d(TAG, "type : " + type);
 | 
			
		||||
 | 
			
		||||
        // 判断是否进入图片分享状态
 | 
			
		||||
        if (Intent.ACTION_SEND.equals(action)
 | 
			
		||||
            && type != null
 | 
			
		||||
            && ("image/*".equals(type) || "image/jpeg".equals(type) || "image/jpg".equals(type) || "image/png".equals(type) || "image/webp".equals(type))) {
 | 
			
		||||
            // 预览图片
 | 
			
		||||
            BackgroundPicturePreviewDialog dlg= new BackgroundPicturePreviewDialog(this);
 | 
			
		||||
        if (Intent.ACTION_SEND.equals(action) && type != null && isImageType(type)) {
 | 
			
		||||
            BackgroundPicturePreviewDialog dlg = new BackgroundPicturePreviewDialog(this);
 | 
			
		||||
            dlg.show();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void initEnv() {
 | 
			
		||||
    private void initEnv() {
 | 
			
		||||
        LogUtils.d(TAG, "initEnv()");
 | 
			
		||||
        _RecivedPictureFileName = "Recived.data";
 | 
			
		||||
    }
 | 
			
		||||
@@ -144,47 +131,55 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onAcceptRecivedPicture(String szPreRecivedPictureName) {
 | 
			
		||||
        //ToastUtils.show("onAcceptRecivedPicture");
 | 
			
		||||
        BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(this);
 | 
			
		||||
        utils.getBackgroundPictureBean().setIsUseBackgroundFile(true);
 | 
			
		||||
        utils.saveData();
 | 
			
		||||
        File fPreRecivedPictureName = new File(utils.getBackgroundDir(), szPreRecivedPictureName);
 | 
			
		||||
        FileUtils.copyFile(fPreRecivedPictureName, mfRecivedPicture);
 | 
			
		||||
        // 加载背景
 | 
			
		||||
        startCropImageActivity(false);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // 更新预览背景
 | 
			
		||||
    //
 | 
			
		||||
    public void updatePreviewBackground() {
 | 
			
		||||
        LogUtils.d(TAG, "updatePreviewBackground");
 | 
			
		||||
        ImageView ivPreviewBackground = findViewById(R.id.activitybackgroundpictureImageView1);
 | 
			
		||||
        BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(this);
 | 
			
		||||
        utils.loadBackgroundPictureBean();
 | 
			
		||||
        boolean isUseBackgroundFile = utils.getBackgroundPictureBean().isUseBackgroundFile();
 | 
			
		||||
        if (isUseBackgroundFile && mfRecivedCropPicture.exists()) {
 | 
			
		||||
            try {
 | 
			
		||||
                String szBackgroundFilePath = utils.getBackgroundDir() + getBackgroundFileName();
 | 
			
		||||
                Drawable drawableBackground = FileUtils.getImageDrawable(szBackgroundFilePath);
 | 
			
		||||
                drawableBackground.setAlpha(120);
 | 
			
		||||
                ivPreviewBackground.setImageDrawable(drawableBackground);
 | 
			
		||||
                ToastUtils.show("Use acceptRecived background.");
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
            }
 | 
			
		||||
        File sourceFile = new File(utils.getBackgroundDir(), szPreRecivedPictureName);
 | 
			
		||||
        if (FileUtils.copyFile(sourceFile, mfRecivedPicture)) {
 | 
			
		||||
            startCropImageActivity(false);
 | 
			
		||||
        } else {
 | 
			
		||||
            ToastUtils.show(" No background.");
 | 
			
		||||
            Drawable drawableBackground = getDrawable(R.drawable.blank10x10);
 | 
			
		||||
            drawableBackground.setAlpha(120);
 | 
			
		||||
            ivPreviewBackground.setImageDrawable(drawableBackground);
 | 
			
		||||
            ToastUtils.show("图片复制失败,请重试");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 更新背景图片预览
 | 
			
		||||
     */
 | 
			
		||||
    public void updatePreviewBackground() {
 | 
			
		||||
        LogUtils.d(TAG, "updatePreviewBackground");
 | 
			
		||||
        ImageView ivPreviewBackground = (ImageView) findViewById(R.id.activitybackgroundpictureImageView1);
 | 
			
		||||
        BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(this);
 | 
			
		||||
        utils.loadBackgroundPictureBean();
 | 
			
		||||
 | 
			
		||||
        boolean isUseBackgroundFile = utils.getBackgroundPictureBean().isUseBackgroundFile();
 | 
			
		||||
        if (isUseBackgroundFile && mfRecivedCropPicture.exists()) {
 | 
			
		||||
            try {
 | 
			
		||||
                String filePath = utils.getBackgroundDir() + getBackgroundFileName();
 | 
			
		||||
                Drawable drawable = FileUtils.getImageDrawable(filePath);
 | 
			
		||||
                if (drawable != null) {
 | 
			
		||||
                    //drawable.setAlpha(120);
 | 
			
		||||
                    ivPreviewBackground.setImageDrawable(drawable);
 | 
			
		||||
                }
 | 
			
		||||
                ToastUtils.show("背景图片已更新");
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
                ToastUtils.show("背景图片加载失败");
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            ToastUtils.show("未使用背景图片");
 | 
			
		||||
            Drawable drawable = getResources().getDrawable(R.drawable.blank10x10);
 | 
			
		||||
            if (drawable != null) {
 | 
			
		||||
                drawable.setAlpha(120);
 | 
			
		||||
                ivPreviewBackground.setImageDrawable(drawable);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 点击事件监听器
 | 
			
		||||
    private View.OnClickListener onOriginNullClickListener = new View.OnClickListener() {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onClick(View v) {
 | 
			
		||||
            // 选择原始空白背景
 | 
			
		||||
            BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(BackgroundPictureActivity.this);
 | 
			
		||||
            BackgroundPictureBean bean = utils.getBackgroundPictureBean();
 | 
			
		||||
            bean.setIsUseBackgroundFile(false);
 | 
			
		||||
@@ -196,11 +191,10 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
    private View.OnClickListener onSelectPictureClickListener = new View.OnClickListener() {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onClick(View v) {
 | 
			
		||||
            // 导入外部图片
 | 
			
		||||
            Intent intent = new Intent(
 | 
			
		||||
                Intent.ACTION_PICK,
 | 
			
		||||
                android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
 | 
			
		||||
            startActivityForResult(intent, REQUEST_SELECT_PICTURE);
 | 
			
		||||
            if (checkAndRequestStoragePermission()) {
 | 
			
		||||
                Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
 | 
			
		||||
                startActivityForResult(intent, REQUEST_SELECT_PICTURE);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
@@ -211,7 +205,7 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
            if (fCheck.exists()) {
 | 
			
		||||
                startCropImageActivity(false);
 | 
			
		||||
            } else {
 | 
			
		||||
                ToastUtils.show("There is not any picture to crop.");
 | 
			
		||||
                ToastUtils.show("没有可剪裁的图片");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
@@ -223,7 +217,7 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
            if (fCheck.exists()) {
 | 
			
		||||
                startCropImageActivity(true);
 | 
			
		||||
            } else {
 | 
			
		||||
                ToastUtils.show("There is not any picture to crop.");
 | 
			
		||||
                ToastUtils.show("没有可剪裁的图片");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
@@ -233,6 +227,7 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
        public void onClick(View v) {
 | 
			
		||||
            LogUtils.d(TAG, "onTakePhotoClickListener");
 | 
			
		||||
            LogUtils.d(TAG, "mfTakePhoto : " + mfTakePhoto.getPath());
 | 
			
		||||
 | 
			
		||||
            if (mfTakePhoto.exists()) {
 | 
			
		||||
                mfTakePhoto.delete();
 | 
			
		||||
            }
 | 
			
		||||
@@ -240,56 +235,94 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
                mfTakePhoto.createNewFile();
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
                ToastUtils.show("拍照文件创建失败");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (checkAndRequestStoragePermission()) {
 | 
			
		||||
                Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
 | 
			
		||||
                startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
 | 
			
		||||
            }
 | 
			
		||||
            Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
 | 
			
		||||
            startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    private View.OnClickListener onReceivedPictureClickListener = new View.OnClickListener() {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onClick(View v) {
 | 
			
		||||
            // 选择接收到的背景图片
 | 
			
		||||
            BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(BackgroundPictureActivity.this);
 | 
			
		||||
			utils.getBackgroundPictureBean().setIsUseBackgroundFile(true);
 | 
			
		||||
            utils.getBackgroundPictureBean().setIsUseBackgroundFile(true);
 | 
			
		||||
            utils.saveData();
 | 
			
		||||
            updatePreviewBackground();
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
	
 | 
			
		||||
	private View.OnClickListener onPixelPickerClickListener = new View.OnClickListener() {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onClick(View v) {
 | 
			
		||||
			// 从文件路径启动像素拾取活动
 | 
			
		||||
			//String imagePath = "/storage/emulated/0/DCIM/Camera/sample.jpg";
 | 
			
		||||
			String imagePath = mfRecivedCropPicture.toString();
 | 
			
		||||
			Intent intent = new Intent(getApplicationContext(), PixelPickerActivity.class);
 | 
			
		||||
			intent.putExtra("imagePath", imagePath);
 | 
			
		||||
			//startActivity(intent);
 | 
			
		||||
            App.getWinBoLLActivityManager().startWinBoLLActivity(getApplicationContext(), intent, PixelPickerActivity.class);
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
	
 | 
			
		||||
	private View.OnClickListener onCleanPixelClickListener = new View.OnClickListener() {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onClick(View v) {
 | 
			
		||||
			BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(BackgroundPictureActivity.this);
 | 
			
		||||
			BackgroundPictureBean bean = utils.getBackgroundPictureBean();
 | 
			
		||||
			bean.setPixelColor(0);
 | 
			
		||||
			utils.saveData();
 | 
			
		||||
			setBackgroundColor();
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 压缩图片并保存到接收文件
 | 
			
		||||
     */
 | 
			
		||||
    void compressQualityToRecivedPicture(Bitmap bitmap) {
 | 
			
		||||
        // 设置输出流
 | 
			
		||||
        OutputStream outStream = null;
 | 
			
		||||
        try {
 | 
			
		||||
            // 创建输出流对象,准备写入压缩后的图片文件
 | 
			
		||||
            mfRecivedPicture = getRecivedPictureFile(this);
 | 
			
		||||
            // 创建新的接收文件
 | 
			
		||||
            if (!mfRecivedPicture.exists()) {
 | 
			
		||||
                mfRecivedPicture.createNewFile();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            FileOutputStream fos = new FileOutputStream(mfRecivedPicture);
 | 
			
		||||
 | 
			
		||||
            // 获取输出流对象
 | 
			
		||||
            outStream = new BufferedOutputStream(fos);
 | 
			
		||||
 | 
			
		||||
            // 使用默认的质量参数压缩图片
 | 
			
		||||
            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outStream); // 70% 的质量
 | 
			
		||||
 | 
			
		||||
            // 关闭输出流以完成文件操作
 | 
			
		||||
            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outStream);
 | 
			
		||||
            outStream.flush();
 | 
			
		||||
            outStream.close();
 | 
			
		||||
        } catch (IOException e) {
 | 
			
		||||
            LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
            ToastUtils.show("图片压缩失败");
 | 
			
		||||
        } finally {
 | 
			
		||||
            if (outStream != null) {
 | 
			
		||||
                try {
 | 
			
		||||
                    outStream.close();
 | 
			
		||||
                } catch (IOException e) {
 | 
			
		||||
                    LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (bitmap != null && !bitmap.isRecycled()) {
 | 
			
		||||
                bitmap.recycle();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 启动图片裁剪活动
 | 
			
		||||
     * @param isCropFree 是否自由裁剪
 | 
			
		||||
     */
 | 
			
		||||
    public void startCropImageActivity(boolean isCropFree) {
 | 
			
		||||
        LogUtils.d(TAG, "startCropImageActivity");
 | 
			
		||||
        BackgroundPictureBean bean = mBackgroundPictureUtils.loadBackgroundPictureBean();
 | 
			
		||||
        mfRecivedPicture = getRecivedPictureFile(this);
 | 
			
		||||
        Uri uri = UriUtil.getUriForFile(this, mfRecivedPicture);
 | 
			
		||||
        LogUtils.d(TAG, "uri : " + uri.toString());
 | 
			
		||||
 | 
			
		||||
        if (mfTempCropPicture.exists()) {
 | 
			
		||||
            mfTempCropPicture.delete();
 | 
			
		||||
        }
 | 
			
		||||
@@ -297,27 +330,24 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
            mfTempCropPicture.createNewFile();
 | 
			
		||||
        } catch (IOException e) {
 | 
			
		||||
            LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
            ToastUtils.show("剪裁临时文件创建失败");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        // 使用正确的文件路径构建 Uri
 | 
			
		||||
 | 
			
		||||
        Uri cropOutPutUri = Uri.fromFile(mfTempCropPicture);
 | 
			
		||||
        LogUtils.d(TAG, "mfTempCropPicture : " + mfTempCropPicture.getPath());
 | 
			
		||||
 | 
			
		||||
        Intent intent = new Intent("com.android.camera.action.CROP");
 | 
			
		||||
        intent.setDataAndType(uri, "image/" + _mszCommonFileType);
 | 
			
		||||
        // 下面这个crop=true是设置在开启的Intent中设置显示的VIEW可裁剪
 | 
			
		||||
        intent.putExtra("crop", "true");
 | 
			
		||||
        intent.putExtra("noFaceDetection", true);
 | 
			
		||||
 | 
			
		||||
        if (!isCropFree) {
 | 
			
		||||
            // aspectX aspectY 是宽高的比例
 | 
			
		||||
            intent.putExtra("aspectX", bean.getBackgroundWidth());
 | 
			
		||||
            intent.putExtra("aspectY", bean.getBackgroundHeight());
 | 
			
		||||
        }
 | 
			
		||||
        // outputX outputY 是裁剪图片宽高
 | 
			
		||||
        //intent.putExtra("outputX", 100);
 | 
			
		||||
        //intent.putExtra("outputY", 100);
 | 
			
		||||
        //return-data =false 意味着裁剪成功后不能在onActivityResult 的intent 中获得图片
 | 
			
		||||
        //intent.putExtra("return-data", false);
 | 
			
		||||
 | 
			
		||||
        intent.putExtra("return-data", true);
 | 
			
		||||
        //裁剪后的图片输出至  cropOutPutUri
 | 
			
		||||
        intent.putExtra(MediaStore.EXTRA_OUTPUT, cropOutPutUri);
 | 
			
		||||
        intent.putExtra("scale", true);
 | 
			
		||||
        intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
 | 
			
		||||
@@ -325,13 +355,102 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
        startActivityForResult(intent, REQUEST_CROP_IMAGE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 启动裁剪窗口,裁剪操作文件为 uirImage
 | 
			
		||||
    //
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存剪裁后的Bitmap(优化版)
 | 
			
		||||
     */
 | 
			
		||||
    private void saveCropBitmap(Bitmap bitmap) {
 | 
			
		||||
        if (bitmap == null) {
 | 
			
		||||
            ToastUtils.show("剪裁图片为空");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 内存优化:大图片自动缩放
 | 
			
		||||
        Bitmap scaledBitmap = bitmap;
 | 
			
		||||
        if (bitmap.getByteCount() > 10 * 1024 * 1024) { // 超过10MB
 | 
			
		||||
            float scale = 1.0f;
 | 
			
		||||
            while (scaledBitmap.getByteCount() > 5 * 1024 * 1024) {
 | 
			
		||||
                scale -= 0.2f; // 每次缩小20%
 | 
			
		||||
                if (scale < 0.2f) break; // 最小缩放到20%
 | 
			
		||||
                scaledBitmap = scaleBitmap(scaledBitmap, scale);
 | 
			
		||||
            }
 | 
			
		||||
            if (scaledBitmap != bitmap) {
 | 
			
		||||
                bitmap.recycle(); // 回收原Bitmap
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 优化:创建保存目录
 | 
			
		||||
        File backgroundDir = new File(mBackgroundPictureUtils.getBackgroundDir());
 | 
			
		||||
        if (!backgroundDir.exists()) {
 | 
			
		||||
            if (!backgroundDir.mkdirs()) {
 | 
			
		||||
                ToastUtils.show("无法创建保存目录");
 | 
			
		||||
                if (scaledBitmap != bitmap) scaledBitmap.recycle();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        File saveFile = new File(backgroundDir, getBackgroundFileName());
 | 
			
		||||
 | 
			
		||||
        // 优化:检查文件是否可写
 | 
			
		||||
        if (saveFile.exists() && !saveFile.canWrite()) {
 | 
			
		||||
            if (!saveFile.delete()) {
 | 
			
		||||
                ToastUtils.show("无法删除旧文件");
 | 
			
		||||
                if (scaledBitmap != bitmap) scaledBitmap.recycle();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        FileOutputStream fos = null;
 | 
			
		||||
        try {
 | 
			
		||||
            fos = new FileOutputStream(saveFile);
 | 
			
		||||
            boolean success = scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 80, fos);
 | 
			
		||||
            fos.flush();
 | 
			
		||||
            if (success) {
 | 
			
		||||
                ToastUtils.show("保存成功");
 | 
			
		||||
                // 更新数据
 | 
			
		||||
                mBackgroundPictureUtils.getBackgroundPictureBean().setIsUseBackgroundFile(true);
 | 
			
		||||
                updatePreviewBackground();
 | 
			
		||||
            } else {
 | 
			
		||||
                ToastUtils.show("图片压缩保存失败");
 | 
			
		||||
            }
 | 
			
		||||
        } catch (FileNotFoundException e) {
 | 
			
		||||
            LogUtils.e(TAG, "文件未找到" + e);
 | 
			
		||||
            ToastUtils.show("保存失败:文件路径错误");
 | 
			
		||||
        } catch (IOException e) {
 | 
			
		||||
            LogUtils.e(TAG, "写入异常" + e);
 | 
			
		||||
            ToastUtils.show("保存失败:磁盘可能已满或路径错误");
 | 
			
		||||
        } finally {
 | 
			
		||||
            if (fos != null) {
 | 
			
		||||
                try {
 | 
			
		||||
                    fos.close();
 | 
			
		||||
                } catch (IOException e) {
 | 
			
		||||
                    LogUtils.e(TAG, "流关闭异常" + e);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (scaledBitmap != null && !scaledBitmap.isRecycled()) {
 | 
			
		||||
                scaledBitmap.recycle();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缩放Bitmap
 | 
			
		||||
     */
 | 
			
		||||
    private Bitmap scaleBitmap(Bitmap original, float scale) {
 | 
			
		||||
        if (original == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        int width = (int) (original.getWidth() * scale);
 | 
			
		||||
        int height = (int) (original.getHeight() * scale);
 | 
			
		||||
        return Bitmap.createScaledBitmap(original, width, height, true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分享图片
 | 
			
		||||
     */
 | 
			
		||||
    void sharePicture() {
 | 
			
		||||
        Uri uri = UriUtil.getUriForFile(this, mfRecivedPicture);
 | 
			
		||||
        Intent shareIntent = new Intent();    
 | 
			
		||||
        shareIntent.setAction(Intent.ACTION_SEND);    
 | 
			
		||||
        shareIntent.putExtra(Intent.EXTRA_STREAM, uri);    
 | 
			
		||||
        Intent shareIntent = new Intent(Intent.ACTION_SEND);
 | 
			
		||||
        shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
 | 
			
		||||
        shareIntent.setType("image/" + _mszCommonFileType);
 | 
			
		||||
        shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
 | 
			
		||||
        startActivity(Intent.createChooser(shareIntent, "Share Image"));
 | 
			
		||||
@@ -345,45 +464,121 @@ implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
 | 
			
		||||
 | 
			
		||||
        super.onActivityResult(requestCode, resultCode, data);
 | 
			
		||||
        if (requestCode == REQUEST_SELECT_PICTURE) {
 | 
			
		||||
            // 处理选择后图片
 | 
			
		||||
            if (resultCode == RESULT_OK) {
 | 
			
		||||
                try {
 | 
			
		||||
                    Uri selectedImage = data.getData(); 
 | 
			
		||||
                    LogUtils.d(TAG, "Uri is : " + selectedImage.toString());
 | 
			
		||||
                    File fSrcImage = new File(UriUtil.getFilePathFromUri(this, selectedImage));
 | 
			
		||||
                    mfRecivedPicture = getRecivedPictureFile(this);
 | 
			
		||||
 | 
			
		||||
                    FileUtils.copyFile(fSrcImage, mfRecivedPicture);
 | 
			
		||||
                    // 启动剪裁文件窗口
 | 
			
		||||
        if (requestCode == REQUEST_SELECT_PICTURE && resultCode == RESULT_OK) {
 | 
			
		||||
            try {
 | 
			
		||||
                Uri selectedImage = data.getData();
 | 
			
		||||
                LogUtils.d(TAG, "Uri is : " + selectedImage.toString());
 | 
			
		||||
                File fSrcImage = new File(UriUtil.getFilePathFromUri(this, selectedImage));
 | 
			
		||||
                mfRecivedPicture = getRecivedPictureFile(this);
 | 
			
		||||
                if (FileUtils.copyFile(fSrcImage, mfRecivedPicture)) {
 | 
			
		||||
                    startCropImageActivity(false);
 | 
			
		||||
                } catch (Exception e) {
 | 
			
		||||
                    LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
                } else {
 | 
			
		||||
                    ToastUtils.show("图片复制失败,请重试");
 | 
			
		||||
                }
 | 
			
		||||
            } catch (Exception e) {
 | 
			
		||||
                LogUtils.e(TAG, "选择图片异常" + e);
 | 
			
		||||
                ToastUtils.show("选择图片失败:" + e.getMessage());
 | 
			
		||||
            }
 | 
			
		||||
        } else if (requestCode == REQUEST_TAKE_PHOTO) {
 | 
			
		||||
            if (resultCode == RESULT_OK) {
 | 
			
		||||
                LogUtils.d(TAG, "REQUEST_TAKE_PHOTO");
 | 
			
		||||
                Bundle extras = data.getExtras();
 | 
			
		||||
        } else if (requestCode == REQUEST_TAKE_PHOTO && resultCode == RESULT_OK) {
 | 
			
		||||
            LogUtils.d(TAG, "REQUEST_TAKE_PHOTO");
 | 
			
		||||
            Bundle extras = data.getExtras();
 | 
			
		||||
            if (extras != null) {
 | 
			
		||||
                Bitmap imageBitmap = (Bitmap) extras.get("data");
 | 
			
		||||
                compressQualityToRecivedPicture(imageBitmap);
 | 
			
		||||
                startCropImageActivity(false);
 | 
			
		||||
            }
 | 
			
		||||
        } else if (requestCode == REQUEST_CROP_IMAGE) {
 | 
			
		||||
            if (resultCode == RESULT_OK) {
 | 
			
		||||
                LogUtils.d(TAG, "CROP_IMAGE_REQUEST_CODE");
 | 
			
		||||
                FileUtils.copyFile(mfTempCropPicture, mfRecivedCropPicture);
 | 
			
		||||
                mfTempCropPicture.delete();
 | 
			
		||||
                mBackgroundPictureUtils.getBackgroundPictureBean().setIsUseBackgroundFile(true);
 | 
			
		||||
                updatePreviewBackground();
 | 
			
		||||
                if (imageBitmap != null) {
 | 
			
		||||
                    compressQualityToRecivedPicture(imageBitmap);
 | 
			
		||||
                    startCropImageActivity(false);
 | 
			
		||||
                } else {
 | 
			
		||||
                    ToastUtils.show("拍照图片为空");
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                ToastUtils.show("拍照数据获取失败");
 | 
			
		||||
            }
 | 
			
		||||
        } else if (requestCode == REQUEST_CROP_IMAGE && resultCode == RESULT_OK) {
 | 
			
		||||
            LogUtils.d(TAG, "CROP_IMAGE_REQUEST_CODE");
 | 
			
		||||
            try {
 | 
			
		||||
                Bitmap cropBitmap = null;
 | 
			
		||||
                // 方案1:通过Intent获取剪裁后的Bitmap
 | 
			
		||||
                if (data != null && data.hasExtra("data")) {
 | 
			
		||||
                    cropBitmap = data.getParcelableExtra("data");
 | 
			
		||||
                } else if (mfTempCropPicture.exists()) {
 | 
			
		||||
                    cropBitmap = BitmapFactory.decodeFile(mfTempCropPicture.getPath());
 | 
			
		||||
                } else {
 | 
			
		||||
                    ToastUtils.show("剪裁文件不存在");
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
        } else {
 | 
			
		||||
            String sz = "Unsolved requestCode = " + Integer.toString(requestCode);
 | 
			
		||||
            Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
 | 
			
		||||
            LogUtils.d(TAG, sz);
 | 
			
		||||
                if (cropBitmap != null) {
 | 
			
		||||
                    saveCropBitmap(cropBitmap);
 | 
			
		||||
                } else {
 | 
			
		||||
                    ToastUtils.show("获取剪裁图片失败");
 | 
			
		||||
                }
 | 
			
		||||
            } catch (OutOfMemoryError e) {
 | 
			
		||||
                LogUtils.e(TAG, "内存溢出" + e);
 | 
			
		||||
                ToastUtils.show("保存失败:内存不足,请尝试裁剪更小的图片");
 | 
			
		||||
            } catch (Exception e) {
 | 
			
		||||
                LogUtils.e(TAG, "剪裁保存异常" + e);
 | 
			
		||||
                ToastUtils.show("保存失败:" + e.getMessage());
 | 
			
		||||
            }/* finally {
 | 
			
		||||
                // 安全删除临时文件
 | 
			
		||||
                if (mfTempCropPicture.exists()) {
 | 
			
		||||
                    mfTempCropPicture.delete();
 | 
			
		||||
                }
 | 
			
		||||
            }*/
 | 
			
		||||
        } else if (resultCode != RESULT_OK) {
 | 
			
		||||
            LogUtils.d(TAG, "操作取消或失败,requestCode: " + requestCode);
 | 
			
		||||
            ToastUtils.show("操作已取消");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 检查类型是否为图片
 | 
			
		||||
     */
 | 
			
		||||
    private boolean isImageType(String type) {
 | 
			
		||||
        return type.startsWith("image/") || "image/jpeg".equals(type) || 
 | 
			
		||||
            "image/jpg".equals(type) || "image/png".equals(type) || 
 | 
			
		||||
            "image/webp".equals(type);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 检查并申请存储权限
 | 
			
		||||
     */
 | 
			
		||||
    private boolean checkAndRequestStoragePermission() {
 | 
			
		||||
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
 | 
			
		||||
            if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
 | 
			
		||||
                ActivityCompat.requestPermissions(this, 
 | 
			
		||||
                                                  new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 
 | 
			
		||||
                                                  STORAGE_PERMISSION_REQUEST);
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
 | 
			
		||||
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
 | 
			
		||||
        if (requestCode == STORAGE_PERMISSION_REQUEST) {
 | 
			
		||||
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
 | 
			
		||||
                ToastUtils.show("存储权限已获取");
 | 
			
		||||
            } else {
 | 
			
		||||
                ToastUtils.show("需要存储权限才能保存图片");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
	
 | 
			
		||||
	void setBackgroundColor() {
 | 
			
		||||
		BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(BackgroundPictureActivity.this);
 | 
			
		||||
		BackgroundPictureBean bean = utils.getBackgroundPictureBean();
 | 
			
		||||
		int nPixelColor = bean.getPixelColor();
 | 
			
		||||
		RelativeLayout mainLayout = findViewById(R.id.activitybackgroundpictureRelativeLayout1);
 | 
			
		||||
		mainLayout.setBackgroundColor(nPixelColor);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onResume() {
 | 
			
		||||
		super.onResume();
 | 
			
		||||
		setBackgroundColor();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,203 @@
 | 
			
		||||
package cc.winboll.studio.powerbell.activities;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen<zhangsken@188.com>
 | 
			
		||||
 * @Date 2025/06/22 14:15
 | 
			
		||||
 */
 | 
			
		||||
import android.app.Activity;
 | 
			
		||||
import android.app.Dialog;
 | 
			
		||||
import android.graphics.Bitmap;
 | 
			
		||||
import android.graphics.BitmapFactory;
 | 
			
		||||
import android.graphics.Color;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.view.MotionEvent;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.view.ViewGroup;
 | 
			
		||||
import android.widget.Button;
 | 
			
		||||
import android.widget.ImageView;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.R;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.BackgroundPictureActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.activities.PixelPickerActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.beans.BackgroundPictureBean;
 | 
			
		||||
import cc.winboll.studio.powerbell.utils.BackgroundPictureUtils;
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.FileInputStream;
 | 
			
		||||
import java.io.FileNotFoundException;
 | 
			
		||||
 | 
			
		||||
public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActivity {
 | 
			
		||||
 | 
			
		||||
	public static final String TAG = "PixelPickerActivity";
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Activity getActivity() {
 | 
			
		||||
		return this;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String getTag() {
 | 
			
		||||
		return TAG;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	private ImageView imageView;
 | 
			
		||||
	private Bitmap originalBitmap;
 | 
			
		||||
	private TextView infoText;
 | 
			
		||||
	private ViewGroup imageContainer;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
		setContentView(R.layout.activity_pixelpicker);
 | 
			
		||||
 | 
			
		||||
		imageView = findViewById(R.id.imageView);
 | 
			
		||||
		infoText = findViewById(R.id.infoText);
 | 
			
		||||
		imageContainer = findViewById(R.id.imageContainer);
 | 
			
		||||
 | 
			
		||||
		// 从Intent获取图片路径并加载
 | 
			
		||||
		String imagePath = getIntent().getStringExtra("imagePath");
 | 
			
		||||
		if (imagePath != null) {
 | 
			
		||||
			loadImage(imagePath);
 | 
			
		||||
		} else {
 | 
			
		||||
			infoText.setText("未找到图片路径");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 设置图片点击事件
 | 
			
		||||
		imageContainer.setOnTouchListener(new View.OnTouchListener() {
 | 
			
		||||
				@Override
 | 
			
		||||
				public boolean onTouch(View v, MotionEvent event) {
 | 
			
		||||
					if (event.getAction() == MotionEvent.ACTION_DOWN && originalBitmap != null) {
 | 
			
		||||
						// 计算点击位置在图片上的实际坐标
 | 
			
		||||
						float touchX = event.getX();
 | 
			
		||||
						float touchY = event.getY();
 | 
			
		||||
 | 
			
		||||
						int pixelX = -1, pixelY = -1;
 | 
			
		||||
						try {
 | 
			
		||||
							// 获取图片在容器中的实际位置和尺寸
 | 
			
		||||
							int[] imageLocation = new int[2];
 | 
			
		||||
							imageView.getLocationInWindow(imageLocation);
 | 
			
		||||
							int imageWidth = imageView.getWidth();
 | 
			
		||||
							int imageHeight = imageView.getHeight();
 | 
			
		||||
 | 
			
		||||
							// 计算缩放比例
 | 
			
		||||
							float scaleX = (float) originalBitmap.getWidth() / imageWidth;
 | 
			
		||||
							float scaleY = (float) originalBitmap.getHeight() / imageHeight;
 | 
			
		||||
 | 
			
		||||
							// 调整触摸坐标到图片坐标系
 | 
			
		||||
							float adjustedX = touchX - imageLocation[0];
 | 
			
		||||
							float adjustedY = touchY - imageLocation[1];
 | 
			
		||||
 | 
			
		||||
							// 检查是否在图片范围内
 | 
			
		||||
							if (adjustedX >= 0 && adjustedX <= imageWidth && adjustedY >= 0 && adjustedY <= imageHeight) {
 | 
			
		||||
								// 计算实际像素坐标
 | 
			
		||||
								pixelX = (int) (adjustedX * scaleX);
 | 
			
		||||
								pixelY = (int) (adjustedY * scaleY);
 | 
			
		||||
 | 
			
		||||
								// 再次检查像素坐标是否在有效范围内
 | 
			
		||||
								if (pixelX >= 0 && pixelX < originalBitmap.getWidth() && 
 | 
			
		||||
									pixelY >= 0 && pixelY < originalBitmap.getHeight()) {
 | 
			
		||||
									int pixelColor = originalBitmap.getPixel(pixelX, pixelY);
 | 
			
		||||
									showPixelDialog(pixelColor, pixelX, pixelY);
 | 
			
		||||
								} else {
 | 
			
		||||
									Toast.makeText(PixelPickerActivity.this, "像素坐标超出范围", Toast.LENGTH_SHORT).show();
 | 
			
		||||
								}
 | 
			
		||||
							} else {
 | 
			
		||||
								Toast.makeText(PixelPickerActivity.this, "点击位置超出图片显示范围", Toast.LENGTH_SHORT).show();
 | 
			
		||||
							}
 | 
			
		||||
						} catch (Exception e) {
 | 
			
		||||
							e.printStackTrace();
 | 
			
		||||
							Toast.makeText(PixelPickerActivity.this, "计算像素位置失败", Toast.LENGTH_SHORT).show();
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					return true;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 加载图片
 | 
			
		||||
	 */
 | 
			
		||||
	private void loadImage(String imagePath) {
 | 
			
		||||
		try {
 | 
			
		||||
			File file = new File(imagePath);
 | 
			
		||||
			if (file.exists()) {
 | 
			
		||||
				// 解码图片
 | 
			
		||||
				BitmapFactory.Options options = new BitmapFactory.Options();
 | 
			
		||||
				options.inSampleSize = 1; // 加载原图
 | 
			
		||||
				originalBitmap = BitmapFactory.decodeStream(new FileInputStream(file), null, options);
 | 
			
		||||
 | 
			
		||||
				if (originalBitmap != null) {
 | 
			
		||||
					imageView.setImageBitmap(originalBitmap);
 | 
			
		||||
					infoText.setText("图片已加载,点击获取像素值");
 | 
			
		||||
				} else {
 | 
			
		||||
					infoText.setText("图片加载失败");
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				infoText.setText("图片文件不存在");
 | 
			
		||||
			}
 | 
			
		||||
		} catch (FileNotFoundException e) {
 | 
			
		||||
			e.printStackTrace();
 | 
			
		||||
			infoText.setText("图片文件未找到");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 显示像素对话框
 | 
			
		||||
	 */
 | 
			
		||||
	private void showPixelDialog(final int pixelColor, int x, int y) {
 | 
			
		||||
		Dialog dialog = new Dialog(this);
 | 
			
		||||
		dialog.setContentView(R.layout.dialog_pixel);
 | 
			
		||||
		dialog.setCancelable(true);
 | 
			
		||||
 | 
			
		||||
		// 设置像素颜色视图背景
 | 
			
		||||
		TextView colorView = dialog.findViewById(R.id.pixelColorView);
 | 
			
		||||
		colorView.setBackgroundColor(pixelColor);
 | 
			
		||||
 | 
			
		||||
		// 显示颜色信息
 | 
			
		||||
		TextView infoText = dialog.findViewById(R.id.colorInfoText);
 | 
			
		||||
		String colorInfo = String.format(
 | 
			
		||||
			"RGB: (%d, %d, %d)\n" +
 | 
			
		||||
			"ARGB: #%08X\n" +
 | 
			
		||||
			"实际像素位置: (%d, %d)",
 | 
			
		||||
			Color.red(pixelColor),
 | 
			
		||||
			Color.green(pixelColor),
 | 
			
		||||
			Color.blue(pixelColor),
 | 
			
		||||
			pixelColor,
 | 
			
		||||
			x, y);
 | 
			
		||||
		infoText.setText(colorInfo);
 | 
			
		||||
 | 
			
		||||
		// 设置确定按钮点击事件
 | 
			
		||||
		Button confirmButton = dialog.findViewById(R.id.confirmButton);
 | 
			
		||||
		confirmButton.setOnClickListener(new View.OnClickListener() {
 | 
			
		||||
				@Override
 | 
			
		||||
				public void onClick(View v) {
 | 
			
		||||
					dialog.dismiss();
 | 
			
		||||
					// 可以在这里添加确定后的回调逻辑
 | 
			
		||||
					BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(PixelPickerActivity.this);
 | 
			
		||||
					BackgroundPictureBean bean = utils.getBackgroundPictureBean();
 | 
			
		||||
					bean.setPixelColor(pixelColor);
 | 
			
		||||
					utils.saveData();
 | 
			
		||||
					Toast.makeText(PixelPickerActivity.this, "已记录像素值", Toast.LENGTH_SHORT).show();
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
		dialog.show();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onDestroy() {
 | 
			
		||||
		super.onDestroy();
 | 
			
		||||
		// 回收Bitmap资源
 | 
			
		||||
		if (originalBitmap != null && !originalBitmap.isRecycled()) {
 | 
			
		||||
			originalBitmap.recycle();
 | 
			
		||||
			originalBitmap = null;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
@@ -0,0 +1,20 @@
 | 
			
		||||
package cc.winboll.studio.powerbell.activities;
 | 
			
		||||
 | 
			
		||||
import android.app.Activity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen<zhangsken@188.com>
 | 
			
		||||
 * @Date 2025/06/19 20:35
 | 
			
		||||
 * @Describe 应用窗口基类
 | 
			
		||||
 */
 | 
			
		||||
public abstract class WinBoLLActivity extends Activity implements IWinBoLLActivity {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "WinBoLLActivity";
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -17,6 +17,8 @@ public class BackgroundPictureBean extends BaseBean {
 | 
			
		||||
    int backgroundWidth = 100;
 | 
			
		||||
    int backgroundHeight = 100;
 | 
			
		||||
    boolean isUseBackgroundFile = false;
 | 
			
		||||
	// 图片拾取像素颜色
 | 
			
		||||
	int pixelColor = 0;
 | 
			
		||||
 | 
			
		||||
    public BackgroundPictureBean() {
 | 
			
		||||
    }
 | 
			
		||||
@@ -25,6 +27,14 @@ public class BackgroundPictureBean extends BaseBean {
 | 
			
		||||
        this.isUseBackgroundFile = isUseBackgroundFile;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void setPixelColor(int pixelColor) {
 | 
			
		||||
		this.pixelColor = pixelColor;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public int getPixelColor() {
 | 
			
		||||
		return pixelColor;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    public void setBackgroundWidth(int backgroundWidth) {
 | 
			
		||||
        this.backgroundWidth = backgroundWidth;
 | 
			
		||||
    }
 | 
			
		||||
@@ -61,6 +71,7 @@ public class BackgroundPictureBean extends BaseBean {
 | 
			
		||||
        jsonWriter.name("backgroundWidth").value(bean.getBackgroundWidth());
 | 
			
		||||
        jsonWriter.name("backgroundHeight").value(bean.getBackgroundHeight());
 | 
			
		||||
        jsonWriter.name("isUseBackgroundFile").value(bean.isUseBackgroundFile());
 | 
			
		||||
		jsonWriter.name("pixelColor").value(bean.getPixelColor());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -75,6 +86,8 @@ public class BackgroundPictureBean extends BaseBean {
 | 
			
		||||
                bean.setBackgroundHeight(jsonReader.nextInt());
 | 
			
		||||
            } else if (name.equals("isUseBackgroundFile")) {
 | 
			
		||||
                bean.setIsUseBackgroundFile(jsonReader.nextBoolean());
 | 
			
		||||
            } else if (name.equals("pixelColor")) {
 | 
			
		||||
                bean.setPixelColor(jsonReader.nextInt());
 | 
			
		||||
            } else {
 | 
			
		||||
                jsonReader.skipValue();
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -311,11 +311,11 @@ public class MainViewFragment extends Fragment {
 | 
			
		||||
        LogUtils.d(TAG, String.format("fBackgroundFilePath.exists() %s", fBackgroundFilePath.exists()));
 | 
			
		||||
        if (bean.isUseBackgroundFile() && fBackgroundFilePath.exists()) {
 | 
			
		||||
            Drawable drawableBackground = Drawable.createFromPath(szBackgroundFilePath);
 | 
			
		||||
            drawableBackground.setAlpha(120);
 | 
			
		||||
            //drawableBackground.setAlpha(120);
 | 
			
		||||
            imageView.setImageDrawable(drawableBackground);
 | 
			
		||||
        } else {
 | 
			
		||||
            Drawable drawableBackground = getActivity().getDrawable(R.drawable.blank10x10);
 | 
			
		||||
            drawableBackground.setAlpha(120);
 | 
			
		||||
            //drawableBackground.setAlpha(120);
 | 
			
		||||
            imageView.setImageDrawable(drawableBackground);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<RelativeLayout
 | 
			
		||||
<LinearLayout
 | 
			
		||||
	xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
	xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
	android:orientation="vertical"
 | 
			
		||||
@@ -12,83 +12,110 @@
 | 
			
		||||
		android:id="@+id/toolbar"
 | 
			
		||||
		style="@style/DefaultAToolbar"/>
 | 
			
		||||
 | 
			
		||||
	<ImageView
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="match_parent"
 | 
			
		||||
		android:id="@+id/activitybackgroundpictureImageView1"
 | 
			
		||||
		android:layout_below="@id/toolbar">
 | 
			
		||||
 | 
			
		||||
	</ImageView>
 | 
			
		||||
 | 
			
		||||
	<LinearLayout
 | 
			
		||||
		android:orientation="vertical"
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:layout_below="@id/toolbar">
 | 
			
		||||
	<RelativeLayout
 | 
			
		||||
		android:layout_width="wrap_content"
 | 
			
		||||
		android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
		<RelativeLayout
 | 
			
		||||
			android:layout_width="wrap_content"
 | 
			
		||||
			android:layout_height="wrap_content">
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="match_parent"
 | 
			
		||||
			android:id="@+id/activitybackgroundpictureRelativeLayout1"/>
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
				android:layout_width="160dp"
 | 
			
		||||
				android:layout_height="36dp"
 | 
			
		||||
				android:text="Origin BG"
 | 
			
		||||
				android:id="@+id/activitybackgroundpictureAButton5"
 | 
			
		||||
				android:layout_alignParentLeft="true"
 | 
			
		||||
				android:layout_margin="5dp"/>
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
				android:layout_width="160dp"
 | 
			
		||||
				android:layout_height="36dp"
 | 
			
		||||
				android:text="Received BG"
 | 
			
		||||
				android:id="@+id/activitybackgroundpictureAButton4"
 | 
			
		||||
				android:layout_alignParentRight="true"
 | 
			
		||||
				android:layout_margin="5dp"/>
 | 
			
		||||
		<ImageView
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="match_parent"
 | 
			
		||||
			android:id="@+id/activitybackgroundpictureImageView1"
 | 
			
		||||
			android:layout_below="@id/toolbar">
 | 
			
		||||
 | 
			
		||||
		</RelativeLayout>
 | 
			
		||||
		</ImageView>
 | 
			
		||||
 | 
			
		||||
		<LinearLayout
 | 
			
		||||
			android:orientation="horizontal"
 | 
			
		||||
			android:orientation="vertical"
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:gravity="right">
 | 
			
		||||
			android:layout_below="@id/toolbar">
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
				android:layout_width="50dp"
 | 
			
		||||
				android:layout_height="36dp"
 | 
			
		||||
				android:text="◎"
 | 
			
		||||
				android:layout_gravity="center_vertical"
 | 
			
		||||
				android:layout_margin="10dp"
 | 
			
		||||
				android:id="@+id/activitybackgroundpictureAButton1"/>
 | 
			
		||||
			<RelativeLayout
 | 
			
		||||
				android:layout_width="wrap_content"
 | 
			
		||||
				android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
				android:layout_width="50dp"
 | 
			
		||||
				android:layout_height="36dp"
 | 
			
		||||
				android:text="☑"
 | 
			
		||||
				android:layout_gravity="center_vertical"
 | 
			
		||||
				android:layout_margin="10dp"
 | 
			
		||||
				android:id="@+id/activitybackgroundpictureAButton2"/>
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="160dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="Origin BG"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton5"
 | 
			
		||||
					android:layout_alignParentLeft="true"
 | 
			
		||||
					android:layout_margin="5dp"/>
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
				android:layout_width="50dp"
 | 
			
		||||
				android:layout_height="36dp"
 | 
			
		||||
				android:text="[+]"
 | 
			
		||||
				android:layout_gravity="center_vertical"
 | 
			
		||||
				android:layout_margin="10dp"
 | 
			
		||||
				android:id="@+id/activitybackgroundpictureAButton3"/>
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="160dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="Received BG"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton4"
 | 
			
		||||
					android:layout_alignParentRight="true"
 | 
			
		||||
					android:layout_margin="5dp"/>
 | 
			
		||||
 | 
			
		||||
			<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
				android:layout_width="50dp"
 | 
			
		||||
				android:layout_height="36dp"
 | 
			
		||||
				android:text="[+~]"
 | 
			
		||||
				android:layout_gravity="center_vertical"
 | 
			
		||||
				android:layout_margin="10dp"
 | 
			
		||||
				android:id="@+id/activitybackgroundpictureAButton6"/>
 | 
			
		||||
			</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
			<LinearLayout
 | 
			
		||||
				android:orientation="horizontal"
 | 
			
		||||
				android:layout_width="match_parent"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:gravity="right">
 | 
			
		||||
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="50dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="◎"
 | 
			
		||||
					android:layout_gravity="center_vertical"
 | 
			
		||||
					android:layout_margin="5dp"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton1"/>
 | 
			
		||||
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="50dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="☑"
 | 
			
		||||
					android:layout_gravity="center_vertical"
 | 
			
		||||
					android:layout_margin="5dp"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton2"/>
 | 
			
		||||
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="50dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="[+]"
 | 
			
		||||
					android:layout_gravity="center_vertical"
 | 
			
		||||
					android:layout_margin="5dp"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton3"/>
 | 
			
		||||
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="50dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="[+~]"
 | 
			
		||||
					android:layout_gravity="center_vertical"
 | 
			
		||||
					android:layout_margin="5dp"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton6"/>
 | 
			
		||||
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="50dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="[◐]"
 | 
			
		||||
					android:layout_gravity="center_vertical"
 | 
			
		||||
					android:layout_margin="5dp"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton7"/>
 | 
			
		||||
				
 | 
			
		||||
				<cc.winboll.studio.libaes.views.AButton
 | 
			
		||||
					android:layout_width="50dp"
 | 
			
		||||
					android:layout_height="36dp"
 | 
			
		||||
					android:text="[○]"
 | 
			
		||||
					android:layout_gravity="center_vertical"
 | 
			
		||||
					android:layout_margin="5dp"
 | 
			
		||||
					android:id="@+id/activitybackgroundpictureAButton8"/>
 | 
			
		||||
				
 | 
			
		||||
			</LinearLayout>
 | 
			
		||||
 | 
			
		||||
		</LinearLayout>
 | 
			
		||||
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
</RelativeLayout>
 | 
			
		||||
	</RelativeLayout>
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,42 +2,34 @@
 | 
			
		||||
<LinearLayout
 | 
			
		||||
	xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
	xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
	android:layout_width="match_parent"
 | 
			
		||||
	android:layout_height="match_parent"
 | 
			
		||||
	android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
	<LinearLayout
 | 
			
		||||
		android:orientation="horizontal"
 | 
			
		||||
	<cc.winboll.studio.libaes.views.AToolbar
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content">
 | 
			
		||||
		android:layout_height="@dimen/toolbar_height"
 | 
			
		||||
		android:id="@+id/toolbar"
 | 
			
		||||
		android:gravity="center_vertical"
 | 
			
		||||
		style="@style/DefaultAToolbar"/>
 | 
			
		||||
 | 
			
		||||
		<cc.winboll.studio.libaes.views.AToolbar
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="@dimen/toolbar_height"
 | 
			
		||||
			android:id="@+id/toolbar"
 | 
			
		||||
			android:gravity="center_vertical"
 | 
			
		||||
			style="@style/DefaultAToolbar"/>
 | 
			
		||||
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
	<LinearLayout
 | 
			
		||||
		android:orientation="vertical"
 | 
			
		||||
	<RelativeLayout
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:layout_height="0dp"
 | 
			
		||||
		android:layout_weight="1.0">
 | 
			
		||||
 | 
			
		||||
		<RelativeLayout
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="match_parent"
 | 
			
		||||
			android:id="@+id/activitymainRelativeLayout1"
 | 
			
		||||
			android:background="#FFEE2121"/>
 | 
			
		||||
 | 
			
		||||
		<FrameLayout
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="match_parent"
 | 
			
		||||
			android:id="@+id/activitymainFrameLayout1"/>
 | 
			
		||||
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
	<cc.winboll.studio.libappbase.LogView
 | 
			
		||||
		android:orientation="horizontal"
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="200dp"
 | 
			
		||||
		android:id="@+id/logview"/>
 | 
			
		||||
	</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								powerbell/src/main/res/layout/activity_pixelpicker.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								powerbell/src/main/res/layout/activity_pixelpicker.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
    <FrameLayout
 | 
			
		||||
        android:id="@+id/imageContainer"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
        <ImageView
 | 
			
		||||
            android:id="@+id/imageView"
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:layout_gravity="center"
 | 
			
		||||
            android:scaleType="centerCrop"
 | 
			
		||||
            android:src="@drawable/ic_launcher" />
 | 
			
		||||
    </FrameLayout>
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/infoText"
 | 
			
		||||
        android:layout_width="wrap_content"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_alignParentBottom="true"
 | 
			
		||||
        android:layout_centerHorizontal="true"
 | 
			
		||||
        android:padding="10dp"
 | 
			
		||||
        android:background="#80000000"
 | 
			
		||||
        android:textColor="#FFFFFF"
 | 
			
		||||
        android:text="点击图片获取像素值" />
 | 
			
		||||
</RelativeLayout>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										32
									
								
								powerbell/src/main/res/layout/dialog_pixel.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								powerbell/src/main/res/layout/dialog_pixel.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:layout_width="240dp"
 | 
			
		||||
    android:layout_height="wrap_content"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:padding="16dp">
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/pixelColorView"
 | 
			
		||||
        android:layout_width="200dp"
 | 
			
		||||
        android:layout_height="200dp"
 | 
			
		||||
        android:layout_gravity="center_horizontal" />
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/colorInfoText"
 | 
			
		||||
        android:layout_width="wrap_content"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_gravity="center_horizontal"
 | 
			
		||||
        android:layout_marginTop="8dp"
 | 
			
		||||
        android:textColor="#333333"
 | 
			
		||||
        android:textSize="14sp" />
 | 
			
		||||
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/confirmButton"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_marginTop="16dp"
 | 
			
		||||
        android:background="@android:color/holo_blue_light"
 | 
			
		||||
        android:text="确定"
 | 
			
		||||
        android:textColor="@android:color/white" />
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
@@ -43,15 +43,6 @@
 | 
			
		||||
 | 
			
		||||
			</LinearLayout>
 | 
			
		||||
 | 
			
		||||
			<TextView
 | 
			
		||||
				android:layout_width="match_parent"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:text="Tips"
 | 
			
		||||
				android:textSize="@dimen/text_content_size"
 | 
			
		||||
				android:id="@+id/fragmentandroidviewTextView1"
 | 
			
		||||
				android:background="@drawable/bg_frame"
 | 
			
		||||
				android:padding="10dp"/>
 | 
			
		||||
 | 
			
		||||
		</LinearLayout>
 | 
			
		||||
 | 
			
		||||
		<LinearLayout
 | 
			
		||||
@@ -205,6 +196,21 @@
 | 
			
		||||
 | 
			
		||||
		</LinearLayout>
 | 
			
		||||
 | 
			
		||||
		<LinearLayout
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:layout_width="match_parent">
 | 
			
		||||
 | 
			
		||||
			<TextView
 | 
			
		||||
				android:layout_width="match_parent"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:text="Tips"
 | 
			
		||||
				android:textSize="@dimen/text_content_size"
 | 
			
		||||
				android:id="@+id/fragmentandroidviewTextView1"
 | 
			
		||||
				android:background="@drawable/bg_frame"
 | 
			
		||||
				android:padding="10dp"/>
 | 
			
		||||
 | 
			
		||||
		</LinearLayout>
 | 
			
		||||
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
</RelativeLayout>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,9 @@
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/action_changepicture"
 | 
			
		||||
        android:title="@string/item_changepicture"/>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/action_log"
 | 
			
		||||
        android:title="@string/item_logview"/>
 | 
			
		||||
    <item
 | 
			
		||||
        android:id="@+id/action_about"
 | 
			
		||||
        android:title="@string/item_aboutview"/>
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,6 @@
 | 
			
		||||
 | 
			
		||||
// JC 项目编译设置
 | 
			
		||||
//include ':jc'
 | 
			
		||||
//include ':libjc'
 | 
			
		||||
//rootProject.name = "jc"
 | 
			
		||||
 | 
			
		||||
// AES 项目编译设置
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user