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 com.sun.jersey.core.util.Base64; | |
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.util.Arrays; | |
import java.util.Random; | |
import javax.crypto.BadPaddingException; |
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
/** | |
* Simple object that keep private and public key | |
*/ | |
public class PPKeys { | |
private String privateKey; | |
private String publicKey; | |
public String getPublicKey() { | |
return publicKey; |
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"> | |
<!-- solids that simulate shadow !--> | |
<item> | |
<shape> | |
<corners android:radius="@dimen/radius_corner"></corners> | |
<solid android:color="#10CCCCCC" /> | |
<padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" /> | |
</shape> | |
</item> |
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.content.Context; | |
import android.support.annotation.Nullable; | |
import android.support.v4.content.ContextCompat; | |
import android.util.AttributeSet; | |
import android.widget.LinearLayout; | |
import arman.so.shadowexample.R; | |
import arman.so.shadowexample.utils.ViewUtils; | |
/** |
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.graphics.Paint; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.LayerDrawable; | |
import android.graphics.drawable.ShapeDrawable; | |
import android.graphics.drawable.shapes.RoundRectShape; | |
import android.support.annotation.ColorRes; | |
import android.support.annotation.DimenRes; | |
import android.support.v4.content.ContextCompat; | |
import android.view.Gravity; |
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
fun View.setShadow( | |
@ColorRes shadowColor: Int, | |
@DimenRes cornerRadius: Int, | |
@DimenRes elevation: Int, | |
shadowGravity: Int = Gravity.BOTTOM, | |
@ColorRes backgroundColorResource: Int = 0 | |
) { | |
val resource = context.resources | |
val firstLayer = 0 | |
val ratioTopBottom = 3 |
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 MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
testView.setShadow(R.color.shadow, R.dimen.radius, R.dimen.evl) | |
} | |
} |
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 TestFrameLayout @JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | |
) : FrameLayout(context, attrs, defStyleAttr) { | |
private val paint: Paint = Paint() | |
init { | |
clipChildren = false | |
clipToPadding = false | |
paint.color = Color.WHITE |
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
exports.appReviews = functions.runWith({ timeoutSeconds: 5 * 60 }) | |
.pubsub | |
.schedule('every 15 minutes').onRun(async context => { | |
// magic gonna happen here! | |
}) |
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
const storePublishedReviewsList = async (reviews: PublishedReviews) => { | |
// callback to store data file | |
} | |
const retrivePublishedReviewsList = async (): Promise<PublishedReviews> => { | |
// callback to retrive data from data source | |
} | |
const onNewMessageAvailable = async (messages: string[]) => { | |
// callback of having new messages |
OlderNewer