-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug with overlapping labs in courses
- Loading branch information
Jean Luis Urena
committed
Aug 28, 2018
1 parent
924e937
commit fb52d4a
Showing
10 changed files
with
72 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"ritscheduler-release.apk","fullName":"release","baseName":"release"},"path":"ritscheduler-release.apk","properties":{}}] |
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
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 |
---|---|---|
@@ -1,22 +1,29 @@ | ||
package me.jlurena.ritscheduler.utils; | ||
|
||
import android.app.AlertDialog; | ||
import android.content.ActivityNotFoundException; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.res.ColorStateList; | ||
import android.graphics.Color; | ||
import android.graphics.drawable.ColorDrawable; | ||
import android.graphics.drawable.Drawable; | ||
import android.graphics.drawable.RippleDrawable; | ||
import android.net.Uri; | ||
import android.os.Build; | ||
import android.support.annotation.ColorInt; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.support.annotation.StringRes; | ||
import android.text.TextUtils; | ||
import android.view.ViewGroup; | ||
import android.view.ViewGroupOverlay; | ||
|
||
import org.threeten.bp.LocalDateTime; | ||
import org.threeten.bp.format.DateTimeFormatter; | ||
|
||
import me.jlurena.ritscheduler.R; | ||
|
||
public class Utils { | ||
|
||
public static final LocalDateTime now = LocalDateTime.now(); | ||
|
@@ -51,12 +58,44 @@ public static void clearDim(@NonNull ViewGroup parent) { | |
overlay.clear(); | ||
} | ||
|
||
public static RippleDrawable getPressedColorRippleDrawable(@ColorInt int pressedColor) { | ||
return new RippleDrawable(new ColorStateList(new int[][]{new int[]{}}, new int[]{pressedColor}), new ColorDrawable(pressedColor), null); | ||
public static void genericAlertDialogError(Context context, Exception exc) { | ||
String body = "Phone: " + Build.MODEL + | ||
"\nBuild Version: " + Build.VERSION.SDK_INT; | ||
if (exc != null) { | ||
body += "\nError: " + exc.getMessage() + | ||
" \nError Log:\n\n\n\t\t" + TextUtils.join("\n\t\t", exc.getStackTrace()); | ||
} | ||
final Intent intent = new Intent(Intent.ACTION_SEND); | ||
intent.setData(Uri.parse("mailto:")); | ||
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"}); | ||
intent.putExtra(Intent.EXTRA_SUBJECT, "RIT Scheduler Error Report"); | ||
intent.putExtra(Intent.EXTRA_TEXT, body); | ||
|
||
new AlertDialog.Builder(context) | ||
.setTitle(R.string.error) | ||
.setMessage(R.string.generic_error) | ||
.setPositiveButton(R.string.close, (d, which) -> d.dismiss()) | ||
.setNeutralButton("Report", (d, which) -> { | ||
try { | ||
context.startActivity(intent); | ||
} catch (ActivityNotFoundException e) { | ||
try { | ||
intent.setAction(Intent.ACTION_SENDTO); | ||
context.startActivity(intent); | ||
} catch (ActivityNotFoundException ex) { | ||
context.startActivity(Intent.createChooser(intent, "Send Report Using:")); | ||
} | ||
} | ||
}) | ||
.show(); | ||
} | ||
|
||
public static RippleDrawable getPressedColorRippleDrawable(@ColorInt int pressedColor, Drawable drawable) { | ||
return new RippleDrawable(new ColorStateList(new int[][]{new int[]{}}, new int[]{pressedColor}), drawable, null); | ||
} | ||
|
||
public static RippleDrawable getPressedColorRippleDrawable(@ColorInt int pressedColor) { | ||
return new RippleDrawable(new ColorStateList(new int[][]{new int[]{}}, new int[]{pressedColor}), new ColorDrawable(pressedColor), null); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ | |
<!--Errors--> | ||
<string name="error">Error</string> | ||
<string name="no_results_error">No results found.</string> | ||
<string name="generic_error">Something weird happened. Try again later.</string> | ||
<string name="save_error">Unable to save this course. Please try again later.</string> | ||
<string name="error_retrieving_saved_courses">Error retrieving saved courses.</string> | ||
<string name="confirm">Confirm</string> | ||
<string name="delete_course_error">Unable to delete this course. Please try again later.</string> | ||
|
@@ -83,6 +81,7 @@ | |
<string name="open_sourced_at">Open Sourced At</string> | ||
<string name="report_bugs_features">Report bugs and new features:\n<a href="[email protected]">[email protected]</a></string> | ||
<string name="close">Close</string> | ||
<string name="generic_error">Something weird happened. Please try again later. If the issue persists, please submit a report</string> | ||
|
||
<!-- TODO: Remove or change this placeholder text --> | ||
|
||
|
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