public EaseSidebar(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; init(); }
public void setShowSiderBar(boolean showSiderBar){ if(showSiderBar){ sidebar.setVisibility(View.VISIBLE); }else{ sidebar.setVisibility(View.GONE); } }
@Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN:{ if(header == null){ header = (TextView) ((View)getParent()).findViewById(R.id.floating_header); } setHeaderTextAndscroll(event); header.setVisibility(View.VISIBLE); setBackgroundResource(R.drawable.ease_sidebar_background_pressed); return true; } case MotionEvent.ACTION_MOVE:{ setHeaderTextAndscroll(event); return true; } case MotionEvent.ACTION_UP: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; case MotionEvent.ACTION_CANCEL: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; } return super.onTouchEvent(event); }
public void init(List<EaseUser> contactList){ this.contactList = contactList; adapter = new EaseContactAdapter(context, 0, new ArrayList<EaseUser>(contactList)); adapter.setPrimaryColor(primaryColor).setPrimarySize(primarySize).setInitialLetterBg(initialLetterBg) .setInitialLetterColor(initialLetterColor); listView.setAdapter(adapter); if(showSiderBar){ sidebar.setListView(listView); } }
String headerString = sections[sectionForPoint(event.getY())]; header.setText(headerString); ListAdapter adapter = mListView.getAdapter();
@Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN:{ if(header == null){ header = (TextView) ((View)getParent()).findViewById(R.id.floating_header); } setHeaderTextAndscroll(event); header.setVisibility(View.VISIBLE); setBackgroundResource(R.drawable.ease_sidebar_background_pressed); return true; } case MotionEvent.ACTION_MOVE:{ setHeaderTextAndscroll(event); return true; } case MotionEvent.ACTION_UP: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; case MotionEvent.ACTION_CANCEL: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; } return super.onTouchEvent(event); }
public void init(List<EaseUser> contactList){ this.contactList = contactList; adapter = new EaseContactAdapter(context, 0, new ArrayList<EaseUser>(contactList)); adapter.setPrimaryColor(primaryColor).setPrimarySize(primarySize).setInitialLetterBg(initialLetterBg) .setInitialLetterColor(initialLetterColor); listView.setAdapter(adapter); if(showSiderBar){ sidebar.setListView(listView); } }
String headerString = sections[sectionForPoint(event.getY())]; header.setText(headerString); ListAdapter adapter = mListView.getAdapter();
@Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN:{ if(header == null){ header = (TextView) ((View)getParent()).findViewById(R.id.floating_header); } setHeaderTextAndscroll(event); header.setVisibility(View.VISIBLE); setBackgroundResource(R.drawable.ease_sidebar_background_pressed); return true; } case MotionEvent.ACTION_MOVE:{ setHeaderTextAndscroll(event); return true; } case MotionEvent.ACTION_UP: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; case MotionEvent.ACTION_CANCEL: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; } return super.onTouchEvent(event); }
public void setShowSiderBar(boolean showSiderBar){ if(showSiderBar){ sidebar.setVisibility(View.VISIBLE); }else{ sidebar.setVisibility(View.GONE); } }
public void init(List<EaseUser> contactList){ this.contactList = contactList; adapter = new EaseContactAdapter(context, 0, new ArrayList<EaseUser>(contactList)); adapter.setPrimaryColor(primaryColor).setPrimarySize(primarySize).setInitialLetterBg(initialLetterBg) .setInitialLetterColor(initialLetterColor); listView.setAdapter(adapter); if(showSiderBar){ sidebar.setListView(listView); } }
public EaseSidebar(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; init(); }
String headerString = sections[sectionForPoint(event.getY())]; header.setText(headerString); ListAdapter adapter = mListView.getAdapter();
@Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN:{ if(header == null){ header = (TextView) ((View)getParent()).findViewById(R.id.floating_header); } setHeaderTextAndscroll(event); header.setVisibility(View.VISIBLE); setBackgroundResource(R.drawable.ease_sidebar_background_pressed); return true; } case MotionEvent.ACTION_MOVE:{ setHeaderTextAndscroll(event); return true; } case MotionEvent.ACTION_UP: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; case MotionEvent.ACTION_CANCEL: header.setVisibility(View.INVISIBLE); setBackgroundColor(Color.TRANSPARENT); return true; } return super.onTouchEvent(event); }
public void setShowSiderBar(boolean showSiderBar){ if(showSiderBar){ sidebar.setVisibility(View.VISIBLE); }else{ sidebar.setVisibility(View.GONE); } }
public void init(List<EaseUser> contactList){ this.contactList = contactList; adapter = new EaseContactAdapter(context, 0, new ArrayList<EaseUser>(contactList)); adapter.setPrimaryColor(primaryColor).setPrimarySize(primarySize).setInitialLetterBg(initialLetterBg) .setInitialLetterColor(initialLetterColor); listView.setAdapter(adapter); if(showSiderBar){ sidebar.setListView(listView); } }
public EaseSidebar(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; init(); }