Search in sources :

Example 1 with SelectGroupMemberListAdapter

use of com.lingtuan.firefly.contact.adapter.SelectGroupMemberListAdapter in project SmartMesh_Android by SmartMeshFoundation.

the class SelectGroupMemberListUI method initData.

@Override
protected void initData() {
    setTitle(R.string.group_member_select_list);
    String response = Utils.readFromFile("conversation-get_conversation" + NextApplication.myInfo.getLocalId() + ".json");
    mAdapter = new SelectGroupMemberListAdapter(null, this);
    mSearchAdapter = new SelectGroupMemberListAdapter(null, this);
    if (!TextUtils.isEmpty(response)) {
        try {
            JSONObject json = new JSONObject(response);
            parserJson(json);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
    mInTextView.setHint(R.string.search);
    mListView.setAdapter(mAdapter);
    loadData();
}
Also used : JSONObject(org.json.JSONObject) JSONException(org.json.JSONException) SelectGroupMemberListAdapter(com.lingtuan.firefly.contact.adapter.SelectGroupMemberListAdapter)

Example 2 with SelectGroupMemberListAdapter

use of com.lingtuan.firefly.contact.adapter.SelectGroupMemberListAdapter in project SmartMesh_Android by SmartMeshFoundation.

the class SelectGroupMemberListUI method showSearch.

private void showSearch() {
    isSearch = true;
    final int initialHeight = mTitleRela.getHeight();
    Animation anim = new Animation() {

        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            if (interpolatedTime == 1) {
            } else {
                RelativeLayout.LayoutParams lp = (LayoutParams) mTitleRela.getLayoutParams();
                lp.setMargins(0, -(int) (initialHeight * interpolatedTime), 0, 0);
                mTitleRela.requestLayout();
            }
        }

        @Override
        public boolean willChangeBounds() {
            return true;
        }
    };
    anim.setDuration(300);
    anim.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            RelativeLayout.LayoutParams lp = (LayoutParams) mTitleRela.getLayoutParams();
            lp.setMargins(0, -initialHeight, 0, 0);
            mTitleRela.requestLayout();
            searchResultLayout.setVisibility(View.VISIBLE);
            mTitleRela.setVisibility(View.GONE);
            mInputSearchLayout.setVisibility(View.VISIBLE);
            mInTextView.setVisibility(View.INVISIBLE);
            mInputSearch.setFocusable(true);
            mInputSearch.setFocusableInTouchMode(true);
            mInputSearch.requestFocus();
            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.showSoftInput(mInputSearch, InputMethodManager.SHOW_FORCED);
        }
    });
    mTitleRela.startAnimation(anim);
    mSearchAdapter = new SelectGroupMemberListAdapter(friendFilterList, this);
    mSearchListView.setAdapter(mSearchAdapter);
}
Also used : Transformation(android.view.animation.Transformation) LayoutParams(android.widget.RelativeLayout.LayoutParams) RelativeLayout(android.widget.RelativeLayout) Animation(android.view.animation.Animation) InputMethodManager(android.view.inputmethod.InputMethodManager) AnimationListener(android.view.animation.Animation.AnimationListener) SelectGroupMemberListAdapter(com.lingtuan.firefly.contact.adapter.SelectGroupMemberListAdapter) LayoutParams(android.widget.RelativeLayout.LayoutParams)

Aggregations

SelectGroupMemberListAdapter (com.lingtuan.firefly.contact.adapter.SelectGroupMemberListAdapter)2 Animation (android.view.animation.Animation)1 AnimationListener (android.view.animation.Animation.AnimationListener)1 Transformation (android.view.animation.Transformation)1 InputMethodManager (android.view.inputmethod.InputMethodManager)1 RelativeLayout (android.widget.RelativeLayout)1 LayoutParams (android.widget.RelativeLayout.LayoutParams)1 JSONException (org.json.JSONException)1 JSONObject (org.json.JSONObject)1