Compare commits
	
		
			9 Commits
		
	
	
		
			powerbell-
			...
			f8944490f8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					f8944490f8 | ||
| 
						 | 
					733af004f6 | ||
| 
						 | 
					c03568e1f5 | ||
| 
						 | 
					a0575a5e8b | ||
| 
						 | 
					0e57ce679e | ||
| 
						 | 
					f9211a8eb4 | ||
| 
						 | 
					4c31ff9b54 | ||
| 
						 | 
					8cf610962e | ||
| 
						 | 
					3071d186ec | 
@@ -45,9 +45,9 @@ android {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
dependencies {
 | 
					dependencies {
 | 
				
			||||||
    api fileTree(dir: 'libs', include: ['*.jar'])
 | 
					    api fileTree(dir: 'libs', include: ['*.jar'])
 | 
				
			||||||
    api 'cc.winboll.studio:libaes:15.8.0'
 | 
					    api 'cc.winboll.studio:libaes:15.9.1'
 | 
				
			||||||
    api 'cc.winboll.studio:libapputils:15.8.2'
 | 
					    api 'cc.winboll.studio:libapputils:15.8.4'
 | 
				
			||||||
    api 'cc.winboll.studio:libappbase:15.8.2'
 | 
					    api 'cc.winboll.studio:libappbase:15.8.4'
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // 吐司提示库
 | 
					    // 吐司提示库
 | 
				
			||||||
    api 'com.github.getActivity:ToastUtils:10.5'
 | 
					    api 'com.github.getActivity:ToastUtils:10.5'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
#Created by .winboll/winboll_app_build.gradle
 | 
					#Created by .winboll/winboll_app_build.gradle
 | 
				
			||||||
#Thu Jun 19 21:16:18 HKT 2025
 | 
					#Mon Jun 23 20:07:50 HKT 2025
 | 
				
			||||||
stageCount=4
 | 
					stageCount=8
 | 
				
			||||||
libraryProject=
 | 
					libraryProject=
 | 
				
			||||||
baseVersion=15.4
 | 
					baseVersion=15.4
 | 
				
			||||||
publishVersion=15.4.3
 | 
					publishVersion=15.4.7
 | 
				
			||||||
buildCount=0
 | 
					buildCount=0
 | 
				
			||||||
baseBetaVersion=15.4.4
 | 
					baseBetaVersion=15.4.8
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -121,6 +121,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        <activity android:name="cc.winboll.studio.powerbell.activities.AboutActivity"/>
 | 
					        <activity android:name="cc.winboll.studio.powerbell.activities.AboutActivity"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <activity android:name="cc.winboll.studio.powerbell.activities.PixelPickerActivity"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </application>
 | 
					    </application>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</manifest>
 | 
					</manifest>
 | 
				
			||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
package cc.winboll.studio.powerbell;
 | 
					package cc.winboll.studio.powerbell;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import android.app.Activity;
 | 
				
			||||||
import android.app.Fragment;
 | 
					import android.app.Fragment;
 | 
				
			||||||
import android.app.FragmentTransaction;
 | 
					import android.app.FragmentTransaction;
 | 
				
			||||||
import android.content.Intent;
 | 
					import android.content.Intent;
 | 
				
			||||||
@@ -9,6 +10,7 @@ import android.os.Bundle;
 | 
				
			|||||||
import android.provider.MediaStore;
 | 
					import android.provider.MediaStore;
 | 
				
			||||||
import android.view.Menu;
 | 
					import android.view.Menu;
 | 
				
			||||||
import android.view.MenuItem;
 | 
					import android.view.MenuItem;
 | 
				
			||||||
 | 
					import android.widget.RelativeLayout;
 | 
				
			||||||
import android.widget.Toast;
 | 
					import android.widget.Toast;
 | 
				
			||||||
import cc.winboll.studio.libaes.views.AToolbar;
 | 
					import cc.winboll.studio.libaes.views.AToolbar;
 | 
				
			||||||
import cc.winboll.studio.libappbase.LogUtils;
 | 
					import cc.winboll.studio.libappbase.LogUtils;
 | 
				
			||||||
@@ -18,8 +20,9 @@ import cc.winboll.studio.powerbell.activities.BackgroundPictureActivity;
 | 
				
			|||||||
import cc.winboll.studio.powerbell.activities.BatteryReporterActivity;
 | 
					import cc.winboll.studio.powerbell.activities.BatteryReporterActivity;
 | 
				
			||||||
import cc.winboll.studio.powerbell.activities.ClearRecordActivity;
 | 
					import cc.winboll.studio.powerbell.activities.ClearRecordActivity;
 | 
				
			||||||
import cc.winboll.studio.powerbell.activities.WinBoLLActivity;
 | 
					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.fragments.MainViewFragment;
 | 
				
			||||||
import android.app.Activity;
 | 
					import cc.winboll.studio.powerbell.utils.BackgroundPictureUtils;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class MainActivity extends WinBoLLActivity {
 | 
					public class MainActivity extends WinBoLLActivity {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -128,8 +131,8 @@ public class MainActivity extends WinBoLLActivity {
 | 
				
			|||||||
        super.onResume();
 | 
					        super.onResume();
 | 
				
			||||||
        // 回到窗口自动取消提醒消息
 | 
					        // 回到窗口自动取消提醒消息
 | 
				
			||||||
        //NotificationHelper.cancelRemindNotification(this);
 | 
					        //NotificationHelper.cancelRemindNotification(this);
 | 
				
			||||||
 | 
					 | 
				
			||||||
        reloadBackground();
 | 
					        reloadBackground();
 | 
				
			||||||
 | 
							setBackgroundColor();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Menu icons are inflated just as they were with actionbar
 | 
					    // Menu icons are inflated just as they were with actionbar
 | 
				
			||||||
@@ -206,4 +209,12 @@ public class MainActivity extends WinBoLLActivity {
 | 
				
			|||||||
            moveTaskToBack(true);
 | 
					            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);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
} 
 | 
					} 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@ import android.os.Bundle;
 | 
				
			|||||||
import android.provider.MediaStore;
 | 
					import android.provider.MediaStore;
 | 
				
			||||||
import android.view.View;
 | 
					import android.view.View;
 | 
				
			||||||
import android.widget.ImageView;
 | 
					import android.widget.ImageView;
 | 
				
			||||||
 | 
					import android.widget.RelativeLayout;
 | 
				
			||||||
import androidx.core.app.ActivityCompat;
 | 
					import androidx.core.app.ActivityCompat;
 | 
				
			||||||
import androidx.core.content.ContextCompat;
 | 
					import androidx.core.content.ContextCompat;
 | 
				
			||||||
import cc.winboll.studio.libaes.views.AToolbar;
 | 
					import cc.winboll.studio.libaes.views.AToolbar;
 | 
				
			||||||
@@ -33,7 +34,7 @@ import java.io.FileOutputStream;
 | 
				
			|||||||
import java.io.IOException;
 | 
					import java.io.IOException;
 | 
				
			||||||
import java.io.OutputStream;
 | 
					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 static final String TAG = "BackgroundPictureActivity";
 | 
				
			||||||
    public BackgroundPictureUtils mBackgroundPictureUtils;
 | 
					    public BackgroundPictureUtils mBackgroundPictureUtils;
 | 
				
			||||||
@@ -58,6 +59,16 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
				
			|||||||
    private int mnPictureCompress = 100;
 | 
					    private int mnPictureCompress = 100;
 | 
				
			||||||
    private static String _RecivedPictureFileName;
 | 
					    private static String _RecivedPictureFileName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public Activity getActivity() {
 | 
				
			||||||
 | 
							return this;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public String getTag() {
 | 
				
			||||||
 | 
							return TAG;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
					    protected void onCreate(Bundle savedInstanceState) {
 | 
				
			||||||
        super.onCreate(savedInstanceState);
 | 
					        super.onCreate(savedInstanceState);
 | 
				
			||||||
@@ -102,6 +113,8 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
				
			|||||||
        findViewById(R.id.activitybackgroundpictureAButton2).setOnClickListener(onSelectPictureClickListener);
 | 
					        findViewById(R.id.activitybackgroundpictureAButton2).setOnClickListener(onSelectPictureClickListener);
 | 
				
			||||||
        findViewById(R.id.activitybackgroundpictureAButton3).setOnClickListener(onCropPictureClickListener);
 | 
					        findViewById(R.id.activitybackgroundpictureAButton3).setOnClickListener(onCropPictureClickListener);
 | 
				
			||||||
        findViewById(R.id.activitybackgroundpictureAButton6).setOnClickListener(onCropFreePictureClickListener);
 | 
					        findViewById(R.id.activitybackgroundpictureAButton6).setOnClickListener(onCropFreePictureClickListener);
 | 
				
			||||||
 | 
							findViewById(R.id.activitybackgroundpictureAButton7).setOnClickListener(onPixelPickerClickListener);
 | 
				
			||||||
 | 
							findViewById(R.id.activitybackgroundpictureAButton8).setOnClickListener(onCleanPixelClickListener);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        updatePreviewBackground();
 | 
					        updatePreviewBackground();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -154,10 +167,10 @@ public class BackgroundPictureActivity extends Activity implements BackgroundPic
 | 
				
			|||||||
                String filePath = utils.getBackgroundDir() + getBackgroundFileName();
 | 
					                String filePath = utils.getBackgroundDir() + getBackgroundFileName();
 | 
				
			||||||
                Drawable drawable = FileUtils.getImageDrawable(filePath);
 | 
					                Drawable drawable = FileUtils.getImageDrawable(filePath);
 | 
				
			||||||
                if (drawable != null) {
 | 
					                if (drawable != null) {
 | 
				
			||||||
                    drawable.setAlpha(120);
 | 
					                    //drawable.setAlpha(120);
 | 
				
			||||||
                    ivPreviewBackground.setImageDrawable(drawable);
 | 
					                    ivPreviewBackground.setImageDrawable(drawable);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                ToastUtils.show("背景图片已更新");
 | 
					                //ToastUtils.show("背景图片已更新");
 | 
				
			||||||
            } catch (IOException e) {
 | 
					            } catch (IOException e) {
 | 
				
			||||||
                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
					                LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
 | 
				
			||||||
                ToastUtils.show("背景图片加载失败");
 | 
					                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();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 压缩图片并保存到接收文件
 | 
					     * 压缩图片并保存到接收文件
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -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();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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) {
 | 
				
			||||||
 | 
							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);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
@@ -1,14 +1,19 @@
 | 
				
			|||||||
package cc.winboll.studio.powerbell.activities;
 | 
					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>
 | 
					 * @Author ZhanGSKen<zhangsken@188.com>
 | 
				
			||||||
 * @Date 2025/06/19 20:35
 | 
					 * @Date 2025/06/19 20:35
 | 
				
			||||||
 * @Describe 应用窗口基类
 | 
					 * @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 abstract class WinBoLLActivity extends Activity implements IWinBoLLActivity {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static final String TAG = "WinBoLLActivity";
 | 
					    public static final String TAG = "WinBoLLActivity";
 | 
				
			||||||
@@ -17,4 +22,32 @@ public abstract class WinBoLLActivity extends Activity implements IWinBoLLActivi
 | 
				
			|||||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
					    protected void onCreate(Bundle savedInstanceState) {
 | 
				
			||||||
        super.onCreate(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 backgroundWidth = 100;
 | 
				
			||||||
    int backgroundHeight = 100;
 | 
					    int backgroundHeight = 100;
 | 
				
			||||||
    boolean isUseBackgroundFile = false;
 | 
					    boolean isUseBackgroundFile = false;
 | 
				
			||||||
 | 
						// 图片拾取像素颜色
 | 
				
			||||||
 | 
						int pixelColor = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public BackgroundPictureBean() {
 | 
					    public BackgroundPictureBean() {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -25,6 +27,14 @@ public class BackgroundPictureBean extends BaseBean {
 | 
				
			|||||||
        this.isUseBackgroundFile = isUseBackgroundFile;
 | 
					        this.isUseBackgroundFile = isUseBackgroundFile;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setPixelColor(int pixelColor) {
 | 
				
			||||||
 | 
							this.pixelColor = pixelColor;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public int getPixelColor() {
 | 
				
			||||||
 | 
							return pixelColor;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void setBackgroundWidth(int backgroundWidth) {
 | 
					    public void setBackgroundWidth(int backgroundWidth) {
 | 
				
			||||||
        this.backgroundWidth = backgroundWidth;
 | 
					        this.backgroundWidth = backgroundWidth;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -61,6 +71,7 @@ public class BackgroundPictureBean extends BaseBean {
 | 
				
			|||||||
        jsonWriter.name("backgroundWidth").value(bean.getBackgroundWidth());
 | 
					        jsonWriter.name("backgroundWidth").value(bean.getBackgroundWidth());
 | 
				
			||||||
        jsonWriter.name("backgroundHeight").value(bean.getBackgroundHeight());
 | 
					        jsonWriter.name("backgroundHeight").value(bean.getBackgroundHeight());
 | 
				
			||||||
        jsonWriter.name("isUseBackgroundFile").value(bean.isUseBackgroundFile());
 | 
					        jsonWriter.name("isUseBackgroundFile").value(bean.isUseBackgroundFile());
 | 
				
			||||||
 | 
							jsonWriter.name("pixelColor").value(bean.getPixelColor());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -75,6 +86,8 @@ public class BackgroundPictureBean extends BaseBean {
 | 
				
			|||||||
                bean.setBackgroundHeight(jsonReader.nextInt());
 | 
					                bean.setBackgroundHeight(jsonReader.nextInt());
 | 
				
			||||||
            } else if (name.equals("isUseBackgroundFile")) {
 | 
					            } else if (name.equals("isUseBackgroundFile")) {
 | 
				
			||||||
                bean.setIsUseBackgroundFile(jsonReader.nextBoolean());
 | 
					                bean.setIsUseBackgroundFile(jsonReader.nextBoolean());
 | 
				
			||||||
 | 
					            } else if (name.equals("pixelColor")) {
 | 
				
			||||||
 | 
					                bean.setPixelColor(jsonReader.nextInt());
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                jsonReader.skipValue();
 | 
					                jsonReader.skipValue();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -311,11 +311,11 @@ public class MainViewFragment extends Fragment {
 | 
				
			|||||||
        LogUtils.d(TAG, String.format("fBackgroundFilePath.exists() %s", fBackgroundFilePath.exists()));
 | 
					        LogUtils.d(TAG, String.format("fBackgroundFilePath.exists() %s", fBackgroundFilePath.exists()));
 | 
				
			||||||
        if (bean.isUseBackgroundFile() && fBackgroundFilePath.exists()) {
 | 
					        if (bean.isUseBackgroundFile() && fBackgroundFilePath.exists()) {
 | 
				
			||||||
            Drawable drawableBackground = Drawable.createFromPath(szBackgroundFilePath);
 | 
					            Drawable drawableBackground = Drawable.createFromPath(szBackgroundFilePath);
 | 
				
			||||||
            drawableBackground.setAlpha(120);
 | 
					            //drawableBackground.setAlpha(120);
 | 
				
			||||||
            imageView.setImageDrawable(drawableBackground);
 | 
					            imageView.setImageDrawable(drawableBackground);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            Drawable drawableBackground = getActivity().getDrawable(R.drawable.blank10x10);
 | 
					            Drawable drawableBackground = getActivity().getDrawable(R.drawable.blank10x10);
 | 
				
			||||||
            drawableBackground.setAlpha(120);
 | 
					            //drawableBackground.setAlpha(120);
 | 
				
			||||||
            imageView.setImageDrawable(drawableBackground);
 | 
					            imageView.setImageDrawable(drawableBackground);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<RelativeLayout
 | 
					<LinearLayout
 | 
				
			||||||
	xmlns:android="http://schemas.android.com/apk/res/android"
 | 
						xmlns:android="http://schemas.android.com/apk/res/android"
 | 
				
			||||||
	xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
						xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
				
			||||||
	android:orientation="vertical"
 | 
						android:orientation="vertical"
 | 
				
			||||||
@@ -12,6 +12,16 @@
 | 
				
			|||||||
		android:id="@+id/toolbar"
 | 
							android:id="@+id/toolbar"
 | 
				
			||||||
		style="@style/DefaultAToolbar"/>
 | 
							style="@style/DefaultAToolbar"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						<RelativeLayout
 | 
				
			||||||
 | 
							android:layout_width="wrap_content"
 | 
				
			||||||
 | 
							android:layout_height="wrap_content">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<RelativeLayout
 | 
				
			||||||
 | 
								android:layout_width="match_parent"
 | 
				
			||||||
 | 
								android:layout_height="match_parent"
 | 
				
			||||||
 | 
								android:id="@+id/activitybackgroundpictureRelativeLayout1"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		<ImageView
 | 
							<ImageView
 | 
				
			||||||
			android:layout_width="match_parent"
 | 
								android:layout_width="match_parent"
 | 
				
			||||||
			android:layout_height="match_parent"
 | 
								android:layout_height="match_parent"
 | 
				
			||||||
@@ -59,7 +69,7 @@
 | 
				
			|||||||
					android:layout_height="36dp"
 | 
										android:layout_height="36dp"
 | 
				
			||||||
					android:text="◎"
 | 
										android:text="◎"
 | 
				
			||||||
					android:layout_gravity="center_vertical"
 | 
										android:layout_gravity="center_vertical"
 | 
				
			||||||
				android:layout_margin="10dp"
 | 
										android:layout_margin="5dp"
 | 
				
			||||||
					android:id="@+id/activitybackgroundpictureAButton1"/>
 | 
										android:id="@+id/activitybackgroundpictureAButton1"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				<cc.winboll.studio.libaes.views.AButton
 | 
									<cc.winboll.studio.libaes.views.AButton
 | 
				
			||||||
@@ -67,7 +77,7 @@
 | 
				
			|||||||
					android:layout_height="36dp"
 | 
										android:layout_height="36dp"
 | 
				
			||||||
					android:text="☑"
 | 
										android:text="☑"
 | 
				
			||||||
					android:layout_gravity="center_vertical"
 | 
										android:layout_gravity="center_vertical"
 | 
				
			||||||
				android:layout_margin="10dp"
 | 
										android:layout_margin="5dp"
 | 
				
			||||||
					android:id="@+id/activitybackgroundpictureAButton2"/>
 | 
										android:id="@+id/activitybackgroundpictureAButton2"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				<cc.winboll.studio.libaes.views.AButton
 | 
									<cc.winboll.studio.libaes.views.AButton
 | 
				
			||||||
@@ -75,7 +85,7 @@
 | 
				
			|||||||
					android:layout_height="36dp"
 | 
										android:layout_height="36dp"
 | 
				
			||||||
					android:text="[+]"
 | 
										android:text="[+]"
 | 
				
			||||||
					android:layout_gravity="center_vertical"
 | 
										android:layout_gravity="center_vertical"
 | 
				
			||||||
				android:layout_margin="10dp"
 | 
										android:layout_margin="5dp"
 | 
				
			||||||
					android:id="@+id/activitybackgroundpictureAButton3"/>
 | 
										android:id="@+id/activitybackgroundpictureAButton3"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				<cc.winboll.studio.libaes.views.AButton
 | 
									<cc.winboll.studio.libaes.views.AButton
 | 
				
			||||||
@@ -83,12 +93,29 @@
 | 
				
			|||||||
					android:layout_height="36dp"
 | 
										android:layout_height="36dp"
 | 
				
			||||||
					android:text="[+~]"
 | 
										android:text="[+~]"
 | 
				
			||||||
					android:layout_gravity="center_vertical"
 | 
										android:layout_gravity="center_vertical"
 | 
				
			||||||
				android:layout_margin="10dp"
 | 
										android:layout_margin="5dp"
 | 
				
			||||||
					android:id="@+id/activitybackgroundpictureAButton6"/>
 | 
										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>
 | 
							</LinearLayout>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	</RelativeLayout>
 | 
						</RelativeLayout>
 | 
				
			||||||
 | 
					</LinearLayout>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,11 +6,6 @@
 | 
				
			|||||||
	android:layout_height="match_parent"
 | 
						android:layout_height="match_parent"
 | 
				
			||||||
	android:orientation="vertical">
 | 
						android:orientation="vertical">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<LinearLayout
 | 
					 | 
				
			||||||
		android:orientation="horizontal"
 | 
					 | 
				
			||||||
		android:layout_width="match_parent"
 | 
					 | 
				
			||||||
		android:layout_height="wrap_content">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	<cc.winboll.studio.libaes.views.AToolbar
 | 
						<cc.winboll.studio.libaes.views.AToolbar
 | 
				
			||||||
		android:layout_width="match_parent"
 | 
							android:layout_width="match_parent"
 | 
				
			||||||
		android:layout_height="@dimen/toolbar_height"
 | 
							android:layout_height="@dimen/toolbar_height"
 | 
				
			||||||
@@ -18,20 +13,23 @@
 | 
				
			|||||||
		android:gravity="center_vertical"
 | 
							android:gravity="center_vertical"
 | 
				
			||||||
		style="@style/DefaultAToolbar"/>
 | 
							style="@style/DefaultAToolbar"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	</LinearLayout>
 | 
						<RelativeLayout
 | 
				
			||||||
 | 
					 | 
				
			||||||
	<LinearLayout
 | 
					 | 
				
			||||||
		android:orientation="vertical"
 | 
					 | 
				
			||||||
		android:layout_width="match_parent"
 | 
							android:layout_width="match_parent"
 | 
				
			||||||
		android:layout_height="wrap_content"
 | 
							android:layout_height="0dp"
 | 
				
			||||||
		android:layout_weight="1.0">
 | 
							android:layout_weight="1.0">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<RelativeLayout
 | 
				
			||||||
 | 
								android:layout_width="match_parent"
 | 
				
			||||||
 | 
								android:layout_height="match_parent"
 | 
				
			||||||
 | 
								android:id="@+id/activitymainRelativeLayout1"
 | 
				
			||||||
 | 
								android:background="#FFEE2121"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		<FrameLayout
 | 
							<FrameLayout
 | 
				
			||||||
			android:layout_width="match_parent"
 | 
								android:layout_width="match_parent"
 | 
				
			||||||
			android:layout_height="match_parent"
 | 
								android:layout_height="match_parent"
 | 
				
			||||||
			android:id="@+id/activitymainFrameLayout1"/>
 | 
								android:id="@+id/activitymainFrameLayout1"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	</LinearLayout>
 | 
						</RelativeLayout>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</LinearLayout>
 | 
					</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>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -15,6 +15,7 @@
 | 
				
			|||||||
    <string name="texthint_CustomSlideToCleanRecord">Slide Right To Clean Up APP Record.</string>
 | 
					    <string name="texthint_CustomSlideToCleanRecord">Slide Right To Clean Up APP Record.</string>
 | 
				
			||||||
    <string name="subtitle_activity_clearrecord">清理记录</string>
 | 
					    <string name="subtitle_activity_clearrecord">清理记录</string>
 | 
				
			||||||
    <string name="subtitle_activity_backgroundpicture">更换背景图片</string>
 | 
					    <string name="subtitle_activity_backgroundpicture">更换背景图片</string>
 | 
				
			||||||
 | 
					    <string name="subtitle_activity_pixelpicker">背景像素拾取</string>
 | 
				
			||||||
    <string name="subtitle_activity_about">关于应用</string>
 | 
					    <string name="subtitle_activity_about">关于应用</string>
 | 
				
			||||||
    <string name="msg_AOHPCTCSeekBar_ClearRecord">>>>Seek 100% To Clear Battery Record.>>></string>
 | 
					    <string name="msg_AOHPCTCSeekBar_ClearRecord">>>>Seek 100% To Clear Battery Record.>>></string>
 | 
				
			||||||
</resources>
 | 
					</resources>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@
 | 
				
			|||||||
    <string name="texthint_CustomSlideToCleanRecord">Slide Right To Clean Up APP Record.</string>
 | 
					    <string name="texthint_CustomSlideToCleanRecord">Slide Right To Clean Up APP Record.</string>
 | 
				
			||||||
    <string name="subtitle_activity_clearrecord">Clean Record</string>
 | 
					    <string name="subtitle_activity_clearrecord">Clean Record</string>
 | 
				
			||||||
    <string name="subtitle_activity_backgroundpicture">Background Picture</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="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% To Clear Battery Record.>>></string>
 | 
				
			||||||
</resources>
 | 
					</resources>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user