-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1f7e6e
commit b47764d
Showing
6 changed files
with
118 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
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
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
69 changes: 69 additions & 0 deletions
69
app/src/main/java/net/devemperor/wristassist/util/InputIntentBuilder.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package net.devemperor.wristassist.util; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import net.devemperor.wristassist.activities.InputActivity; | ||
|
||
public class InputIntentBuilder { | ||
|
||
private final Context context; | ||
private String title; | ||
private String content; | ||
private String hint; | ||
private String title2; | ||
private String content2; | ||
private String hint2; | ||
private boolean handsFree; | ||
|
||
public InputIntentBuilder(Context context) { | ||
this.context = context; | ||
} | ||
|
||
public InputIntentBuilder setTitle(String title) { | ||
this.title = title; | ||
return this; | ||
} | ||
|
||
public InputIntentBuilder setContent(String content) { | ||
this.content = content; | ||
return this; | ||
} | ||
|
||
public InputIntentBuilder setHint(String hint) { | ||
this.hint = hint; | ||
return this; | ||
} | ||
|
||
public InputIntentBuilder setTitle2(String title2) { | ||
this.title2 = title2; | ||
return this; | ||
} | ||
|
||
public InputIntentBuilder setContent2(String content2) { | ||
this.content2 = content2; | ||
return this; | ||
} | ||
|
||
public InputIntentBuilder setHint2(String hint2) { | ||
this.hint2 = hint2; | ||
return this; | ||
} | ||
|
||
public InputIntentBuilder setHandsFree(boolean handsFree) { | ||
this.handsFree = handsFree; | ||
return this; | ||
} | ||
|
||
public Intent build() { | ||
Intent intent = new Intent(context, InputActivity.class); | ||
intent.putExtra("net.devemperor.wristassist.input.title", title); | ||
intent.putExtra("net.devemperor.wristassist.input.content", content); | ||
intent.putExtra("net.devemperor.wristassist.input.hint", hint); | ||
intent.putExtra("net.devemperor.wristassist.input.title2", title2); | ||
intent.putExtra("net.devemperor.wristassist.input.content2", content2); | ||
intent.putExtra("net.devemperor.wristassist.input.hint2", hint2); | ||
intent.putExtra("net.devemperor.wristassist.input.hands_free", handsFree); | ||
return intent; | ||
} | ||
} |