-
Notifications
You must be signed in to change notification settings - Fork 54
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
f83e101
commit dde0e5d
Showing
18 changed files
with
739 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
org.gradle.jvmargs=-Xmx1536m | ||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
|
||
#NDK版本差异检测过滤掉,要不然项目无法编译 | ||
android.useDeprecatedNdk=true |
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
16 changes: 16 additions & 0 deletions
16
sample/src/main/java/com/sample/ui/activity/view/ShapeViewActivity.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,16 @@ | ||
package com.sample.ui.activity.view; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
import com.sample.R; | ||
import com.sample.ui.activity.BaseActivity; | ||
|
||
public class ShapeViewActivity extends BaseActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_shape_view); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.sample.util; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
|
||
import com.sample.ui.activity.view.DialogActivity; | ||
import com.sample.ui.activity.view.ImageSpanActivity; | ||
import com.sample.ui.activity.view.QQStepViewActivity; | ||
import com.sample.ui.activity.view.ShapeViewActivity; | ||
|
||
/** | ||
* @Created SiberiaDante | ||
* @Describe: | ||
* @Time: 2017/9/4 | ||
* @Email: 994537867@qq.com | ||
* @GitHub: https://github.com/SiberiaDante | ||
*/ | ||
|
||
public class JumpUtils { | ||
|
||
private static Intent intent; | ||
|
||
public static void goToDialogActivity(Activity activity) { | ||
intent = new Intent(activity, DialogActivity.class); | ||
activity.startActivity(intent); | ||
} | ||
|
||
public static void goToQQStepViewActivity(Activity activity) { | ||
intent = new Intent(activity, QQStepViewActivity.class); | ||
activity.startActivity(intent); | ||
} | ||
|
||
public static void goToImageSpanActivity(Activity activity) { | ||
intent = new Intent(activity, ImageSpanActivity.class); | ||
activity.startActivity(intent); | ||
} | ||
|
||
public static void goToShapeViewActivity(Activity activity) { | ||
intent = new Intent(activity, ShapeViewActivity.class); | ||
activity.startActivity(intent); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:dante="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/activity_shape_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:orientation="vertical" | ||
tools:context="com.sample.ui.activity.view.ShapeViewActivity"> | ||
|
||
<com.siberiadante.lib.widget.RoundTextView | ||
android:layout_width="200dp" | ||
android:layout_height="50dp" | ||
android:gravity="center" | ||
android:text="RoundTextView" | ||
dante:r_backgroundColor="@color/action_sheet_blue" | ||
dante:r_cornerRadius="10dp" /> | ||
|
||
<com.siberiadante.lib.widget.RoundLinearLayout | ||
android:layout_width="200dp" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="20dp" | ||
dante:r_backgroundColor="@color/action_sheet_blue" | ||
dante:r_cornerRadius_TL="20dp" /> | ||
|
||
<com.siberiadante.lib.widget.RoundRelativeLayout | ||
android:layout_width="200dp" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="20dp" | ||
dante:r_backgroundColor="@color/action_sheet_blue" | ||
dante:r_cornerRadius_TR="20dp" /> | ||
|
||
<com.siberiadante.lib.widget.RoundFrameLayout | ||
android:layout_width="200dp" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="20dp" | ||
dante:r_backgroundColor="@color/action_sheet_blue" | ||
dante:r_cornerRadius_BL="20dp" /> | ||
</LinearLayout> | ||
|
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
54 changes: 54 additions & 0 deletions
54
siberiadante/src/main/java/com/siberiadante/lib/widget/RoundFrameLayout.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,54 @@ | ||
package com.siberiadante.lib.widget; | ||
|
||
import android.content.Context; | ||
import android.util.AttributeSet; | ||
import android.widget.FrameLayout; | ||
import android.widget.RelativeLayout; | ||
|
||
/** | ||
* @Created SiberiaDante | ||
* @Describe: 简化FrameLayout shape 画背景 | ||
* @Time: 2017/9/4 | ||
* @Email: 994537867@qq.com | ||
* @GitHub: https://github.com/SiberiaDante | ||
*/ | ||
|
||
public class RoundFrameLayout extends FrameLayout { | ||
|
||
private RoundViewAttr roundViewAttr; | ||
|
||
public RoundFrameLayout(Context context) { | ||
this(context, null); | ||
} | ||
|
||
public RoundFrameLayout(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
roundViewAttr = new RoundViewAttr(this, context, attrs); | ||
|
||
} | ||
|
||
public RoundViewAttr getRoundViewAttr() { | ||
return roundViewAttr; | ||
} | ||
|
||
@Override | ||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
if (roundViewAttr.isWidthHeightEqual() && getWidth() > 0 && getHeight() > 0) { | ||
int max = Math.max(getWidth(), getHeight()); | ||
int measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY); | ||
super.onMeasure(measureSpec, measureSpec); | ||
return; | ||
} | ||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | ||
} | ||
|
||
@Override | ||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) { | ||
super.onLayout(changed, left, top, right, bottom); | ||
if (roundViewAttr.isRadiusHalfHeight()) { | ||
roundViewAttr.setCornerRadius(getHeight() / 2); | ||
} else { | ||
roundViewAttr.setBgSelector(); | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
siberiadante/src/main/java/com/siberiadante/lib/widget/RoundLinearLayout.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,54 @@ | ||
package com.siberiadante.lib.widget; | ||
|
||
import android.content.Context; | ||
import android.util.AttributeSet; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
/** | ||
* @Created SiberiaDante | ||
* @Describe: 简化LinearLayout shape 画背景 | ||
* @Time: 2017/9/4 | ||
* @Email: 994537867@qq.com | ||
* @GitHub: https://github.com/SiberiaDante | ||
*/ | ||
|
||
public class RoundLinearLayout extends LinearLayout { | ||
|
||
private RoundViewAttr roundViewAttr; | ||
|
||
public RoundLinearLayout(Context context) { | ||
this(context, null); | ||
} | ||
|
||
public RoundLinearLayout(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
roundViewAttr = new RoundViewAttr(this, context, attrs); | ||
|
||
} | ||
|
||
public RoundViewAttr getRoundViewAttr() { | ||
return roundViewAttr; | ||
} | ||
|
||
@Override | ||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
if (roundViewAttr.isWidthHeightEqual() && getWidth() > 0 && getHeight() > 0) { | ||
int max = Math.max(getWidth(), getHeight()); | ||
int measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY); | ||
super.onMeasure(measureSpec, measureSpec); | ||
return; | ||
} | ||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | ||
} | ||
|
||
@Override | ||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) { | ||
super.onLayout(changed, left, top, right, bottom); | ||
if (roundViewAttr.isRadiusHalfHeight()) { | ||
roundViewAttr.setCornerRadius(getHeight() / 2); | ||
} else { | ||
roundViewAttr.setBgSelector(); | ||
} | ||
} | ||
} |
Oops, something went wrong.