Skip to content

Commit 38bd4d1

Browse files
committed
增加颜色值的透明度.
修改阴影的颜色值, 增加 ShapeLoadingDialog 类
1 parent 64e0c03 commit 38bd4d1

23 files changed

+441
-112
lines changed

.idea/gradle.xml

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

.idea/misc.xml

Lines changed: 25 additions & 2 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.

android-shapeLoadingView.iml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id="android-shapeLoadingView" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="java-gradle" name="Java-Gradle">
55
<configuration>
66
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
78
</configuration>
89
</facet>
910
</component>
10-
<component name="NewModuleRootManager" inherit-compiler-output="true">
11+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
1112
<exclude-output />
1213
<content url="file://$MODULE_DIR$">
1314
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
1415
</content>
1516
<orderEntry type="inheritedJdk" />
1617
<orderEntry type="sourceFolder" forTests="false" />
1718
</component>
18-
</module>
19-
19+
</module>

app/app.iml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="android-shapeLoadingView" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="android-shapeLoadingView" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
@@ -13,8 +13,11 @@
1313
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
1414
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
1515
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
16-
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
17-
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
16+
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
17+
<afterSyncTasks>
18+
<task>generateDebugAndroidTestSources</task>
19+
<task>generateDebugSources</task>
20+
</afterSyncTasks>
1821
<option name="ALLOW_USER_CONFIGURATION" value="false" />
1922
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
2023
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
@@ -23,7 +26,7 @@
2326
</configuration>
2427
</facet>
2528
</component>
26-
<component name="NewModuleRootManager" inherit-compiler-output="false">
29+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
2730
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
2831
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
2932
<exclude-output />
@@ -91,5 +94,4 @@
9194
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
9295
<orderEntry type="module" module-name="shapeloading" exported="" />
9396
</component>
94-
</module>
95-
97+
</module>

app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
<category android:name="android.intent.category.LAUNCHER" />
1717
</intent-filter>
1818
</activity>
19+
<activity
20+
android:name=".ViewDemoActivity"
21+
android:label="@string/title_activity_view_demo" >
22+
</activity>
23+
<activity
24+
android:name=".DialogDemoActivity"
25+
android:label="@string/title_activity_dialog_demo" >
26+
</activity>
1927
</application>
2028

2129
</manifest>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.mingle;
2+
3+
import android.support.v7.app.ActionBarActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.view.View;
8+
9+
import com.mingle.widget.ShapeLoadingDialog;
10+
11+
public class DialogDemoActivity extends ActionBarActivity {
12+
13+
private ShapeLoadingDialog shapeLoadingDialog;
14+
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
setContentView(R.layout.activity_dialog_demo);
19+
shapeLoadingDialog=new ShapeLoadingDialog(this);
20+
shapeLoadingDialog.setLoadingText("加载中...");
21+
22+
23+
findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
24+
@Override
25+
public void onClick(View v) {
26+
27+
shapeLoadingDialog.show();
28+
}
29+
});
30+
}
31+
32+
@Override
33+
public boolean onCreateOptionsMenu(Menu menu) {
34+
// Inflate the menu; this adds items to the action bar if it is present.
35+
// getMenuInflater().inflate(R.menu.menu_dialog_demo, menu);
36+
return true;
37+
}
38+
39+
@Override
40+
public boolean onOptionsItemSelected(MenuItem item) {
41+
// Handle action bar item clicks here. The action bar will
42+
// automatically handle clicks on the Home/Up button, so long
43+
// as you specify a parent activity in AndroidManifest.xml.
44+
int id = item.getItemId();
45+
46+
//noinspection SimplifiableIfStatement
47+
if (id == R.id.action_settings) {
48+
return true;
49+
}
50+
51+
return super.onOptionsItemSelected(item);
52+
}
53+
}

app/src/main/java/com/mingle/MainActivity.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
11
package com.mingle;
22

3+
import android.content.Intent;
34
import android.support.v7.app.ActionBarActivity;
45
import android.os.Bundle;
6+
import android.view.LayoutInflater;
57
import android.view.Menu;
68
import android.view.MenuItem;
9+
import android.view.View;
710

11+
import com.mingle.widget.ShapeLoadingDialog;
812

913

1014
public class MainActivity extends ActionBarActivity {
1115

1216

1317

18+
19+
1420
@Override
1521
protected void onCreate(Bundle savedInstanceState) {
1622
super.onCreate(savedInstanceState);
1723
setContentView(R.layout.activity_main);
18-
19-
24+
findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
25+
@Override
26+
public void onClick(View v) {
27+
28+
MainActivity.this.startActivity(new Intent(MainActivity.this,ViewDemoActivity.class));
29+
}
30+
});
31+
findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
32+
@Override
33+
public void onClick(View v) {
34+
35+
MainActivity.this.startActivity(new Intent(MainActivity.this,DialogDemoActivity.class));
36+
}
37+
});
2038

