-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Manabu-GT/develop
Develop-v0.2.1
- Loading branch information
Showing
68 changed files
with
909 additions
and
93 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
2 changes: 1 addition & 1 deletion
2
...etsyblurdemo/EtsyBlurDemoApplication.java → ...blurdemo/app/EtsyBlurDemoApplication.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
2 changes: 1 addition & 1 deletion
2
.../etsyblurdemo/SmartAsyncPolicyHolder.java → ...yblurdemo/app/SmartAsyncPolicyHolder.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
16 changes: 16 additions & 0 deletions
16
sample/src/main/java/com/ms/square/android/etsyblurdemo/data/ListItemData.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.ms.square.android.etsyblurdemo.data; | ||
|
||
import android.support.annotation.DrawableRes; | ||
|
||
public class ListItemData { | ||
@DrawableRes | ||
public final int imageRes; | ||
public final String title; | ||
public final String description; | ||
|
||
public ListItemData(@DrawableRes int imageRes, String title, String description) { | ||
this.imageRes = imageRes; | ||
this.title = title; | ||
this.description = description; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
sample/src/main/java/com/ms/square/android/etsyblurdemo/data/ListItemDataProvider.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,34 @@ | ||
package com.ms.square.android.etsyblurdemo.data; | ||
|
||
import android.content.Context; | ||
import android.content.res.TypedArray; | ||
import android.support.annotation.NonNull; | ||
|
||
import com.ms.square.android.etsyblurdemo.R; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ListItemDataProvider { | ||
|
||
public static List<ListItemData> generateSample(@NonNull Context context, int repeatCount) { | ||
List<ListItemData> list = new ArrayList<>(); | ||
TypedArray images = context.getResources().obtainTypedArray(R.array.list_item_images); | ||
String[] titles = context.getResources().getStringArray(R.array.list_item_titles); | ||
String[] descriptions = context.getResources().getStringArray(R.array.list_item_descriptions); | ||
|
||
int imagesCount = images.length(); | ||
if (imagesCount== titles.length && imagesCount == descriptions.length) { | ||
// add 5 times to make the list longer | ||
for (int repeat = 0; repeat < repeatCount; repeat++) { | ||
for (int i = 0; i < imagesCount; i++) { | ||
list.add(new ListItemData(images.getResourceId(i, 0), titles[i], descriptions[i])); | ||
} | ||
} | ||
} | ||
|
||
images.recycle(); | ||
|
||
return list; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
sample/src/main/java/com/ms/square/android/etsyblurdemo/ui/activity/ListViewActivity.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,35 @@ | ||
package com.ms.square.android.etsyblurdemo.ui.activity; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.widget.ListAdapter; | ||
import android.widget.ListView; | ||
|
||
import com.ms.square.android.etsyblurdemo.R; | ||
import com.ms.square.android.etsyblurdemo.data.ListItemDataProvider; | ||
import com.ms.square.android.etsyblurdemo.ui.adapter.ListItemArrayAdapter; | ||
import com.ms_square.etsyblur.BlurringView; | ||
|
||
public class ListViewActivity extends AppCompatActivity { | ||
|
||
private Toolbar toolbar; | ||
private ListView listView; | ||
private BlurringView blurringView; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_listview); | ||
|
||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
|
||
listView = (ListView) findViewById(R.id.list_view); | ||
ListAdapter adapter = new ListItemArrayAdapter(this, 0, ListItemDataProvider.generateSample(this, 5)); | ||
listView.setAdapter(adapter); | ||
|
||
blurringView = (BlurringView) findViewById(R.id.blurring_view); | ||
blurringView.blurredView(listView); | ||
} | ||
} |
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
36 changes: 36 additions & 0 deletions
36
...le/src/main/java/com/ms/square/android/etsyblurdemo/ui/activity/RecyclerViewActivity.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,36 @@ | ||
package com.ms.square.android.etsyblurdemo.ui.activity; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.DividerItemDecoration; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.support.v7.widget.Toolbar; | ||
|
||
import com.ms.square.android.etsyblurdemo.R; | ||
import com.ms.square.android.etsyblurdemo.data.ListItemDataProvider; | ||
import com.ms.square.android.etsyblurdemo.ui.adapter.ListItemRecyclerViewAdapter; | ||
import com.ms_square.etsyblur.BlurringView; | ||
|
||
public class RecyclerViewActivity extends AppCompatActivity { | ||
|
||
private Toolbar toolbar; | ||
private RecyclerView recyclerView; | ||
private BlurringView blurringView; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_recycler_view); | ||
|
||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
|
||
recyclerView = (RecyclerView) findViewById(R.id.recycler_view); | ||
recyclerView.setHasFixedSize(true); | ||
recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL)); | ||
recyclerView.setAdapter(new ListItemRecyclerViewAdapter(ListItemDataProvider.generateSample(this, 5))); | ||
|
||
blurringView = (BlurringView) findViewById(R.id.blurring_view); | ||
blurringView.blurredView(recyclerView); | ||
} | ||
} |
Oops, something went wrong.