守护弹窗
This commit is contained in:
@@ -45,7 +45,6 @@ public class SudTitleSelectAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
|
||||
public class GuardBuyTipsDialog {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param context
|
||||
* @param coin 钻石
|
||||
* @param content 购买类型名称
|
||||
* @param simpleCallback
|
||||
*/
|
||||
public static void showBuyOrRenewDialog(Context context, String coin, String content, DialogUitl.SimpleCallback simpleCallback) {
|
||||
if (context instanceof Activity) {
|
||||
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final Dialog dialog = new Dialog(context, R.style.dialog2);
|
||||
dialog.setContentView(R.layout.dialog_guard_buy_tips);
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
if (!TextUtils.isEmpty(coin)) {
|
||||
TextView contentTextView = dialog.findViewById(R.id.content);
|
||||
contentTextView.setText(context.getString(R.string.guard_buy_tips_1, coin));
|
||||
}
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
TextView buyTypeTextView = dialog.findViewById(R.id.buyType);
|
||||
buyTypeTextView.setText(content);
|
||||
}
|
||||
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
simpleCallback.onConfirmClick(dialog, "");
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
13
common/src/main/res/drawable/guard_buy_tips_bg.xml
Normal file
13
common/src/main/res/drawable/guard_buy_tips_bg.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:centerColor="#202020"
|
||||
android:endColor="#535353"
|
||||
android:startColor="#595959" />
|
||||
<corners
|
||||
android:bottomLeftRadius="18dp"
|
||||
android:bottomRightRadius="18dp"
|
||||
android:topLeftRadius="18dp"
|
||||
android:topRightRadius="18dp" />
|
||||
</shape>
|
||||
12
common/src/main/res/drawable/guard_buy_tips_sure_bg.xml
Normal file
12
common/src/main/res/drawable/guard_buy_tips_sure_bg.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="45"
|
||||
android:endColor="#EEC593"
|
||||
android:startColor="#FCDEC4" />
|
||||
<corners
|
||||
android:bottomLeftRadius="18dp"
|
||||
android:bottomRightRadius="18dp"
|
||||
android:topLeftRadius="18dp"
|
||||
android:topRightRadius="18dp" />
|
||||
</shape>
|
||||
74
common/src/main/res/layout/dialog_guard_buy_tips.xml
Normal file
74
common/src/main/res/layout/dialog_guard_buy_tips.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="220dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:background="@drawable/guard_buy_tips_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@mipmap/icon_guard_buy_tips_close" />
|
||||
|
||||
<com.flyjingfish.gradienttextviewlib.GradientTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/dialog_tip"
|
||||
android:textSize="22dp"
|
||||
app:gradient_angle="45"
|
||||
app:gradient_endColor="#F9E1AE"
|
||||
app:gradient_startColor="#C28413" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/title"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="30dp"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/guard_buy_tips_1"
|
||||
android:textColor="#FFE0BF"
|
||||
android:textSize="14dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/buyType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/guard_buy_type_1"
|
||||
android:textColor="#FFB974"
|
||||
android:textSize="15dp"
|
||||
android:textStyle="italic|bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/guard_buy_tips_sure_bg"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/confirm" />
|
||||
|
||||
</RelativeLayout>
|
||||
BIN
common/src/main/res/mipmap-mdpi/icon_guard_buy_tips_close.png
Normal file
BIN
common/src/main/res/mipmap-mdpi/icon_guard_buy_tips_close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1450,4 +1450,8 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="community_back">Are you sure to return?</string>
|
||||
|
||||
<string name="back_community_sure">Sure</string>
|
||||
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
</resources>
|
||||
|
||||
@@ -1449,4 +1449,8 @@
|
||||
<string name="community_back">是否確認返回?</string>
|
||||
|
||||
<string name="back_community_sure">確定</string>
|
||||
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
</resources>
|
||||
|
||||
@@ -1449,4 +1449,8 @@
|
||||
|
||||
<string name="back_community_sure">確定</string>
|
||||
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1446,4 +1446,8 @@
|
||||
|
||||
<string name="back_community_sure">確定</string>
|
||||
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1455,4 +1455,8 @@ Limited ride And limited avatar frame</string>
|
||||
|
||||
<string name="back_community_sure">Sure</string>
|
||||
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
|
||||
<string name="guard_buy_type_1">【星之守护】</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user