android.support.v4.content.res.ResourcesCompat Java Examples
The following examples show how to use
android.support.v4.content.res.ResourcesCompat.
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: PolygonOverlayActivity.java From android-map-sdk with Apache License 2.0 | 6 votes |
@Override public void onMapReady(@NonNull NaverMap naverMap) { int color = ResourcesCompat.getColor(getResources(), R.color.primary, getTheme()); PolygonOverlay polygon = new PolygonOverlay(); polygon.setCoords(COORDS_1); polygon.setColor(ColorUtils.setAlphaComponent(color, 31)); polygon.setOutlineColor(color); polygon.setOutlineWidth(getResources().getDimensionPixelSize(R.dimen.overlay_line_width)); polygon.setMap(naverMap); PolygonOverlay polygonWithHole = new PolygonOverlay(); polygonWithHole.setCoords(COORDS_2); polygonWithHole.setHoles(HOLES); polygonWithHole.setColor( ColorUtils.setAlphaComponent(ResourcesCompat.getColor(getResources(), R.color.gray, getTheme()), 127)); polygonWithHole.setMap(naverMap); }
Example #2
Source File: Util.java From Camera-Roll-Android-App with Apache License 2.0 | 6 votes |
@SuppressWarnings("inlineValue") public static TextView setToolbarTypeface(Toolbar toolbar) { for (int i = 0; i < toolbar.getChildCount(); i++) { View view = toolbar.getChildAt(i); if (view instanceof TextView) { TextView textView = (TextView) view; if (textView.getText().equals(toolbar.getTitle())) { Typeface typeface = ResourcesCompat .getFont(toolbar.getContext(), R.font.roboto_mono_medium); textView.setTypeface(typeface); return textView; } } } return null; }
Example #3
Source File: MainActivity.java From android-docs-samples with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Resources resources = getResources(); final Resources.Theme theme = getTheme(); mColorHearing = ResourcesCompat.getColor(resources, R.color.status_hearing, theme); mColorNotHearing = ResourcesCompat.getColor(resources, R.color.status_not_hearing, theme); setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); mStatus = (TextView) findViewById(R.id.status); mText = (TextView) findViewById(R.id.text); mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); final ArrayList<String> results = savedInstanceState == null ? null : savedInstanceState.getStringArrayList(STATE_RESULTS); mAdapter = new ResultAdapter(results); mRecyclerView.setAdapter(mAdapter); }
Example #4
Source File: GlobalZIndexActivity.java From android-map-sdk with Apache License 2.0 | 6 votes |
@Override public void onMapReady(@NonNull NaverMap naverMap) { PathOverlay pathOverlay = new PathOverlay(); pathOverlay.setCoords(PATH_COORDS); pathOverlay.setWidth(getResources().getDimensionPixelSize(R.dimen.path_overlay_width)); pathOverlay.setColor(ResourcesCompat.getColor(getResources(), R.color.primary, getTheme())); pathOverlay.setOutlineWidth(getResources().getDimensionPixelSize(R.dimen.path_overlay_outline_width)); pathOverlay.setOutlineColor(Color.WHITE); pathOverlay.setMap(naverMap); Marker marker1 = new Marker(); marker1.setPosition(new LatLng(37.5701761, 126.9799315)); marker1.setCaptionText(getString(R.string.marker_over_path)); marker1.setMap(naverMap); Marker marker2 = new Marker(); marker2.setPosition(new LatLng(37.5664663, 126.9772952)); marker2.setIcon(MarkerIcons.BLUE); marker2.setCaptionText(getString(R.string.marker_under_path)); marker2.setGlobalZIndex(PathOverlay.DEFAULT_GLOBAL_Z_INDEX - 1); marker2.setMap(naverMap); }
Example #5
Source File: TaskEditActivity.java From Kandroid with GNU General Public License v3.0 | 6 votes |
private void setButtonColor() { if (kanboardColors == null || defaultColor == null) return; btnColor.setEnabled(true); Drawable dot = ResourcesCompat.getDrawable(getResources(), R.drawable.shape_circle, null); if (colorId != null && kanboardColors.get(colorId) != null) { //FIXME: it seems that colorId can have a value that is not in the list. Fallback to defaultColor for now. dot.setColorFilter(kanboardColors.get(colorId).getBackground(), PorterDuff.Mode.MULTIPLY); btnColor.setText(Utils.fromHtml(getString(R.string.taskedit_color, kanboardColors.get(colorId).getName()))); } else { dot.setColorFilter(kanboardColors.get(defaultColor).getBackground(), PorterDuff.Mode.MULTIPLY); btnColor.setText(Utils.fromHtml(getString(R.string.taskedit_color, kanboardColors.get(defaultColor).getName()))); } btnColor.setCompoundDrawablesRelativeWithIntrinsicBounds(dot, null, null, null); }
Example #6
Source File: StepperLayout.java From android-material-stepper with Apache License 2.0 | 6 votes |
private void setCompoundDrawablesForNavigationButtons(@DrawableRes int backDrawableResId, @DrawableRes int nextDrawableResId) { Drawable chevronStartDrawable = backDrawableResId != StepViewModel.NULL_DRAWABLE ? ResourcesCompat.getDrawable(getContext().getResources(), backDrawableResId, null) : null; Drawable chevronEndDrawable = nextDrawableResId != StepViewModel.NULL_DRAWABLE ? ResourcesCompat.getDrawable(getContext().getResources(), nextDrawableResId, null) : null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { mBackNavigationButton.setCompoundDrawablesRelativeWithIntrinsicBounds(chevronStartDrawable, null, null, null); } else { mBackNavigationButton.setCompoundDrawablesWithIntrinsicBounds(chevronStartDrawable, null, null, null); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { mNextNavigationButton.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, chevronEndDrawable, null); } else { mNextNavigationButton.setCompoundDrawablesWithIntrinsicBounds(null, null, chevronEndDrawable, null); } TintUtil.tintTextView(mBackNavigationButton, mBackButtonColor); TintUtil.tintTextView(mNextNavigationButton, mNextButtonColor); TintUtil.tintTextView(mCompleteNavigationButton, mCompleteButtonColor); }
Example #7
Source File: VkAudioAdapter.java From vk_music_android with GNU General Public License v3.0 | 6 votes |
void bind(VKApiAudio audio) { binding.getRoot().setOnClickListener(v -> listener.onAudioClicked(audio, getAdapterPosition())); binding.audioOptions.setOnClickListener(v -> showPopupMenu(v, audio)); binding.dragHandle.setOnTouchListener((v, event) -> { if (startDragListener == null) { return false; } startDragListener.startDrag(this); return true; }); binding.setAudio(audio); binding.executePendingBindings(); if (currentAudio == null || audio.id != currentAudio.id) { binding.audioTitle.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, null, null); } else { binding.audioTitle.setCompoundDrawablesRelativeWithIntrinsicBounds( ResourcesCompat.getDrawable(resources, R.drawable.ic_now_playing_indicator, null), null, null, null ); } }
Example #8
Source File: VerticalStepperItemView.java From android-vertical-stepper-view with MIT License | 6 votes |
private void setStateComplete() { setMarginBottom( false ); circle.setBackgroundActive(); if ( isEditable() ) circle.setIconEdit(); else circle.setIconCheck(); title.setTextColor( ResourcesCompat.getColor( getResources(), R.color.vertical_stepper_view_black_87, null ) ); title.setTypeface( title.getTypeface(), Typeface.BOLD ); summary.setVisibility( TextUtils.isEmpty( summary.getText() ) ? View.GONE : View.VISIBLE ); contentWrapper.setVisibility( View.GONE ); }
Example #9
Source File: ConnectActivity.java From homeassist with Apache License 2.0 | 6 votes |
private void showError(String message) { Drawable warningIcon = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_warning_white_18dp, null); SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(message); mSnackbar = Snackbar.make(findViewById(android.R.id.content), builder, Snackbar.LENGTH_LONG) .setAction(getString(R.string.action_retry), new OnClickListener() { @Override public void onClick(View view) { attemptLogin(); } }); TextView textView = mSnackbar.getView().findViewById(android.support.design.R.id.snackbar_text); textView.setCompoundDrawablesWithIntrinsicBounds(warningIcon, null, null, null); textView.setCompoundDrawablePadding(getResources().getDimensionPixelOffset(R.dimen.icon_8dp)); mSnackbar.getView().setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.md_red_A200, null)); mSnackbar.show(); }
Example #10
Source File: DrawableHelper.java From candybar-library with Apache License 2.0 | 6 votes |
@Nullable public static Drawable getHighQualityIcon(@NonNull Context context, String packageName) { try { PackageManager packageManager = context.getPackageManager(); ApplicationInfo info = packageManager.getApplicationInfo( packageName, PackageManager.GET_META_DATA); Resources resources = packageManager.getResourcesForApplication(packageName); int density = DisplayMetrics.DENSITY_XXHIGH; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { density = DisplayMetrics.DENSITY_XXXHIGH; } Drawable drawable = ResourcesCompat.getDrawableForDensity( resources, info.icon, density, null); if (drawable != null) return drawable; return info.loadIcon(packageManager); } catch (Exception | OutOfMemoryError e) { LogUtil.e(Log.getStackTraceString(e)); } return null; }
Example #11
Source File: SocialMentionAutoComplete.java From SocialMentionAutoComplete with Apache License 2.0 | 6 votes |
public CharSequence terminateToken(CharSequence text) { int i = text.length(); while (i > 0 && text.charAt(i - 1) == ' ') { i--; } if (i > 0 && text.charAt(i - 1) == ' ') { return text; } else { // Returns colored text for selected token SpannableString sp = new SpannableString(String.format(formattedOfString, text)); int textColor = ResourcesCompat.getColor(getResources(), R.color.colorPrimary, null); sp.setSpan(new ForegroundColorSpan(textColor), 0, text.length() + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return sp; } }
Example #12
Source File: MapFragment.java From AIMSICDL with GNU General Public License v3.0 | 5 votes |
/** * Description: Initialises the Map and sets initial options such as: * Zoom levels and controls * Compass * ScaleBar * Cluster Pin colors * Location update settings */ private void setUpMapIfNeeded() { // Check if we were successful in obtaining the map. mMap.setBuiltInZoomControls(true); mMap.setMultiTouchControls(true); mMap.setMinZoomLevel(3); mMap.setMaxZoomLevel(19); // Latest OSM can go to 21! mMap.getTileProvider().createTileCache(); mCompassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), mMap); ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(getActivity()); mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10); mScaleBarOverlay.setCentred(true); // Sets cluster pin color mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(getActivity()); //BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange); BitmapDrawable mapPinDrawable = (BitmapDrawable) ResourcesCompat.getDrawable(getResources(), R.drawable.ic_map_pin_orange, null); mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap()); GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(getActivity().getBaseContext()); gpsMyLocationProvider.setLocationUpdateMinDistance(100); // [m] // Set the minimum distance for location updates gpsMyLocationProvider.setLocationUpdateMinTime(10000); // [ms] // Set the minimum time interval for location updates mMyLocationOverlay = new MyLocationNewOverlay(getActivity().getBaseContext(), gpsMyLocationProvider, mMap); mMyLocationOverlay.setDrawAccuracyEnabled(true); mMap.getOverlays().add(mCellTowerGridMarkerClusterer); mMap.getOverlays().add(mMyLocationOverlay); mMap.getOverlays().add(mCompassOverlay); mMap.getOverlays().add(mScaleBarOverlay); }
Example #13
Source File: Util.java From Camera-Roll-Android-App with Apache License 2.0 | 5 votes |
public static void showSnackbar(Snackbar snackbar) { snackbar.getView().setTag(SNACKBAR); TextView textView = snackbar.getView() .findViewById(android.support.design.R.id.snackbar_text); textView.setTypeface(ResourcesCompat .getFont(textView.getContext(), R.font.roboto_mono_medium)); snackbar.show(); }
Example #14
Source File: SublimeThemer.java From SublimeNavigationView with Apache License 2.0 | 5 votes |
public Drawable getGroupCollapseDrawable() { if (mGroupCollapseDrawable == null) { mGroupCollapseDrawable = ResourcesCompat.getDrawable(mContext.getResources(), R.drawable.snv_collapse, mContext.getTheme()); } // Return a new drawable since this method will be // called multiple times return mGroupCollapseDrawable.getConstantState().newDrawable(); }
Example #15
Source File: CheckRadioView.java From Matisse with Apache License 2.0 | 5 votes |
private void init() { selectedColor = ResourcesCompat.getColor( getResources(), R.color.zhihu_item_checkCircle_backgroundColor, getContext().getTheme()); unSelectedColor = ResourcesCompat.getColor( getResources(), R.color.zhihu_check_original_radio_disable, getContext().getTheme()); setChecked(false); }
Example #16
Source File: SublimeThemer.java From SublimeNavigationView with Apache License 2.0 | 5 votes |
public Drawable getGroupExpandDrawable() { if (mGroupExpandDrawable == null) { mGroupExpandDrawable = ResourcesCompat.getDrawable(mContext.getResources(), R.drawable.snv_expand, mContext.getTheme()); } // Return a new drawable since this method will be // called multiple times return mGroupExpandDrawable.getConstantState().newDrawable(); }
Example #17
Source File: ShotFragment.java From Protein with Apache License 2.0 | 5 votes |
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); toolbar.getNavigationIcon().setColorFilter(ResourcesCompat.getColor(getResources(), R.color.icon_grey, getActivity().getTheme()), PorterDuff.Mode.SRC_ATOP); toolbar.setNavigationOnClickListener(v -> getActivity().onBackPressed()); presenter.start(); }
Example #18
Source File: ImageLoadUtil.java From ucar-weex-core with Apache License 2.0 | 5 votes |
public static Drawable getDrawableByName(Context context, String drawableName) { Resources resources = context.getResources(); if (TextUtils.isEmpty(drawableName)) { WXLogUtils.e("drawableName is null"); return null; } int id = resources.getIdentifier(drawableName, "drawable", context.getPackageName()); return id == 0 ? null : ResourcesCompat.getDrawable(resources, id, null); }
Example #19
Source File: SublimeThemer.java From SublimeNavigationView with Apache License 2.0 | 5 votes |
public Drawable getGroupExpandDrawable() { if (mGroupExpandDrawable == null) { mGroupExpandDrawable = ResourcesCompat.getDrawable(mContext.getResources(), R.drawable.snv_expand, mContext.getTheme()); } // Return a new drawable since this method will be // called multiple times return mGroupExpandDrawable.getConstantState().newDrawable(); }
Example #20
Source File: FullScreenDialogFragment.java From FullScreenDialog with Apache License 2.0 | 5 votes |
private void setThemeBackground(View view) { TypedValue a = new TypedValue(); getActivity().getTheme().resolveAttribute(android.R.attr.windowBackground, a, true); if (a.type >= TypedValue.TYPE_FIRST_COLOR_INT && a.type <= TypedValue.TYPE_LAST_COLOR_INT) { view.setBackgroundColor(a.data); } else { try { Drawable d = ResourcesCompat.getDrawable(getActivity().getResources(), a.resourceId, getActivity().getTheme()); ViewCompat.setBackground(view, d); } catch (Resources.NotFoundException ignore) { } } }
Example #21
Source File: MapViewerOsmDroid.java From AIMSICDL with GNU General Public License v3.0 | 5 votes |
/** * Description: Initialises the Map and sets initial options such as: * Zoom levels and controls * Compass * ScaleBar * Cluster Pin colors * Location update settings */ private void setUpMapIfNeeded() { // Check if we were successful in obtaining the map. mMap.setBuiltInZoomControls(true); mMap.setMultiTouchControls(true); mMap.setMinZoomLevel(3); mMap.setMaxZoomLevel(19); // Latest OSM can go to 21! mMap.getTileProvider().createTileCache(); mCompassOverlay = new CompassOverlay(this, new InternalCompassOrientationProvider(this), mMap); ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(this); mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10); mScaleBarOverlay.setCentred(true); // Sets cluster pin color mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(MapViewerOsmDroid.this); //BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange); BitmapDrawable mapPinDrawable = (BitmapDrawable) ResourcesCompat.getDrawable(getResources(),R.drawable.ic_map_pin_orange, null); mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap()); GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(MapViewerOsmDroid.this.getBaseContext()); gpsMyLocationProvider.setLocationUpdateMinDistance(100); // [m] // Set the minimum distance for location updates gpsMyLocationProvider.setLocationUpdateMinTime(10000); // [ms] // Set the minimum time interval for location updates mMyLocationOverlay = new MyLocationNewOverlay(MapViewerOsmDroid.this.getBaseContext(), gpsMyLocationProvider, mMap); mMyLocationOverlay.setDrawAccuracyEnabled(true); mMap.getOverlays().add(mCellTowerGridMarkerClusterer); mMap.getOverlays().add(mMyLocationOverlay); mMap.getOverlays().add(mCompassOverlay); mMap.getOverlays().add(mScaleBarOverlay); }
Example #22
Source File: GraphFragment.java From CryptoBuddy with GNU Affero General Public License v3.0 | 5 votes |
public void setColors(float percentChange) { if (percentChange >= 0) { chartFillColor = ResourcesCompat.getColor(getActivity().getResources(), R.color.materialLightGreen, null); chartBorderColor = ResourcesCompat.getColor(getActivity().getResources(), R.color.darkGreen, null); percentageColor = ResourcesCompat.getColor(getActivity().getResources(), R.color.percentPositiveGreen, null); } else { chartFillColor = ResourcesCompat.getColor(getActivity().getResources(), R.color.materialLightRed, null); chartBorderColor = ResourcesCompat.getColor(getActivity().getResources(), R.color.darkRed, null); percentageColor = ResourcesCompat.getColor(getActivity().getResources(), R.color.percentNegativeRed, null); } }
Example #23
Source File: MainActivity.java From MapsSDK-Native with MIT License | 5 votes |
private MapImage getPinImage() { Drawable drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_pin, null); int width = drawable.getIntrinsicWidth(); int height = drawable.getIntrinsicHeight(); Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); drawable.draw(canvas); return new MapImage(bitmap); }
Example #24
Source File: TaskDetailActivity.java From Kandroid with GNU General Public License v3.0 | 5 votes |
@Override public void onOpenTask(boolean success) { if (success) { textStatus.setText(Utils.fromHtml(getString(R.string.taskview_status, getString(R.string.taskview_status_open)))); fabMenuButtonOpenCloseTask.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.task_close, null)); fabMenuLabelOpenCloseTask.setText(getString(R.string.taskview_fab_close_task)); if (opencloseAction != null) { opencloseAction.setTitle(R.string.taskview_fab_close_task); } showProgress(); kanboardAPI.getTask(task.getId()); } else Snackbar.make(findViewById(R.id.root_layout), getString(R.string.error_msg_open_task), Snackbar.LENGTH_LONG).show(); }
Example #25
Source File: SocialMentionTextView.java From SocialMentionAutoComplete with Apache License 2.0 | 5 votes |
private void init() { int textColor = ResourcesCompat.getColor(getResources(), R.color.colorPrimary, null); setLinkTextColor(textColor); setLinksClickable(true); setMovementMethod(LinkMovementMethod.getInstance()); setFocusable(false); }
Example #26
Source File: SocialMentionAutoComplete.java From SocialMentionAutoComplete with Apache License 2.0 | 5 votes |
/** *This function will process the incoming text into mention format * You have to implement the processing logic * */ public void setMentioningText(String text) { map.clear(); Pattern p = Pattern.compile("\\[([^]]+)]\\(([^ )]+)\\)"); Matcher m = p.matcher(text); String finalDesc = text; while (m.find()) { MentionPerson mentionPerson = new MentionPerson(); String name = m.group(1); String id = m.group(2); //Processing Logic finalDesc = finalDesc.replace("@[" + name + "](" + id + ")", "@" + name); mentionPerson.name = name; mentionPerson.id = id; map.put("@" + name, mentionPerson); } int textColor = ResourcesCompat.getColor(getResources(), R.color.colorPrimary, null); Spannable spannable = new SpannableString(finalDesc); for (Map.Entry<String, MentionPerson> stringMentionPersonEntry : map.entrySet()) { int startIndex = finalDesc.indexOf(stringMentionPersonEntry.getKey()); int endIndex = startIndex + stringMentionPersonEntry.getKey().length(); spannable.setSpan(new ForegroundColorSpan(textColor), startIndex, endIndex , Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } setText(spannable); }
Example #27
Source File: CircleOverlayActivity.java From android-map-sdk with Apache License 2.0 | 5 votes |
@Override public void onMapReady(@NonNull NaverMap naverMap) { int color = ResourcesCompat.getColor(getResources(), R.color.primary, getTheme()); CircleOverlay circleOverlay = new CircleOverlay(); circleOverlay.setCenter(new LatLng(37.5666102, 126.9783881)); circleOverlay.setRadius(500); circleOverlay.setColor(ColorUtils.setAlphaComponent(color, 31)); circleOverlay.setOutlineColor(color); circleOverlay.setOutlineWidth(getResources().getDimensionPixelSize(R.dimen.overlay_line_width)); circleOverlay.setMap(naverMap); }
Example #28
Source File: ArrowheadPathOverlayActivity.java From android-map-sdk with Apache License 2.0 | 5 votes |
@Override public void onMapReady(@NonNull NaverMap naverMap) { ArrowheadPathOverlay arrowheadPathOverlay = new ArrowheadPathOverlay(); arrowheadPathOverlay.setCoords(COORDS); arrowheadPathOverlay.setWidth(getResources().getDimensionPixelSize(R.dimen.arrowhead_path_overlay_width)); arrowheadPathOverlay.setColor(Color.WHITE); arrowheadPathOverlay.setOutlineWidth( getResources().getDimensionPixelSize(R.dimen.arrowhead_path_overlay_outline_width)); arrowheadPathOverlay.setOutlineColor(ResourcesCompat.getColor(getResources(), R.color.primary, getTheme())); arrowheadPathOverlay.setMap(naverMap); }
Example #29
Source File: MainActivity.java From badgebutton with Apache License 2.0 | 5 votes |
Drawable wrap(int icon) { Drawable drawable = ResourcesCompat.getDrawable(getResources(),icon, getTheme()); if (mTint == null) { mTint = ResourcesCompat.getColorStateList(getResources(), R.color.tab, getTheme()); } if (drawable != null) { drawable = DrawableCompat.wrap(drawable.mutate()); DrawableCompat.setTintList(drawable, mTint); } return drawable; }
Example #30
Source File: MainActivity.java From homeassist with Apache License 2.0 | 5 votes |
@NonNull @Override public View getView(int position, View convertView, @NonNull ViewGroup parent) { if (convertView == null) { convertView = View.inflate(getContext(), android.R.layout.simple_list_item_1, null); } ((TextView) convertView.findViewById(android.R.id.text1)).setText(items.get(position).getLine(getContext())); ((TextView) convertView.findViewById(android.R.id.text1)).setTextColor(ResourcesCompat.getColor(getResources(), R.color.md_white_1000, null)); return convertView; }