Skip to content

Commit d2e24f8

Browse files
committed
adding iimage padding
1 parent 4b851f9 commit d2e24f8

9 files changed

Lines changed: 135 additions & 9 deletions

File tree

.idea/codeStyles/Project.xml

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 29
55
defaultConfig {
66
applicationId "net.innoflash.iosviews"
77
minSdkVersion 15
8-
targetSdkVersion 28
8+
targetSdkVersion 29
99
versionCode 1
1010
versionName "1.0"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
android:layout_height="wrap_content"
4747
app:liv_has_image="true"
4848
app:liv_text_color="@color/ios_red"
49+
app:liv_icon_padding="@dimen/chip_text_size"
4950
app:liv_text="@string/app_name" />
5051
</androidx.cardview.widget.CardView>
5152

iosview/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 29
55

66

77
defaultConfig {
88
minSdkVersion 15
9-
targetSdkVersion 28
9+
targetSdkVersion 29
1010
versionCode 1
1111
versionName "1.0"
1212

iosview/src/main/java/net/innoflash/iosview/lists/ListItemView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class ListItemView extends LinearLayout {
2525
private int image;
2626
private int closeIcon;
2727
private int textColor;
28+
private int iconPadding;
2829
private boolean hasLine;
2930
private boolean hasImage;
3031
private boolean circularImage;
@@ -53,6 +54,7 @@ private void readAttributes(TypedArray typedArray) {
5354
setCircularImage(typedArray.getBoolean(R.styleable.ListItemView_liv_circular_image, true));
5455
setTextColor(typedArray.getColor(R.styleable.ListItemView_liv_text_color, getResources().getColor(R.color.black)));
5556
setHasImage(typedArray.getBoolean(R.styleable.ListItemView_liv_has_image, true));
57+
setIconPadding(typedArray.getDimensionPixelSize(R.styleable.ListItemView_liv_icon_padding, 0));
5658
}
5759

5860
private void init() {
@@ -64,6 +66,15 @@ private void init() {
6466
closeIconView = findViewById(R.id.close_button);
6567
}
6668

69+
public int getIconPadding() {
70+
return iconPadding;
71+
}
72+
73+
public void setIconPadding(int iconPadding) {
74+
this.iconPadding = iconPadding;
75+
getCircleImageView().setPadding(iconPadding, iconPadding, iconPadding, iconPadding);
76+
}
77+
6778
public ImageView getImageView() {
6879
if (circularImage)
6980
return getCircleImageView();

iosview/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
</declare-styleable>
4242
<declare-styleable name="ListItemView">
4343
<attr name="liv_icon" format="reference" />
44+
<attr name="liv_icon_padding" format="reference" />
4445
<attr name="liv_text" format="string" />
4546
<attr name="liv_arrow" format="reference" />
4647
<attr name="liv_has_line" format="boolean" />

0 commit comments

Comments
 (0)