-
Notifications
You must be signed in to change notification settings - Fork 383
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
pchmn
committed
Apr 16, 2017
1 parent
9d327a0
commit d8c0d74
Showing
12 changed files
with
118 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# CHANGELOG | ||
|
||
# 1.0.1 | ||
|
||
Fixed bug with `android.view.ContextThemeWrapper cannot be cast to android.app.Activity` ([see](https://github.com/pchmn/MaterialChipsInput/issues/1) issue) | ||
|
||
## 1.0.0 | ||
|
||
First version of the library |
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
Binary file not shown.
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
20 changes: 20 additions & 0 deletions
20
library/src/main/java/com/pchmn/materialchips/util/ActivityUtil.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,20 @@ | ||
package com.pchmn.materialchips.util; | ||
|
||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.content.ContextWrapper; | ||
|
||
public class ActivityUtil { | ||
|
||
public static Activity scanForActivity(Context context) { | ||
if (context == null) | ||
return null; | ||
else if (context instanceof Activity) | ||
return (Activity)context; | ||
else if (context instanceof ContextWrapper) | ||
return scanForActivity(((ContextWrapper)context).getBaseContext()); | ||
|
||
return null; | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
sample/src/main/java/com/pchmn/sample/materialchipsinput/MyDialogFragment.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,28 @@ | ||
package com.pchmn.sample.materialchipsinput; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatDialogFragment; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
public class MyDialogFragment extends AppCompatDialogFragment { | ||
|
||
public static MyDialogFragment newInstance(int num) { | ||
MyDialogFragment f = new MyDialogFragment(); | ||
|
||
// Supply num input as an argument. | ||
Bundle args = new Bundle(); | ||
args.putInt("num", num); | ||
f.setArguments(args); | ||
|
||
return f; | ||
} | ||
|
||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||
Bundle savedInstanceState) { | ||
|
||
return inflater.inflate(R.layout.framgnet_dialog, container, false); | ||
} | ||
} |
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,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:padding="16dp"> | ||
|
||
<com.pchmn.materialchips.ChipsInput | ||
android:id="@+id/chips_input" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:hint="Enter a name" | ||
app:maxRows="3" /> | ||
|
||
</RelativeLayout> |