Created
May 31, 2019 06:13
-
-
Save gamenic-babin/22183d29a441604a325e2b3458abc82a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showDialog(String msg) { | |
dialog = new Dialog(this, R.style.Theme_AppCompat_Light_Dialog_Alert); | |
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); | |
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); | |
dialog.setCancelable(false); | |
dialog.setContentView(R.layout.buy_point); | |
TextView tv_buy, tv_cancel, tv_title; | |
tv_title = dialog.findViewById(R.id.textview_dialog_body); | |
tv_buy = dialog.findViewById(R.id.buy_action); | |
tv_cancel = dialog.findViewById(R.id.cancel_action); | |
tv_title.setText(msg); | |
tv_buy.setOnClickListener((View v) -> contentPresenter.UnlockContent(content_point,content_id)); | |
tv_cancel.setOnClickListener(v -> dialog.dismiss()); | |
dialog.show(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:card="http://schemas.android.com/apk/res-auto" | |
android:orientation="vertical" | |
android:id="@+id/cardlist_item" | |
android:layout_width="match_parent" | |
android:layout_height="130dp" | |
card:cardCornerRadius="40dp" | |
android:layout_marginLeft="8dp" | |
android:layout_marginRight="8dp" | |
android:layout_marginTop="5dp" | |
android:layout_marginBottom="5dp" | |
android:padding="10dp" | |
android:background="@color/white"> | |
<LinearLayout | |
android:orientation="vertical" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView | |
style="@style/customtextview" | |
android:id="@+id/textview_dialog_body" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:layout_marginTop="10sp" | |
android:gravity="center_horizontal" | |
android:text="You have successfully registered\nyour account" /> | |
<View | |
android:layout_width="fill_parent" | |
android:layout_height="1sp" | |
android:layout_marginTop="10sp" | |
android:background="#AAAAAA" /> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="50dp" | |
android:orientation="horizontal" | |
android:weightSum="9"> | |
<TextView | |
android:layout_weight="4" | |
android:id="@+id/buy_action" | |
android:layout_width="113dp" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:layout_marginTop="0dp" | |
android:gravity="center_horizontal" | |
android:fontFamily="sans-serif" | |
android:text="Yes" | |
android:textColor="#22AAB6" | |
android:textSize="24sp" /> | |
<LinearLayout | |
android:layout_weight="1" | |
android:layout_width="1dp" | |
android:layout_height="match_parent"> | |
<View | |
android:layout_marginBottom="5dp" | |
android:layout_marginTop="5dp" | |
android:layout_gravity="center" | |
android:layout_width="1dp" | |
android:layout_height="match_parent" | |
android:background="#AAAAAA"/> | |
</LinearLayout> | |
<TextView | |
android:layout_weight="4" | |
android:id="@+id/cancel_action" | |
android:layout_width="113dp" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:layout_marginTop="0dp" | |
android:gravity="center" | |
android:fontFamily="sans-serif" | |
android:text="No" | |
android:textColor="#22AAB6" | |
android:textSize="24sp" /> | |
</LinearLayout> | |
</LinearLayout> | |
</android.support.v7.widget.CardView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment