Skip to content

Commit cb5717b

Browse files
committed
Update sample
1 parent 4f44437 commit cb5717b

File tree

13 files changed

+80
-34
lines changed

13 files changed

+80
-34
lines changed

library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveSwipeRefreshLayout.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ private void createWaveView() {
180180
mTarget.measure(
181181
makeMeasureSpecExactly(getMeasuredWidth() - (getPaddingLeft() + getPaddingRight())),
182182
makeMeasureSpecExactly(getMeasuredHeight() - (getPaddingTop() + getPaddingBottom())));
183+
mWaveView.measure(widthMeasureSpec, heightMeasureSpec);
183184

184185
mCircleView.measure();
185186
}
@@ -203,7 +204,7 @@ private void createWaveView() {
203204
mCircleView.layout((thisWidth - circleWidth) / 2, -circleHeight, (thisWidth + circleWidth) / 2,
204205
0);
205206

206-
mWaveView.layout(left, top, right, bottom);
207+
mWaveView.layout(getPaddingLeft(), getPaddingTop(), childRight, childBottom);
207208
}
208209

209210
@Override public boolean onPreDraw() {

library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveView.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.animation.ValueAnimator;
2121
import android.content.Context;
2222
import android.graphics.Canvas;
23-
import android.graphics.Color;
2423
import android.graphics.Paint;
2524
import android.graphics.Path;
2625
import android.graphics.RectF;
@@ -345,7 +344,7 @@ private void initView() {
345344

346345
private void setUpPaint() {
347346
mPaint = new Paint();
348-
mPaint.setColor(Color.BLUE);
347+
mPaint.setColor(0xff2196F3);
349348
mPaint.setAntiAlias(true);
350349
mPaint.setStyle(Paint.Style.FILL);
351350

sample/src/androidTest/java/jp/list/view/amyu/WaveSwipeRefreshLayout/ApplicationTest.java

-13
This file was deleted.

sample/src/main/java/jp/co/recruit_lifestyle/sample/MainActivity.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import android.support.v7.app.AppCompatActivity;
77
import android.view.Menu;
88
import android.view.MenuItem;
9+
import android.view.Window;
10+
import android.view.WindowManager;
911
import android.widget.ArrayAdapter;
1012
import android.widget.ListView;
1113
import java.util.ArrayList;
@@ -20,9 +22,11 @@ public class MainActivity extends AppCompatActivity implements WaveSwipeRefreshL
2022

2123
@Override
2224
protected void onCreate(Bundle savedInstanceState) {
25+
requestWindowFeature(Window.FEATURE_NO_TITLE);
26+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
2327
super.onCreate(savedInstanceState);
24-
setContentView(R.layout.activity_main);
2528

29+
setContentView(R.layout.activity_main);
2630
initView();
2731
setSampleData();
2832
}
@@ -39,7 +43,7 @@ private void initView() {
3943
private void setSampleData() {
4044
ArrayList<String> sampleArrayStr = new ArrayList<>();
4145
for (int i = 0; i < 60; i++) {
42-
sampleArrayStr.add("sample" + i);
46+
sampleArrayStr.add("" );
4347
}
4448
ArrayAdapter<String> adapter = new ArrayAdapter<>(getApplicationContext(), android.R.layout.simple_list_item_1, sampleArrayStr);
4549
mListview.setAdapter(adapter);
@@ -52,7 +56,7 @@ public void run() {
5256
// 更新が終了したらインジケータ非表示
5357
mWaveSwipeRefreshLayout.setRefreshing(false);
5458
}
55-
}, 5000);
59+
}, 3000);
5660
}
5761

5862
@Override
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
3+
<gradient
4+
android:startColor="@android:color/transparent"
5+
android:endColor="#88333333"
6+
android:angle="90"/>
7+
</shape>
+47-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,56 @@
1-
<RelativeLayout android:id="@+id/main_layout"
2-
xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
android:layout_width="match_parent"
5-
android:layout_height="match_parent"
6-
tools:context=".MainActivity">
1+
<LinearLayout
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:id="@+id/main_layout"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:orientation="vertical"
8+
tools:context=".MainActivity"
9+
>
10+
11+
<View
12+
android:layout_width="match_parent"
13+
android:layout_height="25dip"
14+
android:background="@color/primary_dark"
15+
/>
16+
17+
<RelativeLayout
18+
android:layout_width="match_parent"
19+
android:layout_height="wrap_content"
20+
android:layout_weight="1"
21+
>
22+
23+
<Toolbar
24+
android:layout_height="wrap_content"
25+
android:layout_width="match_parent"
26+
android:minHeight="?attr/actionBarSize"
27+
android:background="@color/primary"
28+
android:id="@+id/toolbar"
29+
/>
30+
31+
<View
32+
android:layout_width="match_parent"
33+
android:layout_height="5dp"
34+
android:background="@drawable/toolbar_dropshadow"
35+
android:layout_below="@+id/toolbar"
36+
/>
737

838

939
<jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout
1040
android:layout_width="match_parent"
1141
android:layout_height="match_parent"
12-
android:id="@+id/main_swipe">
42+
android:id="@+id/main_swipe"
43+
android:layout_below="@+id/toolbar"
44+
>
1345

14-
<ListView
15-
android:id="@+id/main_list"
16-
android:layout_width="match_parent"
17-
android:layout_height="match_parent"/>
46+
<ListView
47+
android:id="@+id/main_list"
48+
android:layout_width="match_parent"
49+
android:layout_height="match_parent"
50+
/>
1851

1952
</jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout>
2053

21-
</RelativeLayout>
54+
</RelativeLayout>
55+
56+
</LinearLayout>
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<style name="AppTheme"
5+
parent="Theme.AppCompat.Light.NoActionBar">
6+
<item name="android:colorPrimary">@color/primary</item>
7+
<item name="android:statusBarColor">@color/primary_dark</item>
8+
<item name="android:navigationBarColor">@color/primary</item>
9+
</style>
10+
</resources>

sample/src/main/res/values/colors.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="primary">#2196F3</color>
4+
<color name="primary_dark">#1976D2</color>
5+
</resources>

sample/src/main/res/values/styles.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5-
<!-- Customize your theme here. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
65
</style>
7-
86
</resources>

sc/animation.gif

-283 KB
Loading

sc/sc1.png

-111 KB
Loading

sc/sc2.png

-107 KB
Loading

sc/sc3.png

-110 KB
Loading

0 commit comments

Comments
 (0)