forked from organicmaps/organicmaps
[android] the form of partner`s button for download on map banner is fixed
This commit is contained in:
parent
6b3ddfbd4e
commit
e48ec1bb0a
9 changed files with 9 additions and 45 deletions
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorBtnHighlight">
|
||||
<item android:id="@android:id/mask" android:drawable="@drawable/ripple_mask_big_corner_radius"/>
|
||||
<item android:drawable="@drawable/button_megafon_internal"/>
|
||||
</ripple>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<corners android:radius="@dimen/megafon_button_corner_radius"/>
|
||||
</shape>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/button_megafon_internal"/>
|
||||
</layer-list>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/button_megafon_pressed"
|
||||
android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/button_megafon_normal"/>
|
||||
</selector>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/megafon_button"/>
|
||||
<corners android:radius="@dimen/megafon_button_corner_radius"/>
|
||||
</shape>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/megafon_button_pressed"/>
|
||||
<corners android:radius="@dimen/megafon_button_corner_radius"/>
|
||||
</shape>
|
|
@ -88,7 +88,6 @@
|
|||
android:id="@+id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_brand_megafon_green"
|
||||
android:layout_marginRight="@dimen/margin_half"
|
||||
android:layout_marginEnd="@dimen/margin_half"/>
|
||||
<TextView
|
||||
|
@ -96,8 +95,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body4"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:text="@string/banner_megafon_banner_message"/>
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/banner_button"
|
||||
|
|
|
@ -203,8 +203,8 @@
|
|||
<dimen name="placepage_banner_small_action_corner">20dp</dimen>
|
||||
<dimen name="placepage_banner_remove_button_size">14dp</dimen>
|
||||
<dimen name="placepage_banner_open_touch_slop">50dp</dimen>
|
||||
<dimen name="megafon_button_min_height">28dp</dimen>
|
||||
<dimen name="megafon_button_corner_radius">@dimen/megafon_button_min_height</dimen>
|
||||
<dimen name="downloader_partner_button_min_height">28dp</dimen>
|
||||
<dimen name="downloader_partner_button_corner_radius">@dimen/downloader_partner_button_min_height</dimen>
|
||||
|
||||
<!-- Place page taxi-->
|
||||
<dimen name="placepage_taxi_button_min_width">96dp</dimen>
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
package com.mapswithme.maps.downloader;
|
||||
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import com.mapswithme.maps.R;
|
||||
|
||||
class DownloaderBannerConfigStrategyPartner implements DownloaderBannerConfigStrategy
|
||||
{
|
||||
|
@ -46,6 +47,9 @@ class DownloaderBannerConfigStrategyPartner implements DownloaderBannerConfigStr
|
|||
TextView button = parent.findViewById(buttonViewId);
|
||||
button.setText(mButtonText);
|
||||
button.setTextColor(button.getResources().getColor(mButtonTextColor));
|
||||
button.setBackgroundColor(button.getResources().getColor(mButtonColor));
|
||||
GradientDrawable background = new GradientDrawable();
|
||||
background.setColor(button.getResources().getColor(mButtonColor));
|
||||
background.setCornerRadius(R.dimen.downloader_partner_button_min_height);
|
||||
button.setBackground(background);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue