-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update TagsListener to include onEnterClicked function
- Loading branch information
Showing
4 changed files
with
49 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
34 changes: 31 additions & 3 deletions
34
app/src/main/java/mabbas007/myapplication/MainActivity.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 |
---|---|---|
@@ -1,30 +1,58 @@ | ||
package mabbas007.myapplication; | ||
|
||
import android.content.Context; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.view.inputmethod.InputMethodManager; | ||
import android.widget.Button; | ||
import android.widget.RelativeLayout; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
|
||
import mabbas007.tagsedittext.TagsEditText; | ||
|
||
public class MainActivity extends AppCompatActivity | ||
public class MainActivity extends AppCompatActivity implements TagsEditText.TagsEditListener | ||
{ | ||
|
||
private static final String TAG = "MainActivity"; | ||
private TagsEditText mTagsEditText; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) | ||
{ | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
final TagsEditText tagsEditText = (TagsEditText) findViewById(R.id.tagsEditText); | ||
mTagsEditText = (TagsEditText) findViewById(R.id.tagsEditText); | ||
Button button = (Button) findViewById(R.id.btnChangeColor); | ||
button.setOnClickListener(new View.OnClickListener() | ||
{ | ||
@Override | ||
public void onClick(View v) | ||
{ | ||
tagsEditText.setTagsBackgroundColor(android.R.color.holo_orange_dark); | ||
mTagsEditText.setTagsBackgroundColor(android.R.color.holo_orange_dark); | ||
//tagsEditText.setTagsTextColor(R.color.colorPrimary); | ||
} | ||
}); | ||
|
||
|
||
mTagsEditText.setTagsListener(this); | ||
} | ||
|
||
@Override | ||
public void onTagsChanged(ArrayList<String> tags) | ||
{ | ||
Log.d(TAG,"Tags changed: "); | ||
Log.d(TAG, Arrays.toString(tags.toArray())); | ||
} | ||
|
||
@Override | ||
public void onEditingFinished() | ||
{ | ||
// InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); | ||
// imm.hideSoftInputFromWindow(mTagsEditText.getWindowToken(), 0); | ||
// //mTagsEditText.clearFocus(); | ||
} | ||
} |