-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6711c8b
commit e3dee20
Showing
11 changed files
with
201 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
mvvm-base/src/main/java/com/base/ui/widget/MaxHeightScrollView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.base.ui.widget; | ||
|
||
import android.content.Context; | ||
import android.content.res.TypedArray; | ||
import android.support.v4.widget.NestedScrollView; | ||
import android.util.AttributeSet; | ||
|
||
import com.base.R; | ||
|
||
public class MaxHeightScrollView extends NestedScrollView { | ||
|
||
private int maxHeight; | ||
|
||
public MaxHeightScrollView(Context context) { | ||
super(context); | ||
} | ||
|
||
public MaxHeightScrollView(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
init(context, attrs); | ||
} | ||
|
||
public MaxHeightScrollView(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
init(context, attrs); | ||
} | ||
|
||
private void init(Context context, AttributeSet attrs) { | ||
if (attrs != null) { | ||
TypedArray styledAttrs = context.obtainStyledAttributes(attrs, R.styleable.MaxHeightScrollView); | ||
maxHeight = styledAttrs.getDimensionPixelSize(R.styleable.MaxHeightScrollView_maxHeight, 200); //200 is a defualt value | ||
styledAttrs.recycle(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.AT_MOST); | ||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
mvvm-base/src/main/java/com/base/ui/widget/RoundRectCornerImageView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.base.ui.widget; | ||
|
||
import android.content.Context; | ||
import android.graphics.Canvas; | ||
import android.graphics.Path; | ||
import android.graphics.RectF; | ||
import android.util.AttributeSet; | ||
|
||
public class RoundRectCornerImageView extends android.support.v7.widget.AppCompatImageView { | ||
|
||
private float radius = 5.0f; | ||
private Path path; | ||
private RectF rect; | ||
|
||
public RoundRectCornerImageView(Context context) { | ||
super(context); | ||
init(); | ||
} | ||
|
||
public RoundRectCornerImageView(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
init(); | ||
} | ||
|
||
public RoundRectCornerImageView(Context context, AttributeSet attrs, int defStyle) { | ||
super(context, attrs, defStyle); | ||
init(); | ||
} | ||
|
||
private void init() { | ||
path = new Path(); | ||
|
||
} | ||
|
||
@Override | ||
protected void onDraw(Canvas canvas) { | ||
rect = new RectF(0, 0, this.getWidth(), this.getHeight()); | ||
path.addRoundRect(rect, radius, radius, Path.Direction.CW); | ||
canvas.clipPath(path); | ||
super.onDraw(canvas); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
mvvm-base/src/main/java/com/base/ui/widget/SquareImageView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.base.ui.widget; | ||
|
||
import android.content.Context; | ||
import android.util.AttributeSet; | ||
|
||
/** | ||
* Created by Ka on 04/07/2016. | ||
*/ | ||
public class SquareImageView extends android.support.v7.widget.AppCompatImageView { | ||
|
||
public SquareImageView(Context context) { | ||
super(context); | ||
} | ||
|
||
public SquareImageView(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
super.onMeasure(widthMeasureSpec, widthMeasureSpec); | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
mvvm-base/src/main/java/com/base/utils/ImageLoaderUtils.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.