Skip to content

Commit

Permalink
set canselable
Browse files Browse the repository at this point in the history
  • Loading branch information
Far5had70 committed Nov 18, 2018
1 parent fb594f5 commit 684c838
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 77 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/shaygan/customalert/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void doubleAction() {
.setButtonRadius(80)
.setButtonTextSize(13)
.setHeaderIconEnable(true)
.setButtonEnable(true)
.setButtonEnable(false)
.setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf"))
.setDoubleButtonListener(new DoubleButtonListener() {
@Override
Expand Down Expand Up @@ -96,7 +96,7 @@ private void singleAction() {
.setButtonTextSize(13)
.setHeaderIconEnable(true)
.setButtonEnable(true)
.setCancelableTouchOutside(false)
.setCancelableTouchOutside(true)
.setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf"))
.setSingleButtonListener(new SingleButtonListener() {
@Override
Expand Down
4 changes: 3 additions & 1 deletion falert/src/main/java/com/waspar/falert/Falert.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Falert extends DialogFragment implements View.OnClickListener {

private Context context;
private int buttonType;
private View roottt , view , icon;
private View roottt , view , icon , buttonRoot;
private TextView positiveSingleButton, negativeButton, positiveButton;
private FrameLayout frameLayout;
private CircularImageView imageView;
Expand Down Expand Up @@ -82,6 +82,7 @@ private void init() {
frameLayout = view.findViewById(R.id.frameLayoutFalert);
imageView = view.findViewById(R.id.falert_icon);
icon = view.findViewById(R.id.frameLayout2);
buttonRoot = view.findViewById(R.id.button_root);


if (typeFace != null){
Expand Down Expand Up @@ -396,6 +397,7 @@ public Falert show() {
positiveButton.setVisibility(View.GONE);
negativeButton.setVisibility(View.GONE);
positiveSingleButton.setVisibility(View.GONE);
buttonRoot.setVisibility(View.GONE);
}

return this;
Expand Down
142 changes: 68 additions & 74 deletions falert/src/main/res/layout/layout_falert.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,80 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/frameLayoutFalert"
android:layout_marginBottom="40dp"
android:layout_marginTop="40dp">


</FrameLayout>

<View
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_below="@+id/frameLayoutFalert" />
android:layout_height="50dp"
android:id="@+id/button_root"
android:layout_below="@+id/frameLayoutFalert">


<TextView
android:id="@+id/falert_single_button"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="30dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="انصراف"
android:visibility="gone"
android:textColor="@color/falert_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<android.support.constraint.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />


<TextView
android:id="@+id/falert_negative_button"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:padding="5dp"
android:text="انصراف"
android:textColor="@color/falert_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />


<TextView
android:id="@+id/falert_positive_button"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:padding="5dp"
android:text="تائید"
android:textColor="@color/falert_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/falert_negative_button"
app:layout_constraintTop_toTopOf="parent" />


</android.support.constraint.ConstraintLayout>

</RelativeLayout>

Expand All @@ -54,74 +118,4 @@
</FrameLayout>


<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom">


<TextView
android:id="@+id/falert_single_button"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="30dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="انصراف"
android:visibility="gone"
android:textColor="@color/falert_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<android.support.constraint.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />


<TextView
android:id="@+id/falert_negative_button"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:padding="5dp"
android:text="انصراف"
android:textColor="@color/falert_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />


<TextView
android:id="@+id/falert_positive_button"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:padding="5dp"
android:text="تائید"
android:textColor="@color/falert_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/falert_negative_button"
app:layout_constraintTop_toTopOf="parent" />


</android.support.constraint.ConstraintLayout>


</FrameLayout>

0 comments on commit 684c838

Please sign in to comment.