fix: 修改冷气被切割的问题

This commit is contained in:
2024-09-12 13:25:39 +08:00
parent 98db4d1701
commit 7cd7aa61d8
50 changed files with 154 additions and 5 deletions

BIN
app/release/app-release.apk Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.cariad.cea.aircondition",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
}
],
"minSdkVersionForDexing": 29
}

View File

@@ -19,6 +19,7 @@ public class BaseSimulationWindView extends GifImageView {
protected Paint paint; // 绘制标准线的画笔 protected Paint paint; // 绘制标准线的画笔
protected float touchDownX, touchDownY, touchXDistance, touchYDistance; protected float touchDownX, touchDownY, touchXDistance, touchYDistance;
protected float[] srcScale = new float[2]; protected float[] srcScale = new float[2];
protected float maxDegree = 0;
public BaseSimulationWindView(Context context) { public BaseSimulationWindView(Context context) {
super(context); super(context);
init(context); init(context);
@@ -43,6 +44,7 @@ public class BaseSimulationWindView extends GifImageView {
protected void onLayout(boolean changed, int left, int top, int right, int bottom) { protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom); super.onLayout(changed, left, top, right, bottom);
srcScale = preSrcScale(); srcScale = preSrcScale();
maxDegree = (float) Math.atan2((float) getWidth()/3, getHeight());
} }
protected void init(Context context) { protected void init(Context context) {

View File

@@ -94,10 +94,16 @@ public class SimulationWindBottomView extends BaseSimulationWindView {
canvas.drawBitmap(bufferBitmap, 0, 0, paint); canvas.drawBitmap(bufferBitmap, 0, 0, paint);
Matrix matrix = new Matrix(); Matrix matrix = new Matrix();
// 根据当前点位计算View的旋转角度和缩放比例旋转角度根据X轴的偏移量获取缩放比例按照Y的偏移量获取 // 根据当前点位计算View的旋转角度和缩放比例旋转角度根据X轴的偏移量获取缩放比例按照Y的偏移量获取
float degree = (float) Math.atan2((currentTouchPositionX-(getWidth()/2)), currentTouchPositionY); float degree = (float) Math.atan2((currentTouchPositionX-((double) getWidth() /2)), currentTouchPositionY);
matrix.setSkew(degree, 0f, getWidth()/2, 0); if (degree>0&& degree > maxDegree) {
degree = maxDegree;
}
if (degree<0 && degree < -maxDegree) {
degree = -maxDegree;
}
matrix.setSkew(degree, 0f, (float) getWidth() /2, 0);
float scale = currentTouchPositionY / getHeight(); float scale = currentTouchPositionY / getHeight();
matrix.preScale(1, scale, getWidth()/2, 0); matrix.preScale(1, scale, (float) getWidth() /2, 0);
// 最开始对图片进行缩放处理适配当前ImageView控件 // 最开始对图片进行缩放处理适配当前ImageView控件
matrix.preScale(srcScale[0], srcScale[1]); matrix.preScale(srcScale[0], srcScale[1]);
setImageMatrix(matrix); setImageMatrix(matrix);

View File

@@ -95,6 +95,12 @@ public class SimulationWindTopView extends BaseSimulationWindView {
Matrix matrix = new Matrix(); Matrix matrix = new Matrix();
// // 根据当前点位计算View的旋转角度和缩放比例旋转角度根据X轴的偏移量获取缩放比例按照Y的偏移量获取 // // 根据当前点位计算View的旋转角度和缩放比例旋转角度根据X轴的偏移量获取缩放比例按照Y的偏移量获取
float degree = (float) Math.atan2((currentTouchPositionX-(getWidth()/2)), getHeight()-currentTouchPositionY); float degree = (float) Math.atan2((currentTouchPositionX-(getWidth()/2)), getHeight()-currentTouchPositionY);
if (degree>0&& degree > maxDegree) {
degree = maxDegree;
}
if (degree<0 && degree < -maxDegree) {
degree = -maxDegree;
}
if (getHeight()-currentTouchPositionY<=0) { // 如果当前触控点在底部区域,则不需要变形处理 if (getHeight()-currentTouchPositionY<=0) { // 如果当前触控点在底部区域,则不需要变形处理
degree = 0f; degree = 0f;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1001 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1001 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item
android:drawable="@drawable/cycle_00001"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00001"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00002"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00003"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00004"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00005"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00006"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00007"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00008"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00009"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00010"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00011"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00012"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00013"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00014"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00015"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00016"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00017"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00018"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00019"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00020"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00021"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00022"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00023"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00024"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00025"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00026"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00027"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00028"
android:duration="70"/>
<item
android:drawable="@drawable/cycle_00029"
android:duration="70"/>
</animation-list>

View File

@@ -16,7 +16,7 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintWidth_percent="0.5" app:layout_constraintWidth_percent="0.5"
android:scaleType="matrix" android:scaleType="matrix"
android:src="@drawable/ac_animation_list"/> android:src="@drawable/cycle_animation_list"/>
<com.cariad.cea.aircondition.views.SimulationWindBottomView <com.cariad.cea.aircondition.views.SimulationWindBottomView
android:id="@+id/img_sim_wind_bottom" android:id="@+id/img_sim_wind_bottom"
android:layout_width="0dp" android:layout_width="0dp"
@@ -27,5 +27,5 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintWidth_percent="0.5" app:layout_constraintWidth_percent="0.5"
android:scaleType="matrix" android:scaleType="matrix"
android:src="@drawable/ac_animation_list"/> android:src="@drawable/cycle_animation_list"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="air_codition_padding_horizontal">12dp</dimen>
</resources>