Skip to content

Commit

Permalink
Update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
amyu committed Aug 4, 2015
1 parent 4f44437 commit cb5717b
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ private void createWaveView() {
mTarget.measure(
makeMeasureSpecExactly(getMeasuredWidth() - (getPaddingLeft() + getPaddingRight())),
makeMeasureSpecExactly(getMeasuredHeight() - (getPaddingTop() + getPaddingBottom())));
mWaveView.measure(widthMeasureSpec, heightMeasureSpec);

mCircleView.measure();
}
Expand All @@ -203,7 +204,7 @@ private void createWaveView() {
mCircleView.layout((thisWidth - circleWidth) / 2, -circleHeight, (thisWidth + circleWidth) / 2,
0);

mWaveView.layout(left, top, right, bottom);
mWaveView.layout(getPaddingLeft(), getPaddingTop(), childRight, childBottom);
}

@Override public boolean onPreDraw() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
Expand Down Expand Up @@ -345,7 +344,7 @@ private void initView() {

private void setUpPaint() {
mPaint = new Paint();
mPaint.setColor(Color.BLUE);
mPaint.setColor(0xff2196F3);
mPaint.setAntiAlias(true);
mPaint.setStyle(Paint.Style.FILL);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
Expand All @@ -20,9 +22,11 @@ public class MainActivity extends AppCompatActivity implements WaveSwipeRefreshL

@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

setContentView(R.layout.activity_main);
initView();
setSampleData();
}
Expand All @@ -39,7 +43,7 @@ private void initView() {
private void setSampleData() {
ArrayList<String> sampleArrayStr = new ArrayList<>();
for (int i = 0; i < 60; i++) {
sampleArrayStr.add("sample" + i);
sampleArrayStr.add("" );
}
ArrayAdapter<String> adapter = new ArrayAdapter<>(getApplicationContext(), android.R.layout.simple_list_item_1, sampleArrayStr);
mListview.setAdapter(adapter);
Expand All @@ -52,7 +56,7 @@ public void run() {
// 更新が終了したらインジケータ非表示
mWaveSwipeRefreshLayout.setRefreshing(false);
}
}, 5000);
}, 3000);
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions sample/src/main/res/drawable/toolbar_dropshadow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="@android:color/transparent"
android:endColor="#88333333"
android:angle="90"/>
</shape>
59 changes: 47 additions & 12 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,56 @@
<RelativeLayout android:id="@+id/main_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"
>

<View
android:layout_width="match_parent"
android:layout_height="25dip"
android:background="@color/primary_dark"
/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
>

<Toolbar
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="@color/primary"
android:id="@+id/toolbar"
/>

<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@drawable/toolbar_dropshadow"
android:layout_below="@+id/toolbar"
/>


<jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_swipe">
android:id="@+id/main_swipe"
android:layout_below="@+id/toolbar"
>

<ListView
android:id="@+id/main_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ListView
android:id="@+id/main_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>

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

</RelativeLayout>
</RelativeLayout>

</LinearLayout>
10 changes: 10 additions & 0 deletions sample/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="AppTheme"
parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:statusBarColor">@color/primary_dark</item>
<item name="android:navigationBarColor">@color/primary</item>
</style>
</resources>
5 changes: 5 additions & 0 deletions sample/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#2196F3</color>
<color name="primary_dark">#1976D2</color>
</resources>
4 changes: 1 addition & 3 deletions sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>

</resources>
Binary file modified sc/animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sc/sc1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sc/sc2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sc/sc3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb5717b

Please sign in to comment.