Skip to content

Commit

Permalink
everything except the loose files
Browse files Browse the repository at this point in the history
  • Loading branch information
rchhaya committed Oct 8, 2023
1 parent 795ef8f commit 9c0043f
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,4 @@ class Gym {
}
return false
}

/*fun currentInterval(): Interval {
val current = DateTime()
for (i in intervalList!!) {
if (i.contains(current)) {
return i
}
}
// if this isn't open right now, throw exception
throw IllegalStateException()
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.google.gson.annotations.Expose
import com.google.gson.annotations.SerializedName

/**
* Created by Jackie on 2018-03-28. Updated by Marta on 2019-10-20.
* Created by Jackie on 2018-03-28.
*/

open class HomeCell {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import com.google.gson.annotations.Expose
import com.google.gson.annotations.SerializedName

/**
* Created by Jackie on 2018-03-28. Updated by Marta on 2019-10-20.
* Created by Jackie on 2018-03-28.
*/

class HomeCellInfo {


// Article
@SerializedName("article")
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ class HomeCourse {
@Expose
var end_time: String? = null

// Example:
// "building": "TOWNE",
// "code": "240",
// "dept": "CIS",
// "end_date": "2019-12-09",
// "end_time": "6:00 PM",
// "instructors": [
// "Camillo Jose Taylor"
// ],
// "meeting_times": null,
// "name": "Intro To Comp Systems",
// "room": "100",
// "section": "001",
// "start_date": "2019-08-27",
// "start_time": "4:30 PM",
// "term": "2019C",
// "weekdays": "MW"
/* Example:
"building": "TOWNE",
"code": "240",
"dept": "CIS",
"end_date": "2019-12-09",
"end_time": "6:00 PM",
"instructors": [
"Camillo Jose Taylor"
],
"meeting_times": null,
"name": "Intro To Comp Systems",
"room": "100",
"section": "001",
"start_date": "2019-08-27",
"start_time": "4:30 PM",
"term": "2019C",
"weekdays": "MW"
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package com.pennapps.labs.pennmobile.classes

import com.google.gson.annotations.SerializedName

/**
* Created by Ali Krema, Fall 2022.
*/

data class PCARegistrationBody(
@SerializedName("section") val section: String?,
@SerializedName("auto_resubscribe") val autoResubscribe: Boolean? = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package com.pennapps.labs.pennmobile.classes

import com.google.gson.annotations.SerializedName

/**
* Created by Ali Krema, Fall 2022.
*/

data class PennCourseAlertRegistration(
@SerializedName("cancelled_at")
val cancelledAt: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package com.pennapps.labs.pennmobile.classes

import com.google.gson.annotations.SerializedName

/**
* Created by Ali Krema, Fall 2022.
*/

data class PennCourseAlertUpdateBody(
@SerializedName("cancelled") val cancelled: Boolean? = false,
@SerializedName("deleted") val deleted: Boolean? = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void onClick(View v) {
}

float radius = 5;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && builder.getDecorView() != null)
if (builder.getDecorView() != null)
{
CustomBlurDialogue blurDialogue = view.findViewById(stream.customalert.R.id.blurview);
blurDialogue.create(builder.getDecorView(), radius);
Expand All @@ -318,7 +318,7 @@ private void initActionsheetView(View view) {
cancelButton.setTextColor(ContextCompat.getColor(view.getContext(), builder.getCancelColor()));
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && builder.getDecorView() != null)
if (builder.getDecorView() != null)
{
CustomBlurDialogue blurDialogue = view.findViewById(stream.customalert.R.id.blurview_button);
blurDialogue.create(builder.getDecorView(), radius);
Expand All @@ -337,7 +337,7 @@ private void initActionsheetView(View view) {

initListView(view);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && builder.getDecorView() != null)
if (builder.getDecorView() != null)
{
CustomBlurDialogue blurDialogue = view.findViewById(stream.customalert.R.id.blurview);
blurDialogue.create(builder.getDecorView(), radius);
Expand All @@ -351,7 +351,7 @@ private void initSelectorView(View view) {
initListView(view);

float radius = 5;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && builder.getDecorView() != null)
if (builder.getDecorView() != null)
{
CustomBlurDialogue blurDialogue = view.findViewById(stream.customalert.R.id.blurview);
blurDialogue.create(builder.getDecorView(), radius);
Expand Down Expand Up @@ -511,7 +511,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
}

float radius = 5;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && builder.getDecorView() != null)
if (builder.getDecorView() != null)
{
CustomBlurDialogue blurDialogue = view.findViewById(R.id.blurrview);
blurDialogue.create(builder.getDecorView(), radius);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,21 @@ public void create(View decorView, float radius) {
ViewGroup rootView = decorView.findViewById(android.R.id.content);
Drawable windowBackground = decorView.getBackground();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
setupWith(rootView)
.setFrameClearDrawable(windowBackground)
.setBlurAlgorithm(new RenderScriptBlur(getContext()))
.setBlurRadius(radius)
.setHasFixedTransformationMatrix(true);
}
setupWith(rootView)
.setFrameClearDrawable(windowBackground)
.setBlurAlgorithm(new RenderScriptBlur(getContext()))
.setBlurRadius(radius)
.setHasFixedTransformationMatrix(true);
}

/**
* Set Rounded Corners on Lollipop and above. Use rounded drawable and disable blur below Lollipop.
* Set Rounded Corners
* @param cornerRadius - set corner radius in pixels.
*/
private void setRoundedCorners(int cornerRadius) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setBackground(new RoundedCornersDrawable(cornerRadius));
setOutlineProvider(ViewOutlineProvider.BACKGROUND);
setClipToOutline(true);
}
setBackground(new RoundedCornersDrawable(cornerRadius));
setOutlineProvider(ViewOutlineProvider.BACKGROUND);
setClipToOutline(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,16 @@ private static class TabInformation {
String title;
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public ExpandableBottomTabBar(Context context) {
super(context);
init(context, null, 0);
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public ExpandableBottomTabBar(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs, 0);
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public ExpandableBottomTabBar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs, defStyleAttr);
Expand All @@ -96,7 +93,6 @@ public void setOnTabClickedListener(OnTabClickedListener listener) {
mOnTabClickedListener = listener;
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
private void init(Context context, AttributeSet attrs, int defStyleAttr) {
mContext = context;
populateAttributes(context, attrs);
Expand All @@ -120,31 +116,23 @@ private void populateAttributes(Context context, AttributeSet attrs) {
mMoreTabPosition = mMaxTabPerRow - 1;
String bgColor = attrs.getAttributeValue(ANDROID_NS, "background");
if (bgColor.contains("@")) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mBgColor = getResources().getColor(Integer.valueOf(bgColor.replace("@", "")), null);
} else {
mBgColor = getResources().getColor(Integer.valueOf(bgColor.replace("@", "")));
}
mBgColor = getResources().getColor(Integer.valueOf(bgColor.replace("@", "")), null);
} else if (bgColor.contains("#")) {
mBgColor = Color.parseColor(bgColor);
}
String textColor = attrs.getAttributeValue(ANDROID_NS, "textColor");
if (textColor.contains("@")) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mTabTextColor = getResources().getColor(Integer.valueOf(textColor.replace("@", "")), null);
} else {
mTabTextColor = getResources().getColor(Integer.valueOf(textColor.replace("@", "")));
}
mTabTextColor = getResources().getColor(Integer.valueOf(textColor.replace("@", "")), null);
} else if (textColor.contains("#")) {
mTabTextColor = Color.parseColor(textColor);
}
String textSize = attrs.getAttributeValue(ANDROID_NS, "textSize");
if (textSize.contains("sp")) {
mTextSize = Float.valueOf(textSize.replace("sp", ""));
mTextSize = Float.parseFloat(textSize.replace("sp", ""));
} else if (textSize.contains("dp")) {
mTextSize = Float.valueOf(textSize.replace("dp", ""));
mTextSize = Float.parseFloat(textSize.replace("dp", ""));
} else {
mTextSize = Float.valueOf(textSize);
mTextSize = Float.parseFloat(textSize);
}
XmlResourceParser parser = context.getResources().getXml(mTabXmlResource);
parse(parser);
Expand Down Expand Up @@ -234,7 +222,6 @@ public void setTabCount(int count) {
* Set the selected tab
* @param index
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public void setSelectedTab(int index) {
this.mSelectedTab = index;
setFocusOnTab(mSelectedTab);
Expand All @@ -251,12 +238,10 @@ public int getSelectedTab() {
return mSelectedTab;
}

@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
public ExpandableBottomTabBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
private void initializeViews() {
int width = LayoutParams.MATCH_PARENT;
int height = LayoutParams.WRAP_CONTENT;
Expand All @@ -270,7 +255,6 @@ private void initializeViews() {
initializeTabContainers();
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
private void initializeTabContainers() {
int layoutCount = 1;
if (mTabCount > mMaxTabPerRow) {
Expand Down Expand Up @@ -327,7 +311,6 @@ private void initializeTabContainers() {
}
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public void setFocusOnTab(int index) {
if (index == mSelectedTab) {
((TextView) mTabViewList.get(index)).setTextColor(mSelectedTabTextColor);
Expand All @@ -343,7 +326,6 @@ public void setFocusOnTab(int index) {
}
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public void resetFocusOnAllTabs() {
for (View textView : mTabViewList) {
((TextView) textView).setTextColor(mTabTextColor);
Expand All @@ -359,7 +341,6 @@ private int getLayoutIndex(int i) {
return i / mMaxTabPerRow;
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public void onClick(View view) {
int pos = -1;
Expand Down Expand Up @@ -481,7 +462,6 @@ public Parcelable onSaveInstanceState() {
return bundle;
}

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ class ExpandableBottomBar @JvmOverloads constructor(
return
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
applyTransition()
}
applyTransition()

val set = ConstraintSet()
set.clone(this)
Expand All @@ -283,7 +281,6 @@ class ExpandableBottomBar @JvmOverloads constructor(
set.applyTo(this)
}

@RequiresApi(Build.VERSION_CODES.KITKAT)
private fun applyTransition() {
val autoTransition = AutoTransition()
autoTransition.duration = transitionDuration.toLong()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ internal open class ExpandableItemViewController(
menuItemVerticalMarginBottom: Int
) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
textView.setTextAppearance(R.style.fontBottomBar)
}
textView.setTextAppearance(R.style.fontBottomBar)
val activity = parent.context as Activity
val displayMetrics = DisplayMetrics()
activity.windowManager.defaultDisplay.getMetrics(displayMetrics)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,18 @@ class PreferenceFragment : PreferenceFragmentCompat() {
val initials = firstName.first().toString() + lastName.first()
editor.putString(getString(R.string.initials), initials.capitalize())
editor.apply()
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
(activity?.window?.decorView as ViewGroup).showSneakerToast(
"Profile details updated successfully.", null,
R.color.sneakerBlurColorOverlay)
}
(activity?.window?.decorView as ViewGroup).showSneakerToast(
"Profile details updated successfully.", null,
R.color.sneakerBlurColorOverlay)
val userLoginPref: Preference? = findPreference("pref_account_login_logout")
userLoginPref?.summary = "You are currently signed in as ${
sharedPreference.getString(getString(R.string.first_name), null)
}"
activity?.findViewById<TextView>(R.id.initials)?.text = initials
} else {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
(activity?.window?.decorView as ViewGroup).showSneakerToast(
"Complete required fields to update your profile information.", { showEditProfileDialog() },
R.color.sneakerWarningOverlay)
}
(activity?.window?.decorView as ViewGroup).showSneakerToast(
"Complete required fields to update your profile information.", { showEditProfileDialog() },
R.color.sneakerWarningOverlay)
}
dialog.dismiss()
}
Expand Down

0 comments on commit 9c0043f

Please sign in to comment.