Skip to content

Instantly share code, notes, and snippets.

Md. Mahmudul Hasan Shohag ImaginativeShohag

Block or report user

Report or block ImaginativeShohag

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ImaginativeShohag
ImaginativeShohag / RealPathUtil.kt
Created Apr 6, 2020
Real Path Utility class for Android. Tested till API 29. Kotlin Version of this: https://gist.github.com/ImaginativeShohag/476a5ba87824f6e036f6bce10e229079
View RealPathUtil.kt
import android.annotation.SuppressLint
import android.content.ContentUris
import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.DocumentsContract
import android.provider.MediaStore
import androidx.loader.content.CursorLoader
View image_carousel_repositories.gradle
View image_carousel_layout.xml
View image_carousel_dependencies.gradle
View image_carousel_example.kt
@ImaginativeShohag
ImaginativeShohag / TabLayout_bottom_line_custom_color.xml
Created Mar 18, 2020
Custom color for Android TabLayout bottom line
View TabLayout_bottom_line_custom_color.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="-10dp"
android:right="-10dp"
android:top="-10dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<stroke
android:width="2dp"
@ImaginativeShohag
ImaginativeShohag / generate_assets.sh
Created Mar 15, 2020
Generate assets for different pixel density
View generate_assets.sh
#---------------------------------------------------------------
# Given an xxxhdpi image, this script
# creates different dpis resources and the necessary folders
# if they don't exist
#
# Place this script, as well as the source image, inside res
# folder and execute it passing the image filename as argument
#
# Example:
# ./drawables_dpis_creation.sh my_cool_xxhdpi_image.png
@ImaginativeShohag
ImaginativeShohag / jetbrains-studio-rc.desktop
Created Jan 9, 2020
Android Studio Release Candidate launch Icon: ~/.local/share/applications/jetbrains-studio-rc.desktop (https://developer.gnome.org/integration-guide/stable/desktop-files.html.en)
View jetbrains-studio-rc.desktop
[Desktop Entry]
Categories=Development;IDE;
Comment=Everything you need to build on Android
Exec="/mnt/SourceCode/Software/Android/android-studio-rc/bin/studio.sh" %f
Icon=/mnt/SourceCode/Software/Android/android-studio-rc/bin/studio.png
Name=Android Studio RC
StartupWMClass=jetbrains-studio-rc
Terminal=false
Type=Application
Version=1.0
View event_overlap_checker_algorithm.kt
private val appointmentEventList = mutableListOf<AppointmentEvent>()
/**
* Note: Time should be 24 hours.
**/
fun main() {
appointmentEventList.add(AppointmentEvent(230, 300)) // 02:30 - 03:00
appointmentEventList.add(AppointmentEvent(600, 700)) // 06:00 - 07:00
appointmentEventList.add(AppointmentEvent(700, 800)) // 07:00 - 08:00
View color_related_java_utility_functions.java
You can’t perform that action at this time.