Skip to content

Commit 5a5c7e1

Browse files
author
fengjian
committed
temp commit
1 parent 16a2c03 commit 5a5c7e1

5 files changed

Lines changed: 34 additions & 11 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:left="16dp">
4+
<shape android:shape="rectangle">
5+
<solid android:color="#f00" />
6+
</shape>
7+
</item>
8+
</layer-list>

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ListView android:id="@+id/listview"
88
android:layout_width="match_parent"
99
android:layout_height="wrap_content"
10-
android:divider="@drawable/list_divider"
10+
android:divider="@drawable/list_divider_p"
1111
android:dividerHeight="1dp"></ListView>
1212

1313
</RelativeLayout>

app/src/main/res/layout/activity_resource.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
22
android:layout_width="match_parent"
3-
android:layout_height="match_parent">
3+
android:layout_height="match_parent"
4+
xmlns:app="http://schemas.android.com/apk/res-auto">
45

5-
<!--这个group_container的background一定要设置,
6-
而且要和list_item_bg的list_item_normal一致,
7-
否则效果会不正确。 -->
86
<LinearLayout
97
android:id="@+id/group_container"
108
android:layout_width="wrap_content"
119
android:layout_height="wrap_content"
1210
android:layout_alignParentTop="true"
1311
android:layout_marginTop="48dp"
14-
android:background="#fff"
1512
android:orientation="vertical">
1613

1714
<RelativeLayout
@@ -33,11 +30,12 @@
3330
android:textSize="16sp" />
3431
</RelativeLayout>
3532

36-
<View
33+
<com.jayfeng.lesscode.core.other.SpaceDividerView
3734
android:layout_width="match_parent"
3835
android:layout_height="1px"
39-
android:layout_marginLeft="16dp"
40-
android:background="#f00" />
36+
android:background="#f00"
37+
app:spaceLeft="16dp"
38+
app:spaceColor="@color/list_item_normal"/>
4139

4240
<RelativeLayout
4341
android:id="@+id/phone_container"

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0-beta5'
8+
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
99
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
1010
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1111
// NOTE: Do not place your application dependencies here; they belong

lesscode-core/src/main/java/com/jayfeng/lesscode/core/BitmapLess.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public final class BitmapLess {
9999
}
100100

101101
/**
102-
* 缩放Bitmap
102+
* 缩放Bitmap - 按缩放倍数
103103
*
104104
* @param originBitmap
105105
* @param scaleX
@@ -118,6 +118,23 @@ public final class BitmapLess {
118118
return scaledBitmap;
119119
}
120120

121+
/**
122+
* 缩放Bitmap - 缩放到目标大小
123+
*
124+
* @param originBitmap
125+
* @param dstWidth
126+
* @param dstHeight
127+
* @param recycleOriginBitmap 是否回收传进来的原始Bitmap
128+
* @return
129+
*/
130+
public static Bitmap $scale(Bitmap originBitmap, int dstWidth, int dstHeight, boolean recycleOriginBitmap) {
131+
Bitmap scaledBitmap = Bitmap.createScaledBitmap(originBitmap, dstWidth, dstHeight, true);
132+
if (recycleOriginBitmap && originBitmap != null && !originBitmap.isRecycled()) {
133+
originBitmap.recycle();
134+
}
135+
return scaledBitmap;
136+
}
137+
121138
/**
122139
* 获取缩略图(默认关闭自动旋转)
123140
* @param path

0 commit comments

Comments
 (0)