forked from organicmaps/organicmaps
[android] Added prototype of 'price selection' state in dialog
This commit is contained in:
parent
68c99a5819
commit
cb15e71b9d
9 changed files with 52 additions and 4 deletions
BIN
android/res/drawable-hdpi/img_mappy_heart.png
Normal file
BIN
android/res/drawable-hdpi/img_mappy_heart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
android/res/drawable-mdpi/img_mappy_heart.png
Normal file
BIN
android/res/drawable-mdpi/img_mappy_heart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
android/res/drawable-xhdpi/img_mappy_heart.png
Normal file
BIN
android/res/drawable-xhdpi/img_mappy_heart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
android/res/drawable-xxhdpi/img_mappy_heart.png
Normal file
BIN
android/res/drawable-xxhdpi/img_mappy_heart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
BIN
android/res/drawable-xxxhdpi/img_mappy_heart.png
Normal file
BIN
android/res/drawable-xxxhdpi/img_mappy_heart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
|
@ -9,7 +9,19 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/ads_removal_dialog_min_height"
|
||||
android:padding="@dimen/margin_base_plus"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textAppearance="@style/MwmTextAppearance.Title"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/progress_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -6,10 +6,33 @@
|
|||
android:layout_width="match_parent"
|
||||
android:fillViewport="true">
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="@dimen/ads_removal_dialog_min_height"
|
||||
android:padding="@dimen/margin_base_plus"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textAppearance="@style/MwmTextAppearance.Title"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"/>
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:src="@drawable/img_mappy_heart"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/progress_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.support.annotation.Nullable;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.billingclient.api.SkuDetails;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -110,6 +111,7 @@ public class AdsRemovalPurchaseDialog extends BaseMwmDialogFragment
|
|||
@Override
|
||||
void activate(@NonNull View view)
|
||||
{
|
||||
UiUtils.hide(view, R.id.title, R.id.image);
|
||||
UiUtils.show(view, R.id.progress_layout);
|
||||
}
|
||||
},
|
||||
|
@ -119,6 +121,9 @@ public class AdsRemovalPurchaseDialog extends BaseMwmDialogFragment
|
|||
void activate(@NonNull View view)
|
||||
{
|
||||
UiUtils.hide(view, R.id.progress_layout);
|
||||
UiUtils.show(view, R.id.title, R.id.image);
|
||||
TextView title = view.findViewById(R.id.title);
|
||||
title.setText(R.string.remove_ads_title);
|
||||
}
|
||||
},
|
||||
EXPLANATION
|
||||
|
|
|
@ -134,7 +134,11 @@ public final class UiUtils
|
|||
|
||||
public static void hide(View frame, @IdRes int viewId)
|
||||
{
|
||||
hide(frame.findViewById(viewId));
|
||||
View view = frame.findViewById(viewId);
|
||||
if (view == null)
|
||||
return;
|
||||
|
||||
hide(view);
|
||||
}
|
||||
|
||||
public static void hide(View frame, @IdRes int... viewIds)
|
||||
|
@ -156,7 +160,11 @@ public final class UiUtils
|
|||
|
||||
public static void show(View frame, @IdRes int viewId)
|
||||
{
|
||||
show(frame.findViewById(viewId));
|
||||
View view = frame.findViewById(viewId);
|
||||
if (view == null)
|
||||
return;
|
||||
|
||||
show(view);
|
||||
}
|
||||
|
||||
public static void show(View frame, @IdRes int... viewIds)
|
||||
|
|
Loading…
Add table
Reference in a new issue