@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mListView = (ListView) mView.findViewById(R.id.lv); mListView.setOnScrollListener( new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) { PullRightLayout.collapseAll(); } } @Override public void onScroll( AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {} }); mStartScanView = (TextView) mView.findViewById(R.id.tv_start_scan); mStartScanView.setBackgroundColor(ThemeManager.with(getActivity()).getCurrentColor()); mStartScanView.setOnClickListener(this); mPullLayout = (PullLayout) mView.findViewById(R.id.pull_layout); mPullLayout.addOnPullListener(this); if (mListener != null) { mPullLayout.addOnPullListener(mListener); mListener = null; } mIvScan = (ImageView) mView.findViewById(R.id.iv_scan); IntentFilter filter = new IntentFilter(ScanService.ACTION_SCAN_FINISH); LocalBroadcastManager.getInstance(getActivity()).registerReceiver(receiver, filter); }
@Override public void onThemeChange(int color) { mStartScanView.setBackgroundColor(color); if (mSongAdapter != null) { mSongAdapter.notifyDataSetChanged(); } }
private View getFooterView() { if (mFooterView == null) { FrameLayout fl = new FrameLayout(getActivity()); TextView tv = new TextView(getActivity()); tv.setGravity(Gravity.CENTER); tv.setTextColor(0xFFaaaaaa); tv.setBackgroundColor(0xFFffffff); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, (int) CommonUtils.dpToPx(getActivity(), 50)); fl.addView(tv, params); mFooterView = fl; } TextView tv = (TextView) mFooterView.getChildAt(0); tv.setText("共有" + SongManager.with(getActivity()).getSongSize() + "首歌"); return mFooterView; }
private void SetBackGroundforList() { // TODO Auto-generated method stub mDownView_parent_txt1 = new TextView(activity.getApplicationContext()); RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); lp1.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); mDownView_parent_txt1.setId(Integer.parseInt("111111")); mDownView_parent_txt1.setLayoutParams(lp1); mDownView_parent_txt1.setGravity(Gravity.CENTER_HORIZONTAL); mDownView_parent_txt1.setText(HalfText); mDownView_parent_txt1.setWidth(textwidth2); mDownView_parent_txt1.setPadding(0, textheight / 4, 0, 0); mDownView_parent_txt1.setHeight(textheight); mDownView_parent_txt1.setBackgroundColor(Color.parseColor(FullColor)); mDownView_parent_txt1.setTextColor(Color.parseColor(TextColor)); mDownView_parent_txt1.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); mDownView_parent.addView(mDownView_parent_txt1, 0); // if(SwipeType==Double){ // mDownView_parent_txt2 = new TextView(activity.getApplicationContext()); // mDownView_parent_txt2.setId(222222); // RelativeLayout.LayoutParams lp2 =new // RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT); // lp2.addRule(RelativeLayout.LEFT_OF,mDownView_parent_txt1.getId()); // mDownView_parent_txt2.setLayoutParams(lp2); // mDownView_parent_txt2.setGravity(Gravity.CENTER_HORIZONTAL); // mDownView_parent_txt2.setText(FullText); // mDownView_parent_txt2.setWidth(textwidth); // mDownView_parent_txt2.setPadding(0, textheight/4, 0, 0); // mDownView_parent_txt2.setHeight(textheight); // mDownView_parent_txt2.setBackgroundColor(Color.parseColor(FullColor)); // mDownView_parent_txt2.setTextColor(Color.parseColor(TextColor)); // mDownView_parent_txt2.setCompoundDrawablesWithIntrinsicBounds(null , // FullDrawable, null, null ); // mDownView_parent.addView(mDownView_parent_txt2, 1); // } }