Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
Removed some builder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderEggers committed Feb 4, 2018
1 parent 48e3fd5 commit bbcb5cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
18 changes: 5 additions & 13 deletions examples/src/main/java/org/hitogo/examples/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
import android.util.Log;

import org.hitogo.alert.core.Alert;
import org.hitogo.alert.core.AlertType;
import org.hitogo.alert.core.VisibilityListener;
import org.hitogo.alert.view.ViewAlert;
import org.hitogo.button.action.ActionButton;
import org.hitogo.button.core.ButtonListener;
import org.hitogo.core.Hitogo;
import org.hitogo.core.HitogoActivity;
import org.hitogo.core.HitogoController;
import org.hitogo.alert.view.anim.LeftAnimation;
import org.hitogo.alert.view.anim.TopAnimation;

public class MainActivity extends HitogoActivity {

Expand Down Expand Up @@ -47,7 +44,6 @@ public void onClick(Alert alert, String parameter) {
.addText("Test")
.setTitle("Test Prio 1")
.asLayoutChild(R.id.container_layout)
.dismissByLayoutClick()
.setState(AlertState.HINT)
.setPriority(1)
.show();
Expand All @@ -59,7 +55,6 @@ public void onClick(Alert alert, String parameter) {
.addText("Test")
.setTitle("Test Prio 2")
.asLayoutChild(R.id.container_layout)
.dismissByLayoutClick()
.setState(AlertState.HINT)
.setPriority(2)
.addVisibilityListener(new VisibilityListener<ViewAlert>() {
Expand Down Expand Up @@ -92,7 +87,6 @@ public void onClick(Alert alert, String parameter) {
.addText("Test")
.setTitle("Test Prio 3")
.asLayoutChild(R.id.container_layout)
.dismissByLayoutClick()
.setState(AlertState.HINT)
.setPriority(1)
.showLater(true);
Expand All @@ -104,7 +98,6 @@ public void onClick(Alert alert, String parameter) {
.addText("Test")
.setTitle("Test Prio 4")
.asLayoutChild(R.id.container_layout)
.dismissByLayoutClick()
.setState(AlertState.HINT)
.setPriority(2)
.showLater(true);
Expand All @@ -116,7 +109,6 @@ public void onClick(Alert alert, String parameter) {
.addText("Test")
.setTitle("Test Prio 5")
.asLayoutChild(R.id.container_layout)
.dismissByLayoutClick()
.setState(AlertState.HINT)
.setPriority(2)
.showLater(true);
Expand Down Expand Up @@ -155,7 +147,7 @@ public void onClick(Alert alert, Object parameter) {
.setTitle("Test Title")
.asLayoutChild(R.id.fake_id)
.addButton(button)
.dismissByLayoutClick()
.dismissByLayoutClick(true)
.addVisibilityListener(new VisibilityListener<ViewAlert>() {

@Override
Expand Down Expand Up @@ -231,7 +223,7 @@ public void onClick(Alert alert, Object parameter) {

Hitogo.with(this)
.asViewAlert()
.withAnimations(LeftAnimation.build(), R.id.content)
.withAnimations(R.id.content)
.addText("Test 2")
.closeOthers(false)
.asLayoutChild(R.id.container_layout)
Expand Down Expand Up @@ -268,11 +260,11 @@ public void onClick(Alert alert, Object parameter) {

Hitogo.with(this)
.asViewAlert()
.withAnimations(LeftAnimation.build(), R.id.content)
.withAnimations(R.id.content)
.addText("Test for 'Show Later'")
.asLayoutChild(R.id.container_layout)
.addButton(next)
.closeOthers()
.closeOthers(true)
.addButton(save)
.setState(AlertState.HINT)
.setTag("TestHint 2")
Expand All @@ -294,7 +286,7 @@ public void onClick(Alert alert, Object parameter) {

Hitogo.with(this)
.asViewAlert()
.withAnimations(TopAnimation.build(), R.id.content)
.withAnimations(R.id.content)
.addText("Test 3")
.asLayoutChild(R.id.container_layout)
.addButton(button)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:layout_width="match_parent"
android:layout_height="300dp"
android:gravity="center"
android:background="@android:color/holo_red_dark"
android:background="@android:color/holo_blue_light"
android:orientation="vertical">

<Button
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/Mordag/hitogo'
gitUrl = 'https://github.com/Mordag/hitogo.git'

libraryVersion = '1.0.0-beta15.1'
libraryVersion = '1.0.0-beta16'

developerId = 'mordag'
developerName = 'Alexander Eggers'
Expand All @@ -33,7 +33,7 @@ android {

defaultConfig {
minSdkVersion 14
versionName "1.0.0-beta15.1"
versionName "1.0.0-beta16"
consumerProguardFiles 'proguard-rules.pro'
}

Expand Down
10 changes: 0 additions & 10 deletions library/src/main/java/org/hitogo/alert/view/ViewAlertBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,12 @@ public ViewAlertBuilder asLayoutChild(Integer containerId) {
return this;
}

@NonNull
public ViewAlertBuilder closeOthers() {
return closeOthers(true);
}

@NonNull
public ViewAlertBuilder closeOthers(boolean closeOthers) {
this.closeOthers = closeOthers;
return this;
}

@NonNull
public ViewAlertBuilder dismissByLayoutClick() {
return dismissByLayoutClick(true);
}

@NonNull
public ViewAlertBuilder dismissByLayoutClick(boolean dismissByClick) {
this.dismissByClick = dismissByClick;
Expand Down

0 comments on commit bbcb5cb

Please sign in to comment.