Search in sources :

Example 1 with ContactAdapter

use of com.juns.wechat.adpter.ContactAdapter in project wechat by motianhuo.

the class Fragment_Friends method initData.

private void initData() {
    if (GloableParams.UserInfos != null) {
        lvContact.setAdapter(new ContactAdapter(getActivity(), GloableParams.UserInfos));
    } else {
        FinalDb db = FinalDb.create(getActivity(), Constants.DB_NAME, false);
        GloableParams.UserInfos = db.findAllByWhere(User.class, "type='N'");
        lvContact.setAdapter(new ContactAdapter(getActivity(), GloableParams.UserInfos));
        for (User user : GloableParams.UserInfos) {
            GloableParams.Users.put(user.getTelephone(), user);
        }
    // Intent intent = new Intent(getActivity(), UpdateService.class);
    // getActivity().startService(intent);
    }
}
Also used : User(com.juns.wechat.bean.User) ContactAdapter(com.juns.wechat.adpter.ContactAdapter) FinalDb(net.tsz.afinal.FinalDb)

Example 2 with ContactAdapter

use of com.juns.wechat.adpter.ContactAdapter in project wechat by motianhuo.

the class PublishUserListActivity method initView.

@Override
protected void initView() {
    mWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    lvContact = (ListView) findViewById(R.id.lvContact);
    mDialogText = (TextView) LayoutInflater.from(this).inflate(R.layout.list_position, null);
    mDialogText.setVisibility(View.INVISIBLE);
    indexBar = (SideBar) findViewById(R.id.sideBar);
    indexBar.setListView(lvContact);
    WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
    mWindowManager.addView(mDialogText, lp);
    indexBar.setTextView(mDialogText);
    View layout_head = getLayoutInflater().inflate(R.layout.layout_head_search, null);
    lvContact.addHeaderView(layout_head);
    lvContact.setAdapter(new ContactAdapter(this, GloableParams.UserInfos));
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ContactAdapter(com.juns.wechat.adpter.ContactAdapter) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView) WindowManager(android.view.WindowManager)

Aggregations

ContactAdapter (com.juns.wechat.adpter.ContactAdapter)2 View (android.view.View)1 WindowManager (android.view.WindowManager)1 ImageView (android.widget.ImageView)1 LayoutParams (android.widget.LinearLayout.LayoutParams)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 User (com.juns.wechat.bean.User)1 FinalDb (net.tsz.afinal.FinalDb)1