优化背景像素拾取UI
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Jun 23 06:26:53 GMT 2025
|
#Mon Jun 23 06:46:57 GMT 2025
|
||||||
stageCount=5
|
stageCount=5
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.4
|
baseVersion=15.4
|
||||||
publishVersion=15.4.4
|
publishVersion=15.4.4
|
||||||
buildCount=10
|
buildCount=19
|
||||||
baseBetaVersion=15.4.5
|
baseBetaVersion=15.4.5
|
||||||
|
|||||||
@@ -15,18 +15,18 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libaes.views.AToolbar;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
|
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
|
||||||
import cc.winboll.studio.powerbell.R;
|
import cc.winboll.studio.powerbell.R;
|
||||||
import cc.winboll.studio.powerbell.activities.BackgroundPictureActivity;
|
|
||||||
import cc.winboll.studio.powerbell.activities.PixelPickerActivity;
|
import cc.winboll.studio.powerbell.activities.PixelPickerActivity;
|
||||||
import cc.winboll.studio.powerbell.beans.BackgroundPictureBean;
|
import cc.winboll.studio.powerbell.beans.BackgroundPictureBean;
|
||||||
import cc.winboll.studio.powerbell.utils.BackgroundPictureUtils;
|
import cc.winboll.studio.powerbell.utils.BackgroundPictureUtils;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import cc.winboll.studio.powerbell.App;
|
|
||||||
|
|
||||||
public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
||||||
|
|
||||||
@@ -42,9 +42,7 @@ public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActi
|
|||||||
return TAG;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private AToolbar mAToolbar;
|
||||||
|
|
||||||
|
|
||||||
private ImageView imageView;
|
private ImageView imageView;
|
||||||
private Bitmap originalBitmap;
|
private Bitmap originalBitmap;
|
||||||
private TextView infoText;
|
private TextView infoText;
|
||||||
@@ -55,6 +53,19 @@ public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActi
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_pixelpicker);
|
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);
|
imageView = findViewById(R.id.imageView);
|
||||||
infoText = findViewById(R.id.infoText);
|
infoText = findViewById(R.id.infoText);
|
||||||
imageContainer = findViewById(R.id.imageContainer);
|
imageContainer = findViewById(R.id.imageContainer);
|
||||||
@@ -183,6 +194,7 @@ public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActi
|
|||||||
bean.setPixelColor(pixelColor);
|
bean.setPixelColor(pixelColor);
|
||||||
utils.saveData();
|
utils.saveData();
|
||||||
Toast.makeText(PixelPickerActivity.this, "已记录像素值", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PixelPickerActivity.this, "已记录像素值", Toast.LENGTH_SHORT).show();
|
||||||
|
setBackgroundColor();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,7 +210,21 @@ public class PixelPickerActivity extends WinBoLLActivity implements IWinBoLLActi
|
|||||||
originalBitmap = null;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,54 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_height="match_parent">
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<cc.winboll.studio.libaes.views.AToolbar
|
||||||
android:id="@+id/imageContainer"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="@dimen/toolbar_height"
|
||||||
android:layout_height="match_parent">
|
android:id="@+id/toolbar"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
style="@style/DefaultAToolbar"/>
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:id="@+id/imageView"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_weight="1.0">
|
||||||
android:layout_gravity="center"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/ic_launcher" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<TextView
|
<RelativeLayout
|
||||||
android:id="@+id/infoText"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:background="#FFEE2121"
|
||||||
android:layout_alignParentBottom="true"
|
android:id="@+id/activitypixelpickerRelativeLayout1"/>
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:padding="10dp"
|
<FrameLayout
|
||||||
android:background="#80000000"
|
android:id="@+id/imageContainer"
|
||||||
android:textColor="#FFFFFF"
|
android:layout_width="match_parent"
|
||||||
android:text="点击图片获取像素值" />
|
android:layout_height="match_parent">
|
||||||
</RelativeLayout>
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|||||||
@@ -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