Compare commits
	
		
			27 Commits
		
	
	
		
			powerbell-
			...
			cdfbb082d2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					cdfbb082d2 | ||
| 
						 | 
					7e476894a7 | ||
| 
						 | 
					80201e8370 | ||
| 
						 | 
					ea0473606a | ||
| 
						 | 
					eb61eb7306 | ||
| 
						 | 
					31ad66685c | ||
| 
						 | 
					beb561ad6a | ||
| 
						 | 
					8869265d60 | ||
| 
						 | 
					07b5e66875 | ||
| 
						 | 
					91f5cf9051 | ||
| 
						 | 
					f8944490f8 | ||
| 
						 | 
					733af004f6 | ||
| 
						 | 
					c03568e1f5 | ||
| 
						 | 
					a0575a5e8b | ||
| 
						 | 
					0e57ce679e | ||
| 
						 | 
					f9211a8eb4 | ||
| 
						 | 
					4c31ff9b54 | ||
| 
						 | 
					8cf610962e | ||
| 
						 | 
					3071d186ec | ||
| 
						 | 
					df10306059 | ||
| 
						 | 
					ccdb9c5abd | ||
| 
						 | 
					f27209ab87 | ||
| 
						 | 
					e8682ce410 | ||
| 
						 | 
					2e4003dae0 | ||
| 
						 | 
					198b0975ce | ||
| 
						 | 
					24a578a9d2 | ||
| 
						 | 
					46de24447f | 
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Mon Jun 09 01:44:28 HKT 2025
 | 
			
		||||
stageCount=1
 | 
			
		||||
#Thu Jun 19 20:42:40 HKT 2025
 | 
			
		||||
stageCount=2
 | 
			
		||||
libraryProject=libaes
 | 
			
		||||
baseVersion=15.9
 | 
			
		||||
publishVersion=15.9.0
 | 
			
		||||
publishVersion=15.9.1
 | 
			
		||||
buildCount=0
 | 
			
		||||
baseBetaVersion=15.9.1
 | 
			
		||||
baseBetaVersion=15.9.2
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Sun Jun 01 08:03:56 GMT 2025
 | 
			
		||||
#Thu Jun 19 12:49:47 GMT 2025
 | 
			
		||||
stageCount=0
 | 
			
		||||
libraryProject=
 | 
			
		||||
baseVersion=15.0
 | 
			
		||||
publishVersion=15.0.0
 | 
			
		||||
buildCount=24
 | 
			
		||||
buildCount=26
 | 
			
		||||
baseBetaVersion=15.0.1
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Mon Jun 09 01:44:28 HKT 2025
 | 
			
		||||
stageCount=1
 | 
			
		||||
#Thu Jun 19 20:42:26 HKT 2025
 | 
			
		||||
stageCount=2
 | 
			
		||||
libraryProject=libaes
 | 
			
		||||
baseVersion=15.9
 | 
			
		||||
publishVersion=15.9.0
 | 
			
		||||
publishVersion=15.9.1
 | 
			
		||||
buildCount=0
 | 
			
		||||
baseBetaVersion=15.9.1
 | 
			
		||||
baseBetaVersion=15.9.2
 | 
			
		||||
 
 | 
			
		||||
@@ -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.3'
 | 
			
		||||
    api 'cc.winboll.studio:libapputils:15.8.5'
 | 
			
		||||
    api 'cc.winboll.studio:libappbase:15.9.5'
 | 
			
		||||
    
 | 
			
		||||
    // 吐司提示库
 | 
			
		||||
    api 'com.github.getActivity:ToastUtils:10.5'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#Created by .winboll/winboll_app_build.gradle
 | 
			
		||||
#Thu Jun 19 10:22:12 HKT 2025
 | 
			
		||||
stageCount=3
 | 
			
		||||
#Wed Sep 03 20:59:53 HKT 2025
 | 
			
		||||
stageCount=13
 | 
			
		||||
libraryProject=
 | 
			
		||||
baseVersion=15.4
 | 
			
		||||
publishVersion=15.4.2
 | 
			
		||||
publishVersion=15.4.12
 | 
			
		||||
buildCount=0
 | 
			
		||||
baseBetaVersion=15.4.3
 | 
			
		||||
baseBetaVersion=15.4.13
 | 
			
		||||
 
 | 
			
		||||
@@ -121,6 +121,8 @@
 | 
			
		||||
 | 
			
		||||
        <activity android:name="cc.winboll.studio.powerbell.activities.AboutActivity"/>
 | 
			
		||||
 | 
			
		||||
        <activity android:name="cc.winboll.studio.powerbell.activities.PixelPickerActivity"/>
 | 
			
		||||
 | 
			
		||||
    </application>
 | 
			
		||||
 | 
			
		||||
