com.afollestad.materialdialogs.util.DialogUtils Java Examples
The following examples show how to use
com.afollestad.materialdialogs.util.DialogUtils.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BleDeviceActivity.java From bleYan with GNU General Public License v2.0 | 6 votes |
protected void invalidateInputMinMaxIndicator(EditText input, int currentLength) { if (input != null) { int materialBlue = ContextCompat.getColor(this, com.afollestad.materialdialogs.R.color.md_material_blue_600); int widgetColor = DialogUtils.resolveColor(this, com.afollestad.materialdialogs.R.attr.colorAccent, materialBlue); if (Build.VERSION.SDK_INT >= 21) { widgetColor = DialogUtils.resolveColor(this, android.R.attr.colorAccent, widgetColor); } final boolean isDisabled = currentLength > 20; final int colorText = isDisabled ? ContextCompat.getColor(this, R.color.red) : -1; final int colorWidget = isDisabled ? ContextCompat.getColor(this, R.color.red) : widgetColor; input.setTextColor(colorText); MDTintHelper.setTint(input, colorWidget); } }
Example #2
Source File: DevicesCommandFragment.java From bleYan with GNU General Public License v2.0 | 6 votes |
protected void invalidateInputMinMaxIndicator(EditText inputMinMax, int currentLength) { if (inputMinMax != null) { int materialBlue = ContextCompat.getColor(getActivity(), com.afollestad.materialdialogs.R.color.md_material_blue_600); int widgetColor = DialogUtils.resolveColor(getActivity(), com.afollestad.materialdialogs.R.attr.colorAccent, materialBlue); if (Build.VERSION.SDK_INT >= 21) { widgetColor = DialogUtils.resolveColor(getActivity(), android.R.attr.colorAccent, widgetColor); } final boolean isDisabled = currentLength > 20; final int colorText = isDisabled ? ContextCompat.getColor(getActivity(), R.color.red) : -1; final int colorWidget = isDisabled ? ContextCompat.getColor(getActivity(), R.color.red) : widgetColor; inputMinMax.setTextColor(colorText); MDTintHelper.setTint(inputMinMax, colorWidget); } }
Example #3
Source File: ColorChooserDialog.java From OpenHub with GNU General Public License v3.0 | 6 votes |
@ColorInt private int getSelectedColor() { if (colorChooserCustomFrame != null && colorChooserCustomFrame.getVisibility() == View.VISIBLE) { return selectedCustomColor; } int color = 0; if (subIndex() > -1) { color = colorsSub[topIndex()][subIndex()]; } else if (topIndex() > -1) { color = colorsTop[topIndex()]; } if (color == 0) { int fallback = 0; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { fallback = DialogUtils.resolveColor(getActivity(), android.R.attr.colorAccent); } color = DialogUtils.resolveColor(getActivity(), R.attr.colorAccent, fallback); } return color; }
Example #4
Source File: ColorChooserDialog.java From APlayer with GNU General Public License v3.0 | 6 votes |
@ColorInt private int getSelectedColor() { if (mColorChooserCustomFrame != null && mColorChooserCustomFrame.getVisibility() == View.VISIBLE) { return mSelectedCustomColor; } int color = 0; if (subIndex() > -1) { color = mColorsSub[topIndex()][subIndex()]; } else if (topIndex() > -1) { color = mColorsTop[topIndex()]; } if (color == 0) { int fallback = 0; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { fallback = DialogUtils.resolveColor(getActivity(), android.R.attr.colorAccent); } color = DialogUtils.resolveColor(getActivity(), R.attr.colorAccent, fallback); } return color; }
Example #5
Source File: RTApi.java From memoir with Apache License 2.0 | 5 votes |
/** * @param context Can be an Application or an Activity context * @param rtProxy The RTProxy provided by the app. * @param mediaFactory the RTMediaFactory provided by the app. */ public RTApi(Context context, RTProxy rtProxy, RTMediaFactory<RTImage, RTAudio, RTVideo> mediaFactory) { synchronized (sTheLock) { sAppContext = context.getApplicationContext(); } sDarkTheme = DialogUtils.resolveBoolean(context, R.attr.md_dark_theme, false); mRTProxy = rtProxy; mMediaFactory = mediaFactory; }
Example #6
Source File: AlbumDetailActivity.java From Phonograph with GNU General Public License v3.0 | 5 votes |
private void setUpViews() { setUpRecyclerView(); setUpSongsAdapter(); artistTextView.setOnClickListener(v -> { if (album != null) { NavigationUtil.goToArtist(AlbumDetailActivity.this, album.getArtistId()); } }); setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor)); }
Example #7
Source File: MaterialEditTextPreference.java From 920-text-editor-v2 with Apache License 2.0 | 5 votes |
private void init(Context context, AttributeSet attrs) { setLayoutResource(context, this, attrs); int fallback; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) fallback = DialogUtils.resolveColor(context, android.R.attr.colorAccent); else fallback = 0; fallback = DialogUtils.resolveColor(context, com.afollestad.materialdialogs.commons.R.attr.colorAccent, fallback); mColor = DialogUtils.resolveColor(context, com.afollestad.materialdialogs.commons.R.attr.md_widget_color, fallback); mEditText = new AppCompatEditText(context, attrs); // Give it an ID so it can be saved/restored mEditText.setId(android.R.id.edit); mEditText.setEnabled(true); }
Example #8
Source File: RTApi.java From memoir with Apache License 2.0 | 5 votes |
/** * @param context Can be an Application or an Activity context * @param rtProxy The RTProxy provided by the app. * @param mediaFactory the RTMediaFactory provided by the app. */ public RTApi(Context context, RTProxy rtProxy, RTMediaFactory<RTImage, RTAudio, RTVideo> mediaFactory) { synchronized (sTheLock) { sAppContext = context.getApplicationContext(); } sDarkTheme = DialogUtils.resolveBoolean(context, R.attr.md_dark_theme, false); mRTProxy = rtProxy; mMediaFactory = mediaFactory; }
Example #9
Source File: AlbumDetailActivity.java From VinylMusicPlayer with GNU General Public License v3.0 | 5 votes |
private void setUpViews() { setUpRecyclerView(); setUpSongsAdapter(); artistTextView.setOnClickListener(v -> { if (album != null) { NavigationUtil.goToArtist(AlbumDetailActivity.this, album.getArtistId()); } }); setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor)); }
Example #10
Source File: AlbumDetailActivity.java From Orin with GNU General Public License v3.0 | 5 votes |
private void setUpObservableListViewParams() { albumArtViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height); toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor); int toolbarHeight = Util.getActionBarSize(this); titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height_album_detail); headerOffset = toolbarHeight; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { headerOffset += getResources().getDimensionPixelSize(R.dimen.status_bar_padding); } }
Example #11
Source File: ArtistDetailActivity.java From Orin with GNU General Public License v3.0 | 5 votes |
private void setUpObservableListViewParams() { artistImageViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height_artist_profile); toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor); int toolbarHeight = Util.getActionBarSize(this); titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height); headerOffset = toolbarHeight; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { headerOffset += getResources().getDimensionPixelSize(R.dimen.status_bar_padding); } }
Example #12
Source File: AlbumDetailActivity.java From Music-Player with GNU General Public License v3.0 | 5 votes |
private void setUpViews() { setUpRecyclerView(); setUpSongsAdapter(); artistTextView.setOnClickListener(v -> { if (album != null) { NavigationUtil.goToArtist(AlbumDetailActivity.this, album.getArtistId()); } }); setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor)); }
Example #13
Source File: ArtistDetailActivity.java From Music-Player with GNU General Public License v3.0 | 4 votes |
private void setUpViews() { setUpSongListView(); setUpAlbumRecyclerView(); setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor)); }
Example #14
Source File: CircleView.java From APlayer with GNU General Public License v3.0 | 4 votes |
@Override public void setBackgroundResource(@ColorRes int color) { setBackgroundColor(DialogUtils.getColor(getContext(), color)); }
Example #15
Source File: ArtistDetailActivity.java From VinylMusicPlayer with GNU General Public License v3.0 | 4 votes |
private void setUpViews() { setUpSongListView(); setUpAlbumRecyclerView(); setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor)); }
Example #16
Source File: ColorChooserDialog.java From APlayer with GNU General Public License v3.0 | 4 votes |
@NonNull public Builder customColors(@ArrayRes int topLevel, @Nullable int[][] subLevel) { mColorsTop = DialogUtils.getColorArray(mContext, topLevel); mColorsSub = subLevel; return this; }
Example #17
Source File: ColorChooserDialog.java From OpenHub with GNU General Public License v3.0 | 4 votes |
@NonNull public Builder customColors(@ArrayRes int topLevel, @Nullable int[][] subLevel) { colorsTop = DialogUtils.getColorArray(context, topLevel); colorsSub = subLevel; return this; }
Example #18
Source File: ArtistDetailActivity.java From Phonograph with GNU General Public License v3.0 | 4 votes |
private void setUpViews() { setUpSongListView(); setUpAlbumRecyclerView(); setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor)); }