Skip to content

Instantly share code, notes, and snippets.

View ahmed-shehataa's full-sized avatar
🏠
Working from home

Ahmed Shehata ahmed-shehataa

🏠
Working from home
View GitHub Profile
@ahmed-shehataa
ahmed-shehataa / cat-app-privcay-policy.md
Created November 7, 2022 13:41
CAT Reloaded app privacy policy

CAT Reloaded privacy policy

Creation Date: 7th of November 2022 Last modified Date: 7th of November 2022

1. About "CAT Reloaded"

CAT Reloaded, Computer Assistance Team, was originally founded and located in 1996 at the Faculty of Engineering, Mansoura University, Egypt.

2. Introduction

This Privacy Policy describes how We collect, store, use,and manage the personal information you provide to Us or that We collect in connection with our mobile app called “Mafqud" as well as your choices and rights concerning the collection and use of personal information. The Privacy Policy is applied to all visitors and users who use the Services.

@ahmed-shehataa
ahmed-shehataa / DataStoreManager.kt
Created January 10, 2022 13:07
A DataStoreManager for local database in android working with dagger-hilt(DI).
import android.content.Context
import androidx.datastore.preferences.core.*
import androidx.datastore.preferences.preferencesDataStore
import com.limeint.BuildConfig
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import javax.inject.Inject
import javax.inject.Singleton

سياسة الخصوصية لـ MafQud تاريخ الإنشاء: 14 نوفمبر 2021 تاريخ آخر تعديل: 20 نوفمبر 2021

حول تطبيق "مفقد" 1 MafQud هو تطبيق جوال آمن يستخدم التعرف على الوجوه لتحديد الأشخاص المفقودين والمفقودين بناءً على الذكاء الاصطناعي

  1. مقدمة توضح سياسة الخصوصية هذه كيفية قيامنا بجمع وتخزين واستخدام وإدارة المعلومات الشخصية التي تزودنا بها أو التي نجمعها فيما يتعلق بتطبيقنا للجوال المسمى "Mafqud" بالإضافة إلى اختياراتك وحقوقك المتعلقة بجمع واستخدام المعلومات الشخصية . يتم تطبيق سياسة الخصوصية على جميع الزوار والمستخدمين الذين يستخدمون الخدمات.
import android.os.Bundle
import android.view.View
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import com.ashehata.linky.R
import com.ashehata.base.externals.hideIcon
import com.ashehata.linky.main.MainActivity
import com.ashehata.base.externals.restartActivity
class SettingsFragment : PreferenceFragmentCompat() {
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--<Preference
android:iconSpaceReserved="false"
android:key="user"
android:persistent="false"
android:selectable="false"
// How to use it
// just call this
NotificationHelper.Builder(requireContext())
.setTitle("Hello")
.setDescription("Tourism is travel for pleasure or business; also the theory and practice")
.build()
class NotificationHelper private constructor(builder: Builder) {
@ahmed-shehataa
ahmed-shehataa / Logger.kt
Last active October 1, 2020 14:39
A custom class to use log only in debug mode not release.
class Logger {
companion object {
private val isDebug = BuildConfig.DEBUG
@JvmStatic
fun e(tag: String, message: String) {
if (isDebug) {
Log.e(tag, message)
}
}
//Grant run time permission
int permission = ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (permission == PackageManager.PERMISSION_GRANTED) {
} else {
Snackbar.make(getView(), "Please allow access to your storage", Snackbar.LENGTH_LONG)
.setAction("Allow", view -> ActivityCompat.requestPermissions(getActivity(), new String[]{
Manifest.permission.WRITE_EXTERNAL_STORAGE
fun Activity.reviewAppDialog() {
val manager = ReviewManagerFactory.create(this)
(manager.requestReviewFlow()).addOnCompleteListener { request ->
if (request.isSuccessful) {
// We got the ReviewInfo object
val reviewInfo = request.result
manager.launchReviewFlow(this, reviewInfo)
} else {