</manifest>
 | 
			
		||||
@@ -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);
 | 
			
		||||
	}
 | 
			
		||||
} 
 | 
			
		||||
 
 | 
			
		||||
@@ -53,11 +53,11 @@ public class AboutActivity extends Activity {
 | 
			
		||||
        appInfo.setAppName(getString(R.string.app_name));
 | 
			
		||||
        appInfo.setAppIcon(R.drawable.ic_launcher);
 | 
			
		||||
        appInfo.setAppDescription(getString(R.string.app_description));
 | 
			
		||||
        appInfo.setAppGitName("APP");
 | 
			
		||||
        appInfo.setAppGitName("APPBase");
 | 
			
		||||
        appInfo.setAppGitOwner("Studio");
 | 
			
		||||
        appInfo.setAppGitAPPBranch(szBranchName);
 | 
			
		||||
        appInfo.setAppGitAPPSubProjectFolder(szBranchName);
 | 
			
		||||
        appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=PowerBell");
 | 
			
		||||
        appInfo.setAppHomePage("https://discuz.winboll.cc/forum.php?mod=viewthread&tid=1");
 | 
			
		||||
        appInfo.setAppAPKName("PowerBell");
 | 
			
		||||
        appInfo.setAppAPKFolderName("PowerBell");
 | 
			
		||||
        return new AboutView(mContext, appInfo);
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,7 @@ import android.os.Bundle;
 | 
			
		||||
import android.provider.MediaStore;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.widget.ImageView;
 | 
			
		||||
import android.widget.RelativeLayout;
 | 
			
		||||
import androidx.core.app.ActivityCompat;
 | 
			
		||||
import androidx.core.content.ContextCompat;
 | 
			
		||||
import cc.winboll.studio.libaes.views.AToolbar;
 | 
			
		||||
@@ -33,7 +34,7 @@ import java.io.FileOutputStream;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
 | 
			
		||||
public class BackgroundPictureActivity extends Activity implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
public class BackgroundPictureActivity extends WinBoLLActivity implements BackgroundPicturePreviewDialog.IOnRecivedPictureListener {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "BackgroundPictureActivity";
 | 
			
		||||
    public BackgroundPictureUtils mBackgroundPictureUtils;
 | 
			
		||||
@@ -58,6 +59,16 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
			
		||||
    private int mnPictureCompress = 100;
 | 
			
		||||
    private static String _RecivedPictureFileName;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Activity getActivity() {
 | 
			
		||||
		return this;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String getTag() {
 | 
			
		||||
		return TAG;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
@@ -102,6 +113,8 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
			
		||||
        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();
 | 
			
		||||
 | 
			
		||||
@@ -154,10 +167,10 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
			
		||||
                String filePath = utils.getBackgroundDir() + getBackgroundFileName();
 | 
			
		||||
                Drawable drawable = FileUtils.getImageDrawable(filePath);
 | 
			
		||||
                if (drawable != null) {
 | 
			
		||||
                    drawable.setAlpha(120);
 | 
			
		||||
                    //drawable.setAlpha(120);
 | 
			
		||||
                    ivPreviewBackground.setImageDrawable(drawable);
 | 
			
		||||
                }
 | 
			
		||||
                ToastUtils.show("背景图片已更新");
 | 
			
		||||
                //ToastUtils.show("背景图片已更新");
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
			
		||||
                ToastUtils.show("背景图片加载失败");
 | 
			
		||||
@@ -252,6 +265,30 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
	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(getActivity(), 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();
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 压缩图片并保存到接收文件
 | 
			
		||||
     */
 | 
			
		||||
@@ -492,11 +529,11 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
			
		||||
                LogUtils.e(TAG, "剪裁保存异常" + e);
 | 
			
		||||
                ToastUtils.show("保存失败:" + e.getMessage());
 | 
			
		||||
            }/* finally {
 | 
			
		||||
                // 安全删除临时文件
 | 
			
		||||
                if (mfTempCropPicture.exists()) {
 | 
			
		||||
                    mfTempCropPicture.delete();
 | 
			
		||||
                }
 | 
			
		||||
            }*/
 | 
			
		||||
			 // 安全删除临时文件
 | 
			
		||||
			 if (mfTempCropPicture.exists()) {
 | 
			
		||||
			 mfTempCropPicture.delete();
 | 
			
		||||
			 }
 | 
			
		||||
			 }*/
 | 
			
		||||
        } else if (resultCode != RESULT_OK) {
 | 
			
		||||
            LogUtils.d(TAG, "操作取消或失败,requestCode: " + requestCode);
 | 
			
		||||
            ToastUtils.show("操作已取消");
 | 
			
		||||
@@ -538,5 +575,19 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	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();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,7 @@ import cc.winboll.studio.powerbell.receivers.ControlCenterServiceReceiver;
 | 
			
		||||
import cc.winboll.studio.powerbell.utils.AppCacheUtils;
 | 
			
		||||
import cc.winboll.studio.powerbell.utils.StringUtils;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import android.widget.Switch;
 | 
			
		||||
 | 
			
		||||
public class ClearRecordActivity extends Activity {
 | 
			
		||||
 | 
			
		||||
@@ -24,6 +25,7 @@ public class ClearRecordActivity extends Activity {
 | 
			
		||||
    AToolbar mAToolbar;
 | 
			
		||||
    TextView mtvRecordText;
 | 
			
		||||
    App mApplication;
 | 
			
		||||
	boolean mIsShowRecordWithEnter = false;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
@@ -79,7 +81,18 @@ public class ClearRecordActivity extends Activity {
 | 
			
		||||
 | 
			
		||||
    void initRecordText() {
 | 
			
		||||
        ArrayList<BatteryInfoBean> listBatteryInfo = AppCacheUtils.getInstance(this).getArrayListBatteryInfo();
 | 
			
		||||
        String szRecordText = StringUtils.formatPCMListString(listBatteryInfo);
 | 
			
		||||
        mtvRecordText.setText(szRecordText);
 | 
			
		||||
		if (mIsShowRecordWithEnter) {
 | 
			
		||||
			String szRecordText = StringUtils.formatPCMListStringWithEnter(listBatteryInfo);
 | 
			
		||||
			mtvRecordText.setText(szRecordText);
 | 
			
		||||
		} else {
 | 
			
		||||
			String szRecordText = StringUtils.formatPCMListString(listBatteryInfo);
 | 
			
		||||
			mtvRecordText.setText(szRecordText);
 | 
			
		||||
		}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	public void onShowRecordWithEnter(View view) {
 | 
			
		||||
		Switch swShowRecordWithEnter = (Switch)view;
 | 
			
		||||
		mIsShowRecordWithEnter = swShowRecordWithEnter.isChecked();
 | 
			
		||||
		initRecordText();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,251 @@
 | 
			
		||||
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.MenuItem;
 | 
			
		||||
import android.view.MotionEvent;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.view.ViewGroup;
 | 
			
		||||
import android.widget.Button;
 | 
			
		||||
import android.widget.ImageView;
 | 
			
		||||
import android.widget.RelativeLayout;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
import cc.winboll.studio.libaes.views.AToolbar;
 | 
			
		||||
import cc.winboll.studio.libappbase.GlobalApplication;
 | 
			
		||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.MainActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.R;
 | 
			
		||||
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 AToolbar mAToolbar;
 | 
			
		||||
	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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // 初始化工具栏
 | 
			
		||||
        mAToolbar = (AToolbar) findViewById(R.id.toolbar);
 | 
			
		||||
        setActionBar(mAToolbar);
 | 
			
		||||
        mAToolbar.setSubtitle(R.string.subtitle_activity_pixelpicker);
 | 
			
		||||
        getActionBar().setDisplayHomeAsUpEnabled(true);
 | 
			
		||||
        mAToolbar.setNavigationOnClickListener(new View.OnClickListener() {
 | 
			
		||||
                @Override
 | 
			
		||||
                public void onClick(View v) {
 | 
			
		||||
                    finish();
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
		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) {
 | 
			
		||||
		final 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();
 | 
			
		||||
					setBackgroundColor();
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
		dialog.show();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onDestroy() {
 | 
			
		||||
		super.onDestroy();
 | 
			
		||||
		// 回收Bitmap资源
 | 
			
		||||
		if (originalBitmap != null && !originalBitmap.isRecycled()) {
 | 
			
		||||
			originalBitmap.recycle();
 | 
			
		||||
			originalBitmap = null;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	void setBackgroundColor() {
 | 
			
		||||
		BackgroundPictureUtils utils = BackgroundPictureUtils.getInstance(PixelPickerActivity.this);
 | 
			
		||||
		BackgroundPictureBean bean = utils.getBackgroundPictureBean();
 | 
			
		||||
		int nPixelColor = bean.getPixelColor();
 | 
			
		||||
		RelativeLayout mainLayout = findViewById(R.id.activitypixelpickerRelativeLayout1);
 | 
			
		||||
		mainLayout.setBackgroundColor(nPixelColor);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onResume() {
 | 
			
		||||
		super.onResume();
 | 
			
		||||
		setBackgroundColor();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean onOptionsItemSelected(MenuItem item) {
 | 
			
		||||
        if (item.getItemId() == android.R.id.home) {
 | 
			
		||||
            GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(getApplicationContext(), BackgroundPictureActivity.class);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        // 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
 | 
			
		||||
        return super.onOptionsItemSelected(item);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onBackPressed() {
 | 
			
		||||
		super.onBackPressed();
 | 
			
		||||
		GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(getApplicationContext(), BackgroundPictureActivity.class);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
@@ -0,0 +1,53 @@
 | 
			
		||||
package cc.winboll.studio.powerbell.activities;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author ZhanGSKen<zhangsken@188.com>
 | 
			
		||||
 * @Date 2025/06/19 20:35
 | 
			
		||||
 * @Describe 应用窗口基类
 | 
			
		||||
 */
 | 
			
		||||
import android.app.Activity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.view.MenuItem;
 | 
			
		||||
import cc.winboll.studio.libappbase.GlobalApplication;
 | 
			
		||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.App;
 | 
			
		||||
import cc.winboll.studio.powerbell.MainActivity;
 | 
			
		||||
import cc.winboll.studio.powerbell.R;
 | 
			
		||||
 | 
			
		||||
public abstract class WinBoLLActivity extends Activity implements IWinBoLLActivity {
 | 
			
		||||
 | 
			
		||||
    public static final String TAG = "WinBoLLActivity";
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onPostCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onPostCreate(savedInstanceState);
 | 
			
		||||
        GlobalApplication.getWinBoLLActivityManager().add(this);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onDestroy() {
 | 
			
		||||
        super.onDestroy();
 | 
			
		||||
        GlobalApplication.getWinBoLLActivityManager().registeRemove(this);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean onOptionsItemSelected(MenuItem item) {
 | 
			
		||||
        if (item.getItemId() == android.R.id.home) {
 | 
			
		||||
            GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(getApplicationContext(), MainActivity.class);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        // 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
 | 
			
		||||
        return super.onOptionsItemSelected(item);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onBackPressed() {
 | 
			
		||||
		super.onBackPressed();
 | 
			
		||||
		GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(getApplicationContext(), MainActivity.class);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -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);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,15 @@ public class StringUtils {
 | 
			
		||||
        return sz;
 | 
			
		||||
    }
 | 
			
		||||
	
 | 
			
		||||
	public static String formatPCMListStringWithEnter(ArrayList<BatteryInfoBean> arrayListBatteryInfo) {
 | 
			
		||||
        String sz = "";
 | 
			
		||||
        for (int i = 0; i < arrayListBatteryInfo.size() - 1; i++) {
 | 
			
		||||
            //LogUtils.d(TAG, "arrayListBatteryInfo.get(i).getBattetyValue() is "+ Integer.toString(arrayListBatteryInfo.get(i).getBattetyValue()));
 | 
			
		||||
            sz = "\n" + arrayListBatteryInfo.get(i).getBattetyValue() + "%\n        " + getTimespanDifference(arrayListBatteryInfo.get(i).getTimeStamp(), arrayListBatteryInfo.get(i + 1).getTimeStamp()) + " " + sz;
 | 
			
		||||
        }
 | 
			
		||||
        return sz;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 获取时间之间的时间跨度字符串。
 | 
			
		||||
    // Get timespan string between times.
 | 
			
		||||
    // 返回值: {(几天/)(几小时/)(几分钟/)(几秒钟)}
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,12 +25,19 @@
 | 
			
		||||
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
	<TextView
 | 
			
		||||
		android:layout_width="wrap_content"
 | 
			
		||||
	<LinearLayout
 | 
			
		||||
		android:orientation="horizontal"
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="wrap_content"
 | 
			
		||||
		android:id="@+id/activityclearrecordTextView1"
 | 
			
		||||
		android:gravity="center_horizontal"
 | 
			
		||||
		android:layout_gravity="center_horizontal"/>
 | 
			
		||||
		android:gravity="center_horizontal">
 | 
			
		||||
 | 
			
		||||
		<TextView
 | 
			
		||||
			android:layout_width="wrap_content"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:id="@+id/activityclearrecordTextView1"
 | 
			
		||||
			android:textAppearance="?android:attr/textAppearanceSmall"/>
 | 
			
		||||
 | 
			
		||||
	</LinearLayout>
 | 
			
		||||
 | 
			
		||||
	<LinearLayout
 | 
			
		||||
		android:orientation="vertical"
 | 
			
		||||
@@ -40,12 +47,32 @@
 | 
			
		||||
		android:layout_weight="1.0"
 | 
			
		||||
		android:background="@drawable/bg_frame">
 | 
			
		||||
 | 
			
		||||
		<TextView
 | 
			
		||||
		<LinearLayout
 | 
			
		||||
			android:orientation="horizontal"
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="wrap_content"
 | 
			
		||||
			android:text="Record Text"
 | 
			
		||||
			android:textStyle="bold"
 | 
			
		||||
			android:gravity="center_horizontal"/>
 | 
			
		||||
			android:gravity="center_horizontal">
 | 
			
		||||
 | 
			
		||||
			<TextView
 | 
			
		||||
				android:layout_width="0dp"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:text="Record Text"
 | 
			
		||||
				android:textStyle="bold"
 | 
			
		||||
				android:gravity="center_horizontal"
 | 
			
		||||
				android:layout_weight="1.0"
 | 
			
		||||
				android:layout_marginLeft="10dp"
 | 
			
		||||
				android:background="#FFD5D5D5"/>
 | 
			
		||||
 | 
			
		||||
			<Switch
 | 
			
		||||
				android:layout_width="wrap_content"
 | 
			
		||||
				android:layout_height="wrap_content"
 | 
			
		||||
				android:text="<↲>"
 | 
			
		||||
				android:id="@+id/activityclearrecordSwitch1"
 | 
			
		||||
				android:onClick="onShowRecordWithEnter"
 | 
			
		||||
				android:layout_marginLeft="10dp"
 | 
			
		||||
				android:layout_marginRight="10dp"/>
 | 
			
		||||
 | 
			
		||||
		</LinearLayout>
 | 
			
		||||
 | 
			
		||||
		<ScrollView
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										54
									
								
								powerbell/src/main/res/layout/activity_pixelpicker.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								powerbell/src/main/res/layout/activity_pixelpicker.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout
 | 
			
		||||
	xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
	xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
	android:layout_width="match_parent"
 | 
			
		||||
	android:layout_height="match_parent"
 | 
			
		||||
	android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
	<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"/>
 | 
			
		||||
 | 
			
		||||
	<RelativeLayout
 | 
			
		||||
		android:layout_width="match_parent"
 | 
			
		||||
		android:layout_height="0dp"
 | 
			
		||||
		android:layout_weight="1.0">
 | 
			
		||||
 | 
			
		||||
		<RelativeLayout
 | 
			
		||||
			android:layout_width="match_parent"
 | 
			
		||||
			android:layout_height="match_parent"
 | 
			
		||||
			android:background="#FFEE2121"
 | 
			
		||||
			android:id="@+id/activitypixelpickerRelativeLayout1"/>
 | 
			
		||||
 | 
			
		||||
		<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: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>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										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"/>
 | 
			
		||||
 
 | 
			
		||||
@@ -15,6 +15,7 @@
 | 
			
		||||
    <string name="texthint_CustomSlideToCleanRecord">Slide Right To Clean Up APP Record.</string>
 | 
			
		||||
    <string name="subtitle_activity_clearrecord">清理记录</string>
 | 
			
		||||
    <string name="subtitle_activity_backgroundpicture">更换背景图片</string>
 | 
			
		||||
    <string name="subtitle_activity_pixelpicker">背景像素拾取</string>
 | 
			
		||||
    <string name="subtitle_activity_about">关于应用</string>
 | 
			
		||||
    <string name="msg_AOHPCTCSeekBar_ClearRecord">>>>Seek 100% To Clear Battery Record.>>></string>
 | 
			
		||||
	<string name="msg_AOHPCTCSeekBar_ClearRecord">>>>向右滑动100%可以清理电量记录。>>></string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,7 @@
 | 
			
		||||
    <string name="texthint_CustomSlideToCleanRecord">Slide Right To Clean Up APP Record.</string>
 | 
			
		||||
    <string name="subtitle_activity_clearrecord">Clean Record</string>
 | 
			
		||||
    <string name="subtitle_activity_backgroundpicture">Background Picture</string>
 | 
			
		||||
    <string name="subtitle_activity_pixelpicker">Pixel Picker</string>
 | 
			
		||||
    <string name="subtitle_activity_about">About The APP</string>
 | 
			
		||||
    <string name="msg_AOHPCTCSeekBar_ClearRecord">>>>Seek 100% To Clear Battery Record.>>></string>
 | 
			
		||||
    <string name="msg_AOHPCTCSeekBar_ClearRecord">>>>Seek 100% Right Is Clean Record.>>></string>
 | 
			
		||||
</resources>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user