Fix night map mode background in ImageCard

This commit is contained in:
Alexander Sytnyk 2018-01-18 16:51:31 +02:00
parent e9ba8e1347
commit ce46697398
2 changed files with 6 additions and 0 deletions

View file

@ -80,6 +80,7 @@
android:visibility="gone"/>
<View
android:id="@+id/card_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/context_menu_card"/>

View file

@ -14,6 +14,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import net.osmand.AndroidNetworkUtils;
import net.osmand.AndroidUtils;
import net.osmand.Location;
import net.osmand.data.LatLon;
import net.osmand.plus.OsmandApplication;
@ -322,6 +323,10 @@ public abstract class ImageCard extends AbstractCard {
ProgressBar progress = (ProgressBar) view.findViewById(R.id.progress);
AppCompatButton button = (AppCompatButton) view.findViewById(R.id.button);
boolean night = getMyApplication().getDaynightHelper().isNightModeForMapControls();
AndroidUtils.setBackground(getMapActivity(), view.findViewById(R.id.card_background), night,
R.drawable.context_menu_card_light, R.drawable.context_menu_card_dark);
if (icon == null && topIconId != 0) {
icon = getMyApplication().getIconsCache().getIcon(topIconId);
}