2139
}
2240

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.mingle;
2+
3+
import android.support.v7.app.ActionBarActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
8+
public class ViewDemoActivity extends ActionBarActivity {
9+
10+
@Override
11+
protected void onCreate(Bundle savedInstanceState) {
12+
super.onCreate(savedInstanceState);
13+
setContentView(R.layout.activity_view_demo);
14+
}
15+
16+
@Override
17+
public boolean onCreateOptionsMenu(Menu menu) {
18+
// Inflate the menu; this adds items to the action bar if it is present.
19+
// getMenuInflater().inflate(R.menu.menu_view_demo, menu);
20+
return true;
21+
}
22+
23+
@Override
24+
public boolean onOptionsItemSelected(MenuItem item) {
25+
// Handle action bar item clicks here. The action bar will
26+
// automatically handle clicks on the Home/Up button, so long
27+
// as you specify a parent activity in AndroidManifest.xml.
28+
int id = item.getItemId();
29+
30+
//noinspection SimplifiableIfStatement
31+
if (id == R.id.action_settings) {
32+
return true;
33+
}
34+
35+
return super.onOptionsItemSelected(item);
36+
}
37+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
3+
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
4+
android:paddingRight="@dimen/activity_horizontal_margin"
5+
android:paddingTop="@dimen/activity_vertical_margin"
6+
android:paddingBottom="@dimen/activity_vertical_margin"
7+
tools:context="com.mingle.DialogDemoActivity">
8+
9+
<Button
10+
android:id="@+id/button1"
11+
android:text="show"
12+
android:layout_centerInParent="true"
13+
android:layout_width="fill_parent"
14+
android:layout_height="wrap_content" />
15+
16+
</RelativeLayout>
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
<RelativeLayout
1+
<LinearLayout
22
xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:orientation="vertical"
45
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
56
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
67
android:paddingRight="@dimen/activity_horizontal_margin"
78
android:paddingTop="@dimen/activity_vertical_margin"
89
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
910

1011

11-
<com.mingle.widget.LoadingView
12-
app:loadingText="加载中..."
13-
android:id="@+id/loadView"
12+
13+
14+
<Button
15+
android:id="@+id/button1"
16+
android:text="View"
17+
android:layout_width="fill_parent"
18+
android:layout_height="wrap_content" />
19+
<Button
20+
android:id="@+id/button2"
21+
android:text="Dialog"
1422
android:layout_width="fill_parent"
15-
android:layout_height="fill_parent"/>
23+
android:layout_height="wrap_content" />
24+
25+
26+
1627

1728

18-
</RelativeLayout>
29+
</LinearLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:paddingBottom="@dimen/activity_vertical_margin"
7+
android:paddingLeft="@dimen/activity_horizontal_margin"
8+
android:paddingRight="@dimen/activity_horizontal_margin"
9+
android:paddingTop="@dimen/activity_vertical_margin"
10+
tools:context="com.mingle.ViewDemoActivity">
11+
12+
<com.mingle.widget.LoadingView
13+
android:id="@+id/loadView"
14+
android:layout_width="wrap_content"
15+
android:layout_height="wrap_content"
16+
android:layout_centerInParent="true"
17+
app:loadingText="加载中..." />
18+
19+
</RelativeLayout>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33

44
<string name="hello_world">Hello world!</string>
55
<string name="action_settings">Settings</string>
6+
<string name="title_activity_view_demo">ViewDemoActivity</string>
7+
<string name="title_activity_dialog_demo">DialogDemoActivity</string>
68
</resources>

shapeloading/shapeloading.iml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="android-shapeLoadingView" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id=":shapeloading" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="android-shapeLoadingView" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
@@ -13,8 +13,11 @@
1313
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
1414
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
1515
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
16-
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
17-
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
16+
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
17+
<afterSyncTasks>
18+
<task>generateDebugAndroidTestSources</task>
19+
<task>generateDebugSources</task>
20+
</afterSyncTasks>
1821
<option name="ALLOW_USER_CONFIGURATION" value="false" />
1922
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
2023
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
@@ -24,7 +27,7 @@
2427
</configuration>
2528
</facet>
2629
</component>
27-
<component name="NewModuleRootManager" inherit-compiler-output="false">
30+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
2831
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
2932
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
3033
<exclude-output />
@@ -88,5 +91,4 @@
8891
<orderEntry type="sourceFolder" forTests="false" />
8992
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
9093
</component>
91-
</module>
92-
94+
</module>

0 commit comments

Comments
 (0)