Skip to content

Instantly share code, notes, and snippets.

@qamarelsafadi
qamarelsafadi / BaseDialog.kt
Last active April 4, 2023 10:09
This class is generic class for creating your custom dialogs, it will helps you to use one class for all ur custom dialogs.
/*
* Created by Qamar A. Safadi on 6/13/22, 9:50 PM
* Copyright (c) 2022 .
*/
package com.example.qamar.ui.base
import android.app.Dialog
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
@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
@Abdelhady
Abdelhady / DeviceOrientation
Last active April 29, 2023 05:16
A utility class to help get current device orientation, you will need it if you decided to fix the activity's orientation in the manifest :)
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.ExifInterface;
/**
* Created by abdelhady on 9/23/14.
*
* to use this class do the following 3 steps in your activity: