Skip to content

Instantly share code, notes, and snippets.

View chichi289's full-sized avatar
🎯
Focusing

Chirag Prajapati chichi289

🎯
Focusing
View GitHub Profile
@fvilarino
fvilarino / ticker_final.kt
Last active February 9, 2024 16:04
Ticker Final
private val TickerCycleMillis = 150
private object AlphabetMapper {
private val Alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789•".toList()
val size: Int = Alphabet.size
fun getLetterAt(index: Int): Char = Alphabet[index % size]
fun getIndexOf(letter: Char, offset: Int = 0): TickerIndex {
@qamarelsafadi
qamarelsafadi / BaseBottomSheet.kt
Last active August 2, 2023 04:56
This class is a generic class for BottomSheetDialogFragment using Kotlin, it will helps you to use one class for all ur bottom sheets on your app.
/*
* Copyright (c) 2022. Qamar A. Safadi
*/
package com.qamar.test.base
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
*****Notes on Testing*****
Why we need it:-
It takes a lot of time and effort to test every functionality in our software manually. And every time we are about to scale our
project we'd have to run our software and test each and every functionality manually to check whether it is still working correctly or not.
To overcome this effort we write Test Cases for our app so that with single click we can check anytime that whether a given piece of code is working correctly or not.
We get JUnit out of the box in our android project to test our code with a single click whenever we want to.
There are basically three types of test cases:-
-> Unit Tests:-
@techyourchance
techyourchance / MyPermission.java
Last active January 11, 2022 08:01
Abstraction for clean management of runtime permissions in Android applications
public enum MyPermission {
// declare runtime permissions specific to your app here (don't keep unused ones)
READ_PHONE_STATE(Manifest.permission.READ_PHONE_STATE),
FINE_LOCATION(Manifest.permission.ACCESS_FINE_LOCATION);
public static MyPermission fromAndroidPermission(String androidPermission) {
for (MyPermission permission : MyPermission.values()) {
if (permission.getAndroidPermission().equals(androidPermission)) {
return permission;
}
@sinadarvi
sinadarvi / ErrorResponse.kt
Created August 15, 2020 18:24
Call Adapter + Suspend function
data class ErrorResponse(
val status: String,
val code: String,
val message: String
)
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories