diff --git a/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java b/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java index 802aa2cd6a9f07322bdf4caace3a3affeeb4687e..b988a4b2756bafd52dc6e71d94e4141ed1d7450a 100644 --- a/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java +++ b/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java @@ -155,7 +155,7 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener view.startDrag(null, shadowBuilder, view, 0); // view.setVisibility(View.INVISIBLE); mCallbacks.onContactDragged(); -// ((SearchView) mHandle.findViewById(R.id.contact_search_text)).setIconified(true); + // ((SearchView) mHandle.findViewById(R.id.contact_search_text)).setIconified(true); return true; } @@ -171,8 +171,8 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener @Override public void onItemClick(AdapterView<?> arg0, View v, int pos, long arg3) { - mCallbacks.onContactSelected(mListAdapter.getItem(pos-1)); -// ((SearchView) mHandle.findViewById(R.id.contact_search_text)).setIconified(true); + mCallbacks.onContactSelected(mListAdapter.getItem(pos - 1)); + // ((SearchView) mHandle.findViewById(R.id.contact_search_text)).setIconified(true); } }); @@ -185,22 +185,22 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener list.setAdapter(mListAdapter); grid.setAdapter(mGridAdapter); - + list.setOnScrollListener(new OnScrollListener() { - + @Override public void onScrollStateChanged(AbsListView view, int scrollState) { // TODO Stub de la méthode généré automatiquement - + } - + @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { - if(visibleItemCount > 0 && firstVisibleItem == 0 && view.getChildAt(0).getTop() == 0){ + if (visibleItemCount > 0 && firstVisibleItem == 0 && view.getChildAt(0).getTop() == 0) { // ListView scrolled at top - + } - + } }); grid.setExpanded(true); @@ -212,15 +212,13 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener public void onItemClick(AdapterView<?> arg0, View v, int pos, long arg3) { // launchCallActivity(mGridAdapter.getItem(pos)); mCallbacks.onContactSelected(mGridAdapter.getItem(pos)); -// ((SearchView) mHandle.findViewById(R.id.contact_search_text)).setIconified(true); + // ((SearchView) mHandle.findViewById(R.id.contact_search_text)).setIconified(true); } }); grid.setOnItemLongClickListener(mItemLongClickListener); return inflatedView; } - - OnDragListener dragListener = new OnDragListener() { @@ -248,23 +246,22 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener }; - @Override public boolean onQueryTextChange(String newText) { // Called when the action bar search text has changed. Update // the search filter, and restart the loader to do a new query // with this filter. -// String newFilter = !TextUtils.isEmpty(newText) ? newText : null; + // String newFilter = !TextUtils.isEmpty(newText) ? newText : null; // Don't do anything if the filter hasn't actually changed. // Prefents restarting the loader when restoring state. -// if (mCurFilter == null && newFilter == null) { -// return true; -// } -// if (mCurFilter != null && mCurFilter.equals(newText)) { -// return true; -// } - if(newText.isEmpty()){ + // if (mCurFilter == null && newFilter == null) { + // return true; + // } + // if (mCurFilter != null && mCurFilter.equals(newText)) { + // return true; + // } + if (newText.isEmpty()) { getLoaderManager().restartLoader(LoaderConstants.CONTACT_LOADER, null, this); return true; } @@ -316,30 +313,29 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener } public void setHandleView(RelativeLayout handle) { - - ((ImageButton)handle.findViewById(R.id.contact_search_button)).setOnClickListener(new OnClickListener() { - + + ((ImageButton) handle.findViewById(R.id.contact_search_button)).setOnClickListener(new OnClickListener() { + @Override public void onClick(View v) { - + SearchView search = new SearchView(getActivity()); - //Get the ID for the search bar LinearLayout + // Get the ID for the search bar LinearLayout int searchBarId = search.getContext().getResources().getIdentifier("android:id/search_bar", null, null); - //Get the search bar Linearlayout + // Get the search bar Linearlayout LinearLayout searchBar = (LinearLayout) search.findViewById(searchBarId); - searchBar.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); - //Give the Linearlayout a transition animation. + searchBar.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.WRAP_CONTENT)); + // Give the Linearlayout a transition animation. searchBar.setLayoutTransition(new LayoutTransition()); search.setOnQueryTextListener(ContactListFragment.this); search.setIconified(false); getActivity().getActionBar().setDisplayShowCustomEnabled(true); getActivity().getActionBar().setCustomView(search); mCallbacks.openDrawer(); - + } }); - - } diff --git a/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java b/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java index f7c9ab0cdfcd30be2cf3f78d3cfa798218732c32..25713727207e26bd96035dc27944c4638c4f0dce 100644 --- a/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java +++ b/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java @@ -78,7 +78,7 @@ public class HomeFragment extends Fragment { private TextView nb_calls, nb_confs; CallListAdapter confs_adapter, calls_adapter; CallTimer timer; - + public static final int REQUEST_TRANSFER = 10; public static final int REQUEST_CONF = 20; @@ -174,7 +174,6 @@ public class HomeFragment extends Fragment { nb_calls.setText("" + calls.size()); ArrayList<Conference> conferences = new ArrayList<Conference>(); for (SipCall call : calls.values()) { - Log.w(TAG, "SimpleCall:" + call.getCallId()); Conference confOne = new Conference("-1"); confOne.getParticipants().add(call); conferences.add(confOne); @@ -358,18 +357,18 @@ public class HomeFragment extends Fragment { switch (event.getAction()) { case DragEvent.ACTION_DRAG_STARTED: // Do nothing - Log.w(TAG, "ACTION_DRAG_STARTED"); + // Log.w(TAG, "ACTION_DRAG_STARTED"); break; case DragEvent.ACTION_DRAG_ENTERED: - Log.w(TAG, "ACTION_DRAG_ENTERED"); + // Log.w(TAG, "ACTION_DRAG_ENTERED"); v.setBackgroundColor(Color.GREEN); break; case DragEvent.ACTION_DRAG_EXITED: - Log.w(TAG, "ACTION_DRAG_EXITED"); + // Log.w(TAG, "ACTION_DRAG_EXITED"); v.setBackgroundDrawable(getResources().getDrawable(R.drawable.item_call_selector)); break; case DragEvent.ACTION_DROP: - Log.w(TAG, "ACTION_DROP"); + // Log.w(TAG, "ACTION_DROP"); View view = (View) event.getLocalState(); Item i = event.getClipData().getItemAt(0); @@ -395,7 +394,7 @@ public class HomeFragment extends Fragment { // v.setBackgroundColor(Color.BLACK); break; case DragEvent.ACTION_DRAG_ENDED: - Log.w(TAG, "ACTION_DRAG_ENDED"); + // Log.w(TAG, "ACTION_DRAG_ENDED"); View view1 = (View) event.getLocalState(); view1.setVisibility(View.VISIBLE); v.setBackgroundDrawable(getResources().getDrawable(R.drawable.item_call_selector)); @@ -406,7 +405,7 @@ public class HomeFragment extends Fragment { } }; - + @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -460,7 +459,7 @@ public class HomeFragment extends Fragment { } } } - + private void bindCalls(Conference call_to_add, Conference call_target) { try { diff --git a/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java b/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java index bf10a05332dbb27efd9580eea2e70a08d1d32627..568cf66c7b4d146ea163fdd538894d5de7c93910 100644 --- a/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java +++ b/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java @@ -4,6 +4,8 @@ import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.util.AttributeSet; +import android.util.Log; +import android.view.DragEvent; import android.view.LayoutInflater; import android.view.View; import android.view.inputmethod.EditorInfo; @@ -100,16 +102,16 @@ public class ClearableEditText extends RelativeLayout { } public void setError(String string) { - edit_text.setError(string); + edit_text.setError(string); edit_text.requestFocus(); } - - public void setTextWatcher(TextWatcher l){ + + public void setTextWatcher(TextWatcher l) { watch = l; edit_text.addTextChangedListener(watch); } - - public void unsetTextWatcher(){ + + public void unsetTextWatcher() { edit_text.removeTextChangedListener(watch); } }