List of usage examples for android.view View setBackgroundColor
@RemotableViewMethod public void setBackgroundColor(@ColorInt int color)
From source file:com.lifehackinnovations.siteaudit.FloorPlanActivity.java
public void highlightbutton(View arg0) { try {/* w w w. j a v a2 s.co m*/ RelativeLayout parent = ((RelativeLayout) arg0.getParent()); for (int child = 0; child < parent.getChildCount(); child++) { parent.getChildAt(child).setBackgroundColor(Color.TRANSPARENT); } } catch (Throwable e) { LinearLayout parent = ((LinearLayout) arg0.getParent()); for (int child = 0; child < parent.getChildCount(); child++) { parent.getChildAt(child).setBackgroundColor(Color.TRANSPARENT); } } arg0.setBackgroundColor(Color.parseColor("#501BADA9")); }
From source file:com.customdatepicker.date.DatePickerDialog.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { int listPosition = -1; int listPositionOffset = 0; int currentView = mDefaultView; if (savedInstanceState != null) { mWeekStart = savedInstanceState.getInt(KEY_WEEK_START); currentView = savedInstanceState.getInt(KEY_CURRENT_VIEW); listPosition = savedInstanceState.getInt(KEY_LIST_POSITION); listPositionOffset = savedInstanceState.getInt(KEY_LIST_POSITION_OFFSET); //noinspection unchecked highlightedDays = (HashSet<Calendar>) savedInstanceState.getSerializable(KEY_HIGHLIGHTED_DAYS); mThemeDark = savedInstanceState.getBoolean(KEY_THEME_DARK); mThemeDarkChanged = savedInstanceState.getBoolean(KEY_THEME_DARK_CHANGED); mAccentColor = savedInstanceState.getInt(KEY_ACCENT); mVibrate = savedInstanceState.getBoolean(KEY_VIBRATE); mDismissOnPause = savedInstanceState.getBoolean(KEY_DISMISS); mAutoDismiss = savedInstanceState.getBoolean(KEY_AUTO_DISMISS); mTitle = savedInstanceState.getString(KEY_TITLE); mOkResid = savedInstanceState.getInt(KEY_OK_RESID); mOkString = savedInstanceState.getString(KEY_OK_STRING); mOkColor = savedInstanceState.getInt(KEY_OK_COLOR); mCancelResid = savedInstanceState.getInt(KEY_CANCEL_RESID); mCancelString = savedInstanceState.getString(KEY_CANCEL_STRING); mCancelColor = savedInstanceState.getInt(KEY_CANCEL_COLOR); mVersion = (Version) savedInstanceState.getSerializable(KEY_VERSION); mTimezone = (TimeZone) savedInstanceState.getSerializable(KEY_TIMEZONE); mDateRangeLimiter = savedInstanceState.getParcelable(KEY_DATERANGELIMITER); /*/*from www.ja v a2 s.c om*/ If the user supplied a custom limiter, we need to create a new default one to prevent null pointer exceptions on the configuration methods If the user did not supply a custom limiter we need to ensure both mDefaultLimiter and mDateRangeLimiter are the same reference, so that the config methods actually ffect the behaviour of the picker (in the unlikely event the user reconfigures the picker when it is shown) */ if (mDateRangeLimiter instanceof DefaultDateRangeLimiter) { mDefaultLimiter = (DefaultDateRangeLimiter) mDateRangeLimiter; } else { mDefaultLimiter = new DefaultDateRangeLimiter(); } } mDefaultLimiter.setController(this); int viewRes = mVersion == Version.VERSION_1 ? R.layout.mdtp_date_picker_dialog : R.layout.mdtp_date_picker_dialog_v2; View view = inflater.inflate(viewRes, container, false); // All options have been set at this point: round the initial selection if necessary mCalendar = mDateRangeLimiter.setToNearestDate(mCalendar); mDatePickerHeaderView = (TextView) view.findViewById(R.id.mdtp_date_picker_header); mImageViewLeft = (ImageView) view.findViewById(R.id.imageViewLeft); mImageViewRight = (ImageView) view.findViewById(R.id.imageViewRight); mMonthAndDayView = (LinearLayout) view.findViewById(R.id.mdtp_date_picker_month_and_day); mMonthAndDayView.setOnClickListener(this); mSelectedMonthTextView = (TextView) view.findViewById(R.id.mdtp_date_picker_month); mSelectedDayTextView = (TextView) view.findViewById(R.id.mdtp_date_picker_day); mYearView = (TextView) view.findViewById(R.id.mdtp_date_picker_year); mYearView.setOnClickListener(this); mImageViewLeft.setOnClickListener(this); mImageViewRight.setOnClickListener(this); final Activity activity = getActivity(); mDayPickerView = new SimpleDayPickerView(activity, this); mYearPickerView = new YearPickerView(activity, this); // if theme mode has not been set by java code, check if it is specified in Style.xml if (!mThemeDarkChanged) { mThemeDark = Utils.isDarkTheme(activity, mThemeDark); } Resources res = getResources(); mDayPickerDescription = res.getString(R.string.mdtp_day_picker_description); mSelectDay = res.getString(R.string.mdtp_select_day); mYearPickerDescription = res.getString(R.string.mdtp_year_picker_description); mSelectYear = res.getString(R.string.mdtp_select_year); int bgColorResource = mThemeDark ? R.color.mdtp_date_picker_view_animator_dark_theme : R.color.mdtp_date_picker_view_animator; view.setBackgroundColor(ContextCompat.getColor(activity, bgColorResource)); mAnimator = (AccessibleDateAnimator) view.findViewById(R.id.mdtp_animator); mAnimator.addView(mDayPickerView); mAnimator.addView(mYearPickerView); mAnimator.setDateMillis(mCalendar.getTimeInMillis()); // TODO: Replace with animation decided upon by the design team. Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(ANIMATION_DURATION); mAnimator.setInAnimation(animation); // TODO: Replace with animation decided upon by the design team. Animation animation2 = new AlphaAnimation(1.0f, 0.0f); animation2.setDuration(ANIMATION_DURATION); mAnimator.setOutAnimation(animation2); Button okButton = (Button) view.findViewById(R.id.mdtp_ok); okButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { tryVibrate(); notifyOnDateListener(); dismiss(); } }); okButton.setTypeface(TypefaceHelper.get(activity, "Roboto-Medium")); if (mOkString != null) okButton.setText(mOkString); else okButton.setText(mOkResid); Button cancelButton = (Button) view.findViewById(R.id.mdtp_cancel); cancelButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { tryVibrate(); if (getDialog() != null) getDialog().cancel(); } }); cancelButton.setTypeface(TypefaceHelper.get(activity, "Roboto-Medium")); if (mCancelString != null) cancelButton.setText(mCancelString); else cancelButton.setText(mCancelResid); cancelButton.setVisibility(isCancelable() ? View.VISIBLE : View.GONE); // If an accent color has not been set manually, get it from the context if (mAccentColor == -1) { mAccentColor = Utils.getAccentColorFromThemeIfAvailable(getActivity()); } if (mDatePickerHeaderView != null) mDatePickerHeaderView.setBackgroundColor(Utils.darkenColor(mAccentColor)); view.findViewById(R.id.mdtp_day_picker_selected_date_layout).setBackgroundColor(mAccentColor); // Buttons can have a different color if (mOkColor != -1) okButton.setTextColor(mOkColor); else okButton.setTextColor(mAccentColor); if (mCancelColor != -1) cancelButton.setTextColor(mCancelColor); else cancelButton.setTextColor(mAccentColor); if (getDialog() == null) { view.findViewById(R.id.mdtp_done_background).setVisibility(View.GONE); } updateDisplay(false); setCurrentView(currentView); if (listPosition != -1) { if (currentView == MONTH_AND_DAY_VIEW) { mDayPickerView.postSetSelection(listPosition); } else if (currentView == YEAR_VIEW) { mYearPickerView.postSetSelectionFromTop(listPosition, listPositionOffset); } } mHapticFeedbackController = new HapticFeedbackController(activity); return view; }
From source file:com.aniruddhc.acemusic.player.NowPlayingQueueActivity.NowPlayingQueueFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //Inflate the correct layout based on the selected theme. mContext = getActivity().getApplicationContext(); mApp = (Common) mContext;/*from w ww . j av a 2 s . c o m*/ nowPlayingQueueFragment = this; sharedPreferences = mContext.getSharedPreferences("com.aniruddhc.acemusic.player", Context.MODE_PRIVATE); mCursor = mApp.getService().getCursor(); View rootView = (ViewGroup) inflater.inflate(R.layout.now_playing_queue_layout, container, false); receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { updateSongInfo(); } }; //Notify the application that this fragment is now visible. sharedPreferences.edit().putBoolean("NOW_PLAYING_QUEUE_VISIBLE", true).commit(); //Get the screen's parameters. displayMetrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); screenWidth = displayMetrics.widthPixels; screenHeight = displayMetrics.heightPixels; noMusicPlaying = (TextView) rootView.findViewById(R.id.now_playing_queue_no_music_playing); nowPlayingAlbumArt = (ImageView) rootView.findViewById(R.id.now_playing_queue_album_art); nowPlayingSongTitle = (TextView) rootView.findViewById(R.id.now_playing_queue_song_title); nowPlayingSongArtist = (TextView) rootView.findViewById(R.id.now_playing_queue_song_artist); nowPlayingSongContainer = (RelativeLayout) rootView .findViewById(R.id.now_playing_queue_current_song_container); noMusicPlaying.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingSongTitle.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingSongArtist.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingQueueListView = (DragSortListView) rootView.findViewById(R.id.now_playing_queue_list_view); progressBar = (ProgressBar) rootView.findViewById(R.id.now_playing_queue_progressbar); playPauseButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_play); nextButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_next); previousButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_previous); //Apply the card layout's background based on the color theme. if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME").equals("LIGHT_CARDS_THEME")) { rootView.setBackgroundColor(0xFFEEEEEE); nowPlayingQueueListView.setDivider(getResources().getDrawable(R.drawable.transparent_drawable)); nowPlayingQueueListView.setDividerHeight(3); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layoutParams.setMargins(7, 3, 7, 3); nowPlayingQueueListView.setLayoutParams(layoutParams); } else if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME") .equals("DARK_CARDS_THEME")) { rootView.setBackgroundColor(0xFF000000); nowPlayingQueueListView.setDivider(getResources().getDrawable(R.drawable.transparent_drawable)); nowPlayingQueueListView.setDividerHeight(3); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layoutParams.setMargins(7, 3, 7, 3); nowPlayingQueueListView.setLayoutParams(layoutParams); } //Set the Now Playing container layout's background. nowPlayingSongContainer.setBackgroundColor(UIElementsHelper.getNowPlayingQueueBackground(mContext)); //Loop through the service's cursor and retrieve the current queue's information. if (sharedPreferences.getBoolean("SERVICE_RUNNING", false) == false || mApp.getService().getCurrentMediaPlayer() == null) { //No audio is currently playing. noMusicPlaying.setVisibility(View.VISIBLE); nowPlayingAlbumArt.setImageBitmap(mApp.decodeSampledBitmapFromResource(R.drawable.default_album_art, screenWidth / 3, screenWidth / 3)); nowPlayingQueueListView.setVisibility(View.GONE); nowPlayingSongTitle.setVisibility(View.GONE); nowPlayingSongArtist.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); } else { //Set the current play/pause conditions. try { //Hide the progressBar and display the controls. progressBar.setVisibility(View.GONE); playPauseButton.setVisibility(View.VISIBLE); nextButton.setVisibility(View.VISIBLE); previousButton.setVisibility(View.VISIBLE); if (mApp.getService().getCurrentMediaPlayer().isPlaying()) { playPauseButton.setImageResource(R.drawable.pause_holo_light); } else { playPauseButton.setImageResource(R.drawable.play_holo_light); } } catch (Exception e) { /* The mediaPlayer hasn't been initialized yet, so let's just keep the controls * hidden for now. Once the mediaPlayer is initialized and it starts playing, * updateSongInfo() will be called, and we can show the controls/hide the progressbar * there. For now though, we'll display the progressBar. */ progressBar.setVisibility(View.VISIBLE); playPauseButton.setVisibility(View.GONE); nextButton.setVisibility(View.GONE); previousButton.setVisibility(View.GONE); } //Retrieve and set the current title/artist/artwork. mCursor.moveToPosition( mApp.getService().getPlaybackIndecesList().get(mApp.getService().getCurrentSongIndex())); String currentTitle = mCursor.getString(mCursor.getColumnIndex(DBAccessHelper.SONG_TITLE)); String currentArtist = mCursor.getString(mCursor.getColumnIndex(DBAccessHelper.SONG_ARTIST)); nowPlayingSongTitle.setText(currentTitle); nowPlayingSongArtist.setText(currentArtist); File file = new File(mContext.getExternalCacheDir() + "/current_album_art.jpg"); Bitmap bm = null; if (file.exists()) { bm = mApp.decodeSampledBitmapFromFile(file, screenWidth, screenHeight); nowPlayingAlbumArt.setScaleX(1.0f); nowPlayingAlbumArt.setScaleY(1.0f); } else { int defaultResource = UIElementsHelper.getIcon(mContext, "default_album_art"); bm = mApp.decodeSampledBitmapFromResource(defaultResource, screenWidth, screenHeight); nowPlayingAlbumArt.setScaleX(0.5f); nowPlayingAlbumArt.setScaleY(0.5f); } nowPlayingAlbumArt.setImageBitmap(bm); noMusicPlaying.setPaintFlags( noMusicPlaying.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); nowPlayingSongTitle.setPaintFlags(nowPlayingSongTitle.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.FAKE_BOLD_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG); nowPlayingSongArtist.setPaintFlags( nowPlayingSongArtist.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); /* Set the adapter. We'll pass in playbackIndecesList as the adapter's data backend. * The array can then be manipulated (reordered, items removed, etc) with no restrictions. * Each integer element in the array will be used as a pointer to a specific cursor row, * so there's no need to fiddle around with the actual cursor itself. */ nowPlayingQueueListViewAdapter = new NowPlayingQueueListViewAdapter(getActivity(), mApp.getService().getPlaybackIndecesList()); nowPlayingQueueListView.setAdapter(nowPlayingQueueListViewAdapter); nowPlayingQueueListView.setFastScrollEnabled(true); nowPlayingQueueListView.setDropListener(onDrop); nowPlayingQueueListView.setRemoveListener(onRemove); SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(nowPlayingQueueListView); simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT); nowPlayingQueueListView.setFloatViewManager(simpleFloatViewManager); //Scroll down to the current song. nowPlayingQueueListView.setSelection(mApp.getService().getCurrentSongIndex()); nowPlayingQueueListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View view, int index, long arg3) { mApp.getService().skipToTrack(index); } }); playPauseButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { mApp.getService().togglePlaybackState(); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mApp.getService().skipToNextTrack(); } }); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mApp.getService().skipToPreviousTrack(); } }); } return rootView; }
From source file:com.Duo.music.player.NowPlayingQueueActivity.NowPlayingQueueFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //Inflate the correct layout based on the selected theme. mContext = getActivity().getApplicationContext(); mApp = (Common) mContext;/*ww w. ja v a 2 s .co m*/ nowPlayingQueueFragment = this; sharedPreferences = mContext.getSharedPreferences("com.jams.music.player", Context.MODE_PRIVATE); mCursor = mApp.getService().getCursor(); View rootView = (ViewGroup) inflater.inflate(R.layout.now_playing_queue_layout, container, false); receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { updateSongInfo(); } }; //Notify the application that this fragment is now visible. sharedPreferences.edit().putBoolean("NOW_PLAYING_QUEUE_VISIBLE", true).commit(); //Get the screen's parameters. displayMetrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); screenWidth = displayMetrics.widthPixels; screenHeight = displayMetrics.heightPixels; noMusicPlaying = (TextView) rootView.findViewById(R.id.now_playing_queue_no_music_playing); nowPlayingAlbumArt = (ImageView) rootView.findViewById(R.id.now_playing_queue_album_art); nowPlayingSongTitle = (TextView) rootView.findViewById(R.id.now_playing_queue_song_title); nowPlayingSongArtist = (TextView) rootView.findViewById(R.id.now_playing_queue_song_artist); nowPlayingSongContainer = (RelativeLayout) rootView .findViewById(R.id.now_playing_queue_current_song_container); noMusicPlaying.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingSongTitle.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingSongArtist.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingQueueListView = (DragSortListView) rootView.findViewById(R.id.now_playing_queue_list_view); progressBar = (ProgressBar) rootView.findViewById(R.id.now_playing_queue_progressbar); playPauseButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_play); nextButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_next); previousButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_previous); //Apply the card layout's background based on the color theme. if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME").equals("LIGHT_CARDS_THEME")) { rootView.setBackgroundColor(0xFFEEEEEE); nowPlayingQueueListView.setDivider(getResources().getDrawable(R.drawable.transparent_drawable)); nowPlayingQueueListView.setDividerHeight(3); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layoutParams.setMargins(7, 3, 7, 3); nowPlayingQueueListView.setLayoutParams(layoutParams); } else if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME") .equals("DARK_CARDS_THEME")) { rootView.setBackgroundColor(0xFF000000); nowPlayingQueueListView.setDivider(getResources().getDrawable(R.drawable.transparent_drawable)); nowPlayingQueueListView.setDividerHeight(3); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layoutParams.setMargins(7, 3, 7, 3); nowPlayingQueueListView.setLayoutParams(layoutParams); } //Set the Now Playing container layout's background. nowPlayingSongContainer.setBackgroundColor(UIElementsHelper.getNowPlayingQueueBackground(mContext)); //Loop through the service's cursor and retrieve the current queue's information. if (sharedPreferences.getBoolean("SERVICE_RUNNING", false) == false || mApp.getService().getCurrentMediaPlayer() == null) { //No audio is currently playing. noMusicPlaying.setVisibility(View.VISIBLE); nowPlayingAlbumArt.setImageBitmap(mApp.decodeSampledBitmapFromResource(R.drawable.default_album_art, screenWidth / 3, screenWidth / 3)); nowPlayingQueueListView.setVisibility(View.GONE); nowPlayingSongTitle.setVisibility(View.GONE); nowPlayingSongArtist.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); } else { //Set the current play/pause conditions. try { //Hide the progressBar and display the controls. progressBar.setVisibility(View.GONE); playPauseButton.setVisibility(View.VISIBLE); nextButton.setVisibility(View.VISIBLE); previousButton.setVisibility(View.VISIBLE); if (mApp.getService().getCurrentMediaPlayer().isPlaying()) { playPauseButton.setImageResource(R.drawable.pause_holo_light); } else { playPauseButton.setImageResource(R.drawable.play_holo_light); } } catch (Exception e) { /* The mediaPlayer hasn't been initialized yet, so let's just keep the controls * hidden for now. Once the mediaPlayer is initialized and it starts playing, * updateSongInfo() will be called, and we can show the controls/hide the progressbar * there. For now though, we'll display the progressBar. */ progressBar.setVisibility(View.VISIBLE); playPauseButton.setVisibility(View.GONE); nextButton.setVisibility(View.GONE); previousButton.setVisibility(View.GONE); } //Retrieve and set the current title/artist/artwork. mCursor.moveToPosition( mApp.getService().getPlaybackIndecesList().get(mApp.getService().getCurrentSongIndex())); String currentTitle = mCursor.getString(mCursor.getColumnIndex(DBAccessHelper.SONG_TITLE)); String currentArtist = mCursor.getString(mCursor.getColumnIndex(DBAccessHelper.SONG_ARTIST)); nowPlayingSongTitle.setText(currentTitle); nowPlayingSongArtist.setText(currentArtist); File file = new File(mContext.getExternalCacheDir() + "/current_album_art.jpg"); Bitmap bm = null; if (file.exists()) { bm = mApp.decodeSampledBitmapFromFile(file, screenWidth, screenHeight); nowPlayingAlbumArt.setScaleX(1.0f); nowPlayingAlbumArt.setScaleY(1.0f); } else { int defaultResource = UIElementsHelper.getIcon(mContext, "default_album_art"); bm = mApp.decodeSampledBitmapFromResource(defaultResource, screenWidth, screenHeight); nowPlayingAlbumArt.setScaleX(0.5f); nowPlayingAlbumArt.setScaleY(0.5f); } nowPlayingAlbumArt.setImageBitmap(bm); noMusicPlaying.setPaintFlags( noMusicPlaying.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); nowPlayingSongTitle.setPaintFlags(nowPlayingSongTitle.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.FAKE_BOLD_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG); nowPlayingSongArtist.setPaintFlags( nowPlayingSongArtist.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); /* Set the adapter. We'll pass in playbackIndecesList as the adapter's data backend. * The array can then be manipulated (reordered, items removed, etc) with no restrictions. * Each integer element in the array will be used as a pointer to a specific cursor row, * so there's no need to fiddle around with the actual cursor itself. */ nowPlayingQueueListViewAdapter = new NowPlayingQueueListViewAdapter(getActivity(), mApp.getService().getPlaybackIndecesList()); nowPlayingQueueListView.setAdapter(nowPlayingQueueListViewAdapter); nowPlayingQueueListView.setFastScrollEnabled(true); nowPlayingQueueListView.setDropListener(onDrop); nowPlayingQueueListView.setRemoveListener(onRemove); SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(nowPlayingQueueListView); simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT); nowPlayingQueueListView.setFloatViewManager(simpleFloatViewManager); //Scroll down to the current song. nowPlayingQueueListView.setSelection(mApp.getService().getCurrentSongIndex()); nowPlayingQueueListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View view, int index, long arg3) { mApp.getService().skipToTrack(index); } }); playPauseButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { mApp.getService().togglePlaybackState(); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mApp.getService().skipToNextTrack(); } }); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mApp.getService().skipToPreviousTrack(); } }); } return rootView; }
From source file:com.jelly.music.player.NowPlayingQueueActivity.NowPlayingQueueFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //Inflate the correct layout based on the selected theme. mContext = getActivity().getApplicationContext(); mApp = (Common) mContext;//from w w w . j ava 2 s. c o m nowPlayingQueueFragment = this; sharedPreferences = mContext.getSharedPreferences("com.jelly.music.player", Context.MODE_PRIVATE); mCursor = mApp.getService().getCursor(); View rootView = (ViewGroup) inflater.inflate(R.layout.now_playing_queue_layout, container, false); receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { updateSongInfo(); } }; //Notify the application that this fragment is now visible. sharedPreferences.edit().putBoolean("NOW_PLAYING_QUEUE_VISIBLE", true).commit(); //Get the screen's parameters. displayMetrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); screenWidth = displayMetrics.widthPixels; screenHeight = displayMetrics.heightPixels; noMusicPlaying = (TextView) rootView.findViewById(R.id.now_playing_queue_no_music_playing); nowPlayingAlbumArt = (ImageView) rootView.findViewById(R.id.now_playing_queue_album_art); nowPlayingSongTitle = (TextView) rootView.findViewById(R.id.now_playing_queue_song_title); nowPlayingSongArtist = (TextView) rootView.findViewById(R.id.now_playing_queue_song_artist); nowPlayingSongContainer = (RelativeLayout) rootView .findViewById(R.id.now_playing_queue_current_song_container); noMusicPlaying.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingSongTitle.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingSongArtist.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Light")); nowPlayingQueueListView = (DragSortListView) rootView.findViewById(R.id.now_playing_queue_list_view); progressBar = (ProgressBar) rootView.findViewById(R.id.now_playing_queue_progressbar); playPauseButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_play); nextButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_next); previousButton = (ImageButton) rootView.findViewById(R.id.now_playing_queue_previous); //Apply the card layout's background based on the color theme. if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME").equals("LIGHT_CARDS_THEME")) { rootView.setBackgroundColor(0xFFEEEEEE); nowPlayingQueueListView.setDivider(getResources().getDrawable(R.drawable.transparent_drawable)); nowPlayingQueueListView.setDividerHeight(3); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layoutParams.setMargins(7, 3, 7, 3); nowPlayingQueueListView.setLayoutParams(layoutParams); } else if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME") .equals("DARK_CARDS_THEME")) { rootView.setBackgroundColor(0xFF000000); nowPlayingQueueListView.setDivider(getResources().getDrawable(R.drawable.transparent_drawable)); nowPlayingQueueListView.setDividerHeight(3); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); layoutParams.setMargins(7, 3, 7, 3); nowPlayingQueueListView.setLayoutParams(layoutParams); } //Set the Now Playing container layout's background. nowPlayingSongContainer.setBackgroundColor(UIElementsHelper.getNowPlayingQueueBackground(mContext)); //Loop through the service's cursor and retrieve the current queue's information. if (sharedPreferences.getBoolean("SERVICE_RUNNING", false) == false || mApp.getService().getCurrentMediaPlayer() == null) { //No audio is currently playing. noMusicPlaying.setVisibility(View.VISIBLE); nowPlayingAlbumArt.setImageBitmap(mApp.decodeSampledBitmapFromResource(R.drawable.default_album_art, screenWidth / 3, screenWidth / 3)); nowPlayingQueueListView.setVisibility(View.GONE); nowPlayingSongTitle.setVisibility(View.GONE); nowPlayingSongArtist.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); } else { //Set the current play/pause conditions. try { //Hide the progressBar and display the controls. progressBar.setVisibility(View.GONE); playPauseButton.setVisibility(View.VISIBLE); nextButton.setVisibility(View.VISIBLE); previousButton.setVisibility(View.VISIBLE); if (mApp.getService().getCurrentMediaPlayer().isPlaying()) { playPauseButton.setImageResource(R.drawable.pause_holo_light); } else { playPauseButton.setImageResource(R.drawable.play_holo_light); } } catch (Exception e) { /* The mediaPlayer hasn't been initialized yet, so let's just keep the controls * hidden for now. Once the mediaPlayer is initialized and it starts playing, * updateSongInfo() will be called, and we can show the controls/hide the progressbar * there. For now though, we'll display the progressBar. */ progressBar.setVisibility(View.VISIBLE); playPauseButton.setVisibility(View.GONE); nextButton.setVisibility(View.GONE); previousButton.setVisibility(View.GONE); } //Retrieve and set the current title/artist/artwork. mCursor.moveToPosition( mApp.getService().getPlaybackIndecesList().get(mApp.getService().getCurrentSongIndex())); String currentTitle = mCursor.getString(mCursor.getColumnIndex(DBAccessHelper.SONG_TITLE)); String currentArtist = mCursor.getString(mCursor.getColumnIndex(DBAccessHelper.SONG_ARTIST)); nowPlayingSongTitle.setText(currentTitle); nowPlayingSongArtist.setText(currentArtist); File file = new File(mContext.getExternalCacheDir() + "/current_album_art.jpg"); Bitmap bm = null; if (file.exists()) { bm = mApp.decodeSampledBitmapFromFile(file, screenWidth, screenHeight); nowPlayingAlbumArt.setScaleX(1.0f); nowPlayingAlbumArt.setScaleY(1.0f); } else { int defaultResource = UIElementsHelper.getIcon(mContext, "default_album_art"); bm = mApp.decodeSampledBitmapFromResource(defaultResource, screenWidth, screenHeight); nowPlayingAlbumArt.setScaleX(0.5f); nowPlayingAlbumArt.setScaleY(0.5f); } nowPlayingAlbumArt.setImageBitmap(bm); noMusicPlaying.setPaintFlags( noMusicPlaying.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); nowPlayingSongTitle.setPaintFlags(nowPlayingSongTitle.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.FAKE_BOLD_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG); nowPlayingSongArtist.setPaintFlags( nowPlayingSongArtist.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); /* Set the adapter. We'll pass in playbackIndecesList as the adapter's data backend. * The array can then be manipulated (reordered, items removed, etc) with no restrictions. * Each integer element in the array will be used as a pointer to a specific cursor row, * so there's no need to fiddle around with the actual cursor itself. */ nowPlayingQueueListViewAdapter = new NowPlayingQueueListViewAdapter(getActivity(), mApp.getService().getPlaybackIndecesList()); nowPlayingQueueListView.setAdapter(nowPlayingQueueListViewAdapter); nowPlayingQueueListView.setFastScrollEnabled(true); nowPlayingQueueListView.setDropListener(onDrop); nowPlayingQueueListView.setRemoveListener(onRemove); SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(nowPlayingQueueListView); simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT); nowPlayingQueueListView.setFloatViewManager(simpleFloatViewManager); //Scroll down to the current song. nowPlayingQueueListView.setSelection(mApp.getService().getCurrentSongIndex()); nowPlayingQueueListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View view, int index, long arg3) { mApp.getService().skipToTrack(index); } }); playPauseButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { mApp.getService().togglePlaybackState(); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mApp.getService().skipToNextTrack(); } }); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mApp.getService().skipToPreviousTrack(); } }); } return rootView; }
From source file:com.chute.android.photopickerplus.ui.adapter.AssetAccountAdapter.java
@SuppressWarnings("deprecation") @Override// www.j av a 2 s .c om public View getView(final int position, View convertView, final ViewGroup parent) { ViewHolder holder; int type = getItemViewType(position); if (convertView == null) { if (displayType == DisplayType.LIST) { convertView = inflater.inflate(R.layout.gc_adapter_assets_list, null); } else { convertView = inflater.inflate(R.layout.gc_adapter_assets_grid, null); } holder = new ViewHolder(); holder.imageViewThumb = (ImageView) convertView.findViewById(R.id.gcImageViewThumb); holder.imageViewTick = (ImageView) convertView.findViewById(R.id.gcImageViewTick); holder.imageVewVideo = (ImageView) convertView.findViewById(R.id.gcImageViewVideo); holder.imageViewTick.setTag(position); holder.textViewFolderTitle = (TextView) convertView.findViewById(R.id.gcTextViewAlbumTitle); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.imageViewThumb.setTag(position); if (type == AccountMediaType.FOLDER.ordinal()) { holder.imageViewTick.setVisibility(View.GONE); holder.textViewFolderTitle.setVisibility(View.VISIBLE); String folderName = ((AccountAlbumModel) getItem(position)).getName(); holder.textViewFolderTitle.setText(folderName != null ? folderName : ""); if (displayType == DisplayType.LIST) { holder.textViewFolderTitle.setTextSize(16f); holder.textViewFolderTitle.setTextColor(context.getResources().getColor(R.color.grey)); } holder.imageViewThumb .setBackgroundDrawable(context.getResources().getDrawable(R.drawable.album_default)); convertView.setOnClickListener(new OnFolderClickedListener(position)); } else if (type == AccountMediaType.FILE.ordinal()) { AccountMediaModel file = (AccountMediaModel) getItem(position); if (displayType == DisplayType.LIST) { holder.textViewFolderTitle.setVisibility(View.VISIBLE); holder.textViewFolderTitle.setText(file.getCaption()); holder.textViewFolderTitle.setTextSize(16f); holder.textViewFolderTitle.setTextColor(context.getResources().getColor(R.color.grey)); } holder.imageViewTick.setVisibility(View.VISIBLE); loader.displayImage(file.getThumbnail(), holder.imageViewThumb, null); convertView.setOnClickListener(new OnFileClickedListener(position)); if (file.getVideoUrl() != null) { holder.imageVewVideo.setVisibility(View.VISIBLE); } } if (tick.containsKey(position)) { holder.imageViewTick.setVisibility(View.VISIBLE); if (displayType == DisplayType.GRID) { convertView.setBackgroundColor(context.getResources().getColor(R.color.sky_blue)); } } else { holder.imageViewTick.setVisibility(View.GONE); if (displayType == DisplayType.GRID) { convertView.setBackgroundColor(context.getResources().getColor(R.color.gray_light)); } } return convertView; }
From source file:com.getchute.android.photopickerplus.ui.adapter.AssetAccountAdapter.java
@SuppressWarnings("deprecation") @Override/*from w w w . j a v a2 s . c o m*/ public View getView(final int position, View convertView, final ViewGroup parent) { ViewHolder holder; int type = getItemViewType(position); if (convertView == null) { if (displayType == DisplayType.LIST) { convertView = inflater.inflate(R.layout.gc_adapter_assets_list, null); } else { convertView = inflater.inflate(R.layout.gc_adapter_assets_grid, null); } holder = new ViewHolder(); holder.imageViewThumb = (ImageView) convertView.findViewById(R.id.gcImageViewThumb); holder.imageViewTick = (ImageView) convertView.findViewById(R.id.gcImageViewTick); holder.imageVewVideo = (ImageView) convertView.findViewById(R.id.gcImageViewVideo); holder.imageViewTick.setTag(position); holder.textViewFolderTitle = (TextView) convertView.findViewById(R.id.gcTextViewAlbumTitle); holder.viewSelect = convertView.findViewById(R.id.gcViewSelect); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.imageViewThumb.setTag(position); if (type == AccountMediaType.FOLDER.ordinal()) { holder.imageViewTick.setVisibility(View.GONE); holder.textViewFolderTitle.setVisibility(View.VISIBLE); String folderName = ((AccountAlbumModel) getItem(position)).getName(); holder.textViewFolderTitle.setText(folderName != null ? folderName : ""); holder.textViewFolderTitle.setTextSize(12f); if (displayType == DisplayType.LIST) { holder.textViewFolderTitle.setTextColor(context.getResources().getColor(R.color.grey)); } holder.imageViewThumb.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.folder)); convertView.setOnClickListener(new OnFolderClickedListener(position)); } else if (type == AccountMediaType.FILE.ordinal()) { AccountMediaModel file = (AccountMediaModel) getItem(position); if (displayType == DisplayType.LIST) { holder.textViewFolderTitle.setVisibility(View.VISIBLE); holder.textViewFolderTitle.setText(file.getCaption()); holder.textViewFolderTitle.setTextSize(16f); holder.textViewFolderTitle.setTextColor(context.getResources().getColor(R.color.grey)); } holder.imageViewTick.setVisibility(View.VISIBLE); Picasso.with(context).load(file.getThumbnail()).fit().centerCrop().into(holder.imageViewThumb); convertView.setOnClickListener(new OnFileClickedListener(position)); if (file.getVideoUrl() != null) { holder.imageVewVideo.setVisibility(View.VISIBLE); } } if (tick.containsKey(position)) { holder.imageViewTick.setVisibility(View.VISIBLE); if (displayType == DisplayType.GRID) { holder.viewSelect.setVisibility(View.VISIBLE); convertView.setBackgroundColor(context.getResources().getColor(R.color.sky_blue)); } } else { holder.imageViewTick.setVisibility(View.GONE); if (displayType == DisplayType.GRID) { holder.viewSelect.setVisibility(View.GONE); convertView.setBackgroundColor(context.getResources().getColor(R.color.gray_light)); } } return convertView; }
From source file:com.android.leanlauncher.LauncherTransitionable.java
private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded, final AppsCustomizePagedView.ContentType contentType) { if (mStateAnimation != null) { mStateAnimation.setDuration(0);/*from w w w . j a v a 2s. c o m*/ mStateAnimation.cancel(); mStateAnimation = null; } boolean material = Utilities.isLmpOrAbove(); final Resources res = getResources(); final int revealDuration = res.getInteger(R.integer.config_appsCustomizeRevealTime); final int itemsAlphaStagger = res.getInteger(R.integer.config_appsCustomizeItemsAlphaStagger); final View fromView = mWorkspace; final AppsCustomizeTabHost toView = mAppsCustomizeTabHost; final ArrayList<View> layerViews = new ArrayList<View>(); Workspace.State workspaceState = contentType == AppsCustomizePagedView.ContentType.Widgets ? Workspace.State.OVERVIEW_HIDDEN : Workspace.State.NORMAL_HIDDEN; Animator workspaceAnim = mWorkspace.getChangeStateAnimation(workspaceState, animated, layerViews); // Set the content type for the all apps/widgets space mAppsCustomizeTabHost.setContentTypeImmediate(contentType); // If for some reason our views aren't initialized, don't animate boolean initialized = getAllAppsButton() != null; if (animated && initialized) { mStateAnimation = LauncherAnimUtils.createAnimatorSet(); final AppsCustomizePagedView content = (AppsCustomizePagedView) toView .findViewById(R.id.apps_customize_pane_content); final View page = content.getPageAt(content.getCurrentPage()); final View revealView = toView.findViewById(R.id.fake_page); final boolean isWidgetTray = contentType == AppsCustomizePagedView.ContentType.Widgets; revealView.setBackgroundColor(getResources().getColor(R.color.widget_text_panel)); // Hide the real page background, and swap in the fake one content.setPageBackgroundsVisible(false); revealView.setVisibility(View.VISIBLE); // We need to hide this view as the animation start will be posted. revealView.setAlpha(0); int width = revealView.getMeasuredWidth(); int height = revealView.getMeasuredHeight(); float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4); revealView.setTranslationY(0); revealView.setTranslationX(0); // Get the y delta between the center of the page and the center of the all apps button int[] allAppsToPanelDelta = Utilities.getCenterDeltaInScreenSpace(revealView, getAllAppsButton(), null); float alpha = 0; float xDrift = 0; float yDrift = 0; if (material) { alpha = isWidgetTray ? 0.3f : 1f; yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1]; xDrift = isWidgetTray ? 0 : allAppsToPanelDelta[0]; } else { yDrift = 2 * height / 3; xDrift = 0; } final float initAlpha = alpha; revealView.setLayerType(View.LAYER_TYPE_HARDWARE, null); layerViews.add(revealView); PropertyValuesHolder panelAlpha = PropertyValuesHolder.ofFloat("alpha", initAlpha, 1f); PropertyValuesHolder panelDriftY = PropertyValuesHolder.ofFloat("translationY", yDrift, 0); PropertyValuesHolder panelDriftX = PropertyValuesHolder.ofFloat("translationX", xDrift, 0); ObjectAnimator panelAlphaAndDrift = ObjectAnimator.ofPropertyValuesHolder(revealView, panelAlpha, panelDriftY, panelDriftX); panelAlphaAndDrift.setDuration(revealDuration); panelAlphaAndDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); mStateAnimation.play(panelAlphaAndDrift); if (page != null) { page.setVisibility(View.VISIBLE); page.setLayerType(View.LAYER_TYPE_HARDWARE, null); layerViews.add(page); ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", yDrift, 0); page.setTranslationY(yDrift); pageDrift.setDuration(revealDuration); pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); pageDrift.setStartDelay(itemsAlphaStagger); mStateAnimation.play(pageDrift); page.setAlpha(0f); ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, "alpha", 0f, 1f); itemsAlpha.setDuration(revealDuration); itemsAlpha.setInterpolator(new AccelerateInterpolator(1.5f)); itemsAlpha.setStartDelay(itemsAlphaStagger); mStateAnimation.play(itemsAlpha); } View pageIndicators = toView.findViewById(R.id.apps_customize_page_indicator); pageIndicators.setAlpha(0.01f); ObjectAnimator indicatorsAlpha = ObjectAnimator.ofFloat(pageIndicators, "alpha", 1f); indicatorsAlpha.setDuration(revealDuration); mStateAnimation.play(indicatorsAlpha); if (material) { final View allApps = getAllAppsButton(); int allAppsButtonSize = LauncherAppState.getInstance().getDynamicGrid() .getDeviceProfile().allAppsButtonVisualSize; float startRadius = isWidgetTray ? 0 : allAppsButtonSize / 2; Animator reveal = ViewAnimationUtils.createCircularReveal(revealView, width / 2, height / 2, startRadius, revealRadius); reveal.setDuration(revealDuration); reveal.setInterpolator(new LogDecelerateInterpolator(100, 0)); reveal.addListener(new AnimatorListenerAdapter() { public void onAnimationStart(Animator animation) { if (!isWidgetTray) { allApps.setVisibility(View.INVISIBLE); } } public void onAnimationEnd(Animator animation) { if (!isWidgetTray) { allApps.setVisibility(View.VISIBLE); } } }); mStateAnimation.play(reveal); } mStateAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { dispatchOnLauncherTransitionEnd(fromView, animated, false); dispatchOnLauncherTransitionEnd(toView, animated, false); revealView.setVisibility(View.INVISIBLE); revealView.setLayerType(View.LAYER_TYPE_NONE, null); if (page != null) { page.setLayerType(View.LAYER_TYPE_NONE, null); } content.setPageBackgroundsVisible(true); // This can hold unnecessary references to views. mStateAnimation = null; } }); if (workspaceAnim != null) { mStateAnimation.play(workspaceAnim); } dispatchOnLauncherTransitionPrepare(fromView, animated, false); dispatchOnLauncherTransitionPrepare(toView, animated, false); final AnimatorSet stateAnimation = mStateAnimation; final Runnable startAnimRunnable = new Runnable() { public void run() { // Check that mStateAnimation hasn't changed while // we waited for a layout/draw pass if (mStateAnimation != stateAnimation) return; dispatchOnLauncherTransitionStart(fromView, animated, false); dispatchOnLauncherTransitionStart(toView, animated, false); revealView.setAlpha(initAlpha); if (Utilities.isLmpOrAbove()) { for (int i = 0; i < layerViews.size(); i++) { View v = layerViews.get(i); if (v != null) { if (Utilities.isViewAttachedToWindow(v)) v.buildLayer(); } } } mStateAnimation.start(); } }; toView.bringToFront(); toView.setVisibility(View.VISIBLE); toView.post(startAnimRunnable); } else { toView.setTranslationX(0.0f); toView.setTranslationY(0.0f); toView.setScaleX(1.0f); toView.setScaleY(1.0f); toView.setVisibility(View.VISIBLE); toView.bringToFront(); dispatchOnLauncherTransitionPrepare(fromView, animated, false); dispatchOnLauncherTransitionStart(fromView, animated, false); dispatchOnLauncherTransitionEnd(fromView, animated, false); dispatchOnLauncherTransitionPrepare(toView, animated, false); dispatchOnLauncherTransitionStart(toView, animated, false); dispatchOnLauncherTransitionEnd(toView, animated, false); } }
From source file:com.roiland.crm.sm.ui.view.ScOppoInfoFragment.java
/** * /*from w ww. jav a 2 s . c om*/ * <pre> * ??list * </pre> * */ private void refreshFollowInfoList() { if (mFollowInfo != null && followPlanAdapter != null) { mFollowInfo.removeAllViews(); for (int i = 0; i < followPlanAdapter.getCount(); i++) { mFollowInfo.addView(followPlanAdapter.getView(i, null, null)); View dividerView = new View(getActivity()); dividerView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 1)); dividerView.setBackgroundColor(getResources().getColor(R.color.list_divider)); mFollowInfo.addView(dividerView); } } }
From source file:com.roiland.crm.sm.ui.view.ScOppoInfoFragment.java
/** * // www . j av a 2 s .c o m * <pre> * ? * </pre> * */ public void refreshCustList() { if (mCustomInfo != null && customerInfoAdapter != null) { mCustomInfo.removeAllViews(); for (int i = 0; i < customerInfoAdapter.getCount(); i++) { mCustomInfo.addView(customerInfoAdapter.getView(i, null, null)); View dividerView = new View(getActivity()); dividerView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 1)); dividerView.setBackgroundColor(getResources().getColor(R.color.list_divider)); mCustomInfo.addView(dividerView); } if (project != null && project.getCustomer() != null && !StringUtils.isEmpty(project.getCustomer().getProvince()) && custFlag) { BaseInfoRowViewItem item = (BaseInfoRowViewItem) mCustomInfo.findViewWithTag(addressInfoList[1]); if (item != null) item.setParentKey(project.getCustomer().getProvinceCode()); } if (project != null && project.getCustomer() != null && !StringUtils.isEmpty(project.getCustomer().getCity()) && custFlag) { BaseInfoRowViewItem item = (BaseInfoRowViewItem) mCustomInfo.findViewWithTag(addressInfoList[2]); if (item != null) item.setParentKey(project.getCustomer().getProvinceCode()); item.setParentKey2(project.getCustomer().getCityCode()); } } }