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
class GridSpacingItemDecoration( | |
private val spanCount: Int, | |
private val spacing: Int, | |
private val includeEdges: Boolean | |
) : RecyclerView.ItemDecoration() { | |
override fun getItemOffsets( | |
outRect: Rect, | |
view: View, | |
parent: RecyclerView, |
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
package com.jutt.medsreminders.helper | |
import android.content.Context | |
import com.google.gson.Gson | |
import com.jutt.medsreminders.data.bo.PushNotificationData | |
import com.jutt.medsreminders.data.enums.PushNotificationAction | |
import com.jutt.medsreminders.data.models.Alert | |
import com.jutt.medsreminders.injection.Injector | |
import com.jutt.medsreminders.utils.NotificationChannelCreator | |
import com.jutt.medsreminders.utils.NotificationHandler |
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
sealed class Failure { | |
/*Network Error*/ | |
class NetworkConnection(var additionalData: Any? = null) : Failure() | |
/*Exception*/ | |
class Exception(var additionalData: Any? = null) : Failure() | |
/** | |
* Although the HTTP standard specifies "unauthorized", | |
* semantically this response means "unauthenticated". |
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
import android.annotation.SuppressLint | |
import android.app.Activity | |
import android.content.Intent | |
import android.graphics.Color | |
import android.net.Uri | |
import android.os.Build | |
import android.view.Menu | |
import android.view.View | |
import android.view.WindowManager | |
import androidx.annotation.* |
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
class MockCallInterceptor<T> constructor(val value: T) : Interceptor { | |
override fun intercept(chain: Interceptor.Chain): Response { | |
val uri = chain.request().url().uri().toString() | |
val responseString: String = Gson().toJson(T::class.java) | |
val response = Response.Builder() | |
.code(200) | |
.message(responseString) | |
.request(chain.request()) | |
.protocol(Protocol.HTTP_1_0) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<!-- Drop Shadow Stack --> | |
<item> | |
<shape> | |
<padding | |
android:bottom="1dp" | |
android:left="1dp" | |
android:right="1dp" |
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
/** | |
* Get Shadow Drawable with most elevation on provided shadowGravity Attribute | |
*/ | |
fun getBoxShadowBackground( | |
view: View, | |
@ColorRes backgroundColor: Int = android.R.color.white, | |
radiusInDP: Float = view.convertDpTpPx(5F), | |
@ColorRes shadowColor: Int = android.R.color.black, | |
elevation: Int = 0, | |
shadowGravity: Int = Gravity.BOTTOM |
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
import android.app.Service | |
import android.content.Intent | |
import android.media.AudioManager | |
import android.media.MediaPlayer | |
import android.media.MediaPlayer.OnPreparedListener | |
import android.os.IBinder | |
import androidx.annotation.Nullable | |
import java.io.IOException | |
/** |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.v7.widget.AppCompatImageView |
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
import android.text.SpannableStringBuilder; | |
import java.util.ArrayDeque; | |
import java.util.Deque; | |
import static android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE; | |
/** A {@link SpannableStringBuilder} wrapper whose API doesn't make me want to stab my eyes out. */ | |
public class Truss { | |
private final SpannableStringBuilder builder; | |
private final Deque<Span> stack; |
NewerOlder