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.wsayan.compose_playground | |
import android.graphics.RectF | |
import android.os.Bundle | |
import android.view.MotionEvent | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.material3.MaterialTheme |
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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="com.example.example"> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> | |
<application |
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"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<stroke | |
android:width="1dp" | |
android:color="@color/black" /> | |
<corners android:radius="2dp" /> | |
</shape> |
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.wsyan.worker | |
import android.content.Context | |
import android.os.Handler | |
import android.os.Looper | |
import android.util.Log | |
import android.widget.Toast | |
import androidx.work.CoroutineWorker | |
import androidx.work.Worker | |
import androidx.work.WorkerParameters |
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
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
apply plugin: 'kotlin-kapt' | |
android { | |
compileSdkVersion 28 | |
defaultConfig { | |
applicationId "com.example.example" |
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.TargetApi | |
import android.content.Context | |
import android.graphics.* | |
import android.os.Build | |
import android.util.AttributeSet | |
import android.view.View | |
import android.view.ViewOutlineProvider | |
import androidx.appcompat.widget.AppCompatImageView | |
import androidx.core.view.ViewCompat | |
import com.wsayan.example.R |
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
public class TaxCalculationCore { | |
public static final String GENDER_MALE = "_male"; | |
public static final String GENDER_FEMALE = "_female"; | |
private static final int BASIC_PERCENTAGE = 60; | |
private static final int HOUSE_RENT_PERCENTAGE = 30; | |
private static final int CONVEYANCE_ALLOWANCE_PERCENTAGE = 4; | |
private static final int MEDICAL_ALLOWANCE_PERCENTAGE = 6; | |
private static final int HOUSE_RENT_DEDUCTABLE = 25000; | |
private static final int CONVEYANCE_ALLOWANCE_DEDUCTABLE = 2500; |
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.util.AttributeSet | |
import android.view.MotionEvent | |
import androidx.annotation.Nullable | |
import androidx.recyclerview.widget.RecyclerView | |
class CustomScrollableRecyclerView : RecyclerView { | |
private var isVerticalScrollingEnabled = true |
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 androidx.recyclerview.widget.LinearLayoutManager | |
class CustomScrollableLinearLayoutManager(context: Context) : LinearLayoutManager(context) { | |
private var isVerticalScrollEnabled = true | |
private var isHorizontalScrollEnabled = true | |
fun setVerticalScrollEnabled(isVerticalScrollEnabled: Boolean) { | |
this.isVerticalScrollEnabled = isVerticalScrollEnabled | |
} |
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.text.Spannable | |
import android.text.style.ImageSpan | |
import android.util.AttributeSet | |
import androidx.appcompat.widget.AppCompatTextView | |
import java.util.regex.Matcher | |
import java.util.regex.Pattern | |
class ImageSpannedTextView : AppCompatTextView { | |
constructor( |
NewerOlder