Skip to content
This repository was archived by the owner on Apr 21, 2021. It is now read-only.

Commit 3461f33

Browse files
author
AndroidDeveloperLB
committed
added some related links.
1 parent ce3227c commit 3461f33

7 files changed

Lines changed: 71 additions & 10 deletions

File tree

‎ChipsLibrary/.classpath‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
44
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
55
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
6-
<classpathentry kind="src" path="gen"/>
76
<classpathentry kind="src" path="src"/>
7+
<classpathentry kind="src" path="gen"/>
88
<classpathentry kind="output" path="bin/classes"/>
99
</classpath>

‎ChipsSample/.classpath‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
55
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
66
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/ChipsLibrary"/>
7-
<classpathentry kind="src" path="gen"/>
87
<classpathentry kind="src" path="src"/>
8+
<classpathentry kind="src" path="gen"/>
99
<classpathentry kind="output" path="bin/classes"/>
1010
</classpath>

‎ChipsSample/res/layout/activity_main.xml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
android:focusable="false"
3030
android:focusableInTouchMode="false"
3131
android:gravity="center_vertical"
32-
android:text="To"
32+
android:text="@string/to"
3333
android:textColor="@android:color/darker_gray"
34-
android:textSize="16sp"
35-
tools:ignore="HardcodedText" />
34+
android:textSize="16sp" />
3635

3736
<com.android.ex.chips.RecipientEditTextView
3837
android:id="@+id/phone_retv"
@@ -50,13 +49,13 @@
5049
android:layout_width="wrap_content"
5150
android:layout_height="wrap_content"
5251
android:layout_gravity="center_horizontal"
53-
android:text="add a random recipient"
54-
tools:ignore="HardcodedText" />
52+
android:text="@string/add_a_random_recipient"
53+
/>
5554

5655
<Button
5756
android:id="@+id/removeRecipientButton" android:layout_gravity="center_horizontal"
5857
android:layout_width="wrap_content"
59-
android:layout_height="wrap_content" tools:ignore="HardcodedText"
60-
android:text="remove a random recipient" />
58+
android:layout_height="wrap_content"
59+
android:text="@string/remove_a_random_recipient" />
6160

6261
</LinearLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item android:icon="@android:drawable/ic_menu_info_details"
5+
android:title="@string/more_info" android:showAsAction="ifRoom">
6+
<menu>
7+
<group android:menuCategory="container"
8+
android:checkableBehavior="none">
9+
<item android:id="@+id/menuItem_current_repository_website"
10+
android:title="@string/repository_website"></item>
11+
<item android:id="@+id/menuItem_all_my_repositories"
12+
android:title="@string/all_my_repositories"></item>
13+
<item android:id="@+id/menuItem_all_my_apps"
14+
android:title="@string/all_my_apps"></item>
15+
</group>
16+
</menu>
17+
</item>
18+
19+
</menu>

‎ChipsSample/res/values/strings.xml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,12 @@
1818
<string name="app_name" translatable="false">Chips Sample</string>
1919
<string name="email_addresses">Email Addresses</string>
2020
<string name="phone_numbers">Phone Numbers</string>
21+
<string name="add_a_random_recipient">add a random recipient</string>
22+
<string name="remove_a_random_recipient">remove a random recipient</string>
23+
<string name="to">To</string>
24+
<string name="repository_website">Repository website</string>
25+
<string name="all_my_repositories">All my repositories</string>
26+
<string name="all_my_apps">All my apps</string>
27+
<string name="more_info">More info</string>
2128

2229
</resources>

‎ChipsSample/src/com/android/ex/chips/sample/MainActivity.java‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
import java.util.List;
2020
import java.util.Random;
2121
import android.app.Activity;
22+
import android.content.Intent;
23+
import android.net.Uri;
2224
import android.os.Bundle;
2325
import android.text.util.Rfc822Tokenizer;
26+
import android.view.Menu;
27+
import android.view.MenuItem;
2428
import android.view.View;
2529
import android.view.View.OnClickListener;
2630
import android.view.ViewTreeObserver.OnPreDrawListener;
@@ -145,4 +149,36 @@ public boolean onPreDraw()
145149
};
146150
view.getViewTreeObserver().addOnPreDrawListener(preDrawListener);
147151
}
152+
153+
@Override
154+
public boolean onCreateOptionsMenu(final Menu menu)
155+
{
156+
getMenuInflater().inflate(R.menu.activity_main,menu);
157+
return super.onCreateOptionsMenu(menu);
158+
}
159+
160+
@Override
161+
public boolean onOptionsItemSelected(final MenuItem item)
162+
{
163+
String url=null;
164+
switch(item.getItemId())
165+
{
166+
case R.id.menuItem_all_my_apps:
167+
url="https://play.google.com/store/apps/developer?id=Liran+Barsisa";
168+
break;
169+
case R.id.menuItem_all_my_repositories:
170+
url="https://github.com/AndroidDeveloperLB";
171+
break;
172+
case R.id.menuItem_current_repository_website:
173+
url="https://github.com/AndroidDeveloperLB/ChipsLibrary";
174+
break;
175+
}
176+
if(url==null)
177+
return true;
178+
final Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
179+
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY|Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
180+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
181+
startActivity(intent);
182+
return true;
183+
}
148184
}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can use the sample's code for this, using the function "runJustBeforeBeingDr
3131

3232
Notes :
3333

34-
- on some devices (like Galaxy S2 and Galaxy S3) , pressing backspace after the chip will sometimes show its number instead of removing it.
34+
- on some devices (like Galaxy S2 and Galaxy S3) , pressing backspace after the chip will sometimes show its number instead of removing the chip (and its data) completely.
3535
There might be some other weird behaviors on those devices, which are caused due to changes on the default behavior of MultiAutoCompleteTextView
3636

3737
- It seems the original library has a lot of "TODO"s and even some that say to fix issues. Not sure how important they are though

0 commit comments

Comments
 (0)