Skip to content

Instantly share code, notes, and snippets.

View m7mdra's full-sized avatar
💤

Mohamed Elshiekh m7mdra

💤
View GitHub Profile
@m7mdra
m7mdra / ioslocaleidentifiers.csv
Last active June 13, 2023 10:18 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@m7mdra
m7mdra / Example.kt
Last active August 18, 2021 17:24 — forked from radoyankov/Example.kt
Easy Spannable on Kotlin
val spanned = spannable{ bold("some") + italic(" formatted") + color(Color.RED, " text") }
val nested = spannable { italic(underline(bold(size(2f, color(Color.RED, "Red Bold Color"))))) }
val noWrapping = bold("no ") + sub("wrapping ) + sup("also ") + "works"
text_view.text = spanned + nested + noWrapping
@m7mdra
m7mdra / Example.java
Created June 3, 2017 22:33 — forked from RyanRamchandar/Example.java
Cancel a running or queued Call with OkHttp3
// ...
Request request = new Request.Builder()
.url(url)
.tag(TAG)
.build();
// Cancel previous call(s) if they are running or queued
OkHttpUtils.cancelCallWithTag(client, TAG);
// New call
@m7mdra
m7mdra / MultiChoiceHelper.java
Created May 8, 2017 08:59 — forked from cbeyls/MultiChoiceHelper.java
Helper class to reproduce ListView's modal MultiChoice mode with a RecyclerView. Compatible with API 7+.
package be.digitalia.common.widgets;
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v4.util.LongSparseArray;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.view.ActionMode;
<service
android:name="com.example.AuthenticatorService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
@m7mdra
m7mdra / README.md
Created September 9, 2016 18:34 — forked from claudijo/README.md
An Android view for typewriting-like animations

TypewriterView

An Android view that can be used to sequentially animate typing and deleting one character at a time. Pausing and enqueuing arbitrary Runnables is also possible. Inspired by Devunwired @ Stackoverflow (see http://stackoverflow.com/questions/6700374/android-character-by-character-display-text-animation).

An EditText view has been used as base to get a blinking cursor. This has the drawback that the user could edit the text while it is animating. Minimum changes to the code are required to instead use a TextView as base if that is an issue.

Example

TypewriterView typewriterView = (TypewriterView) view.findViewById(R.id.typewriter);
@m7mdra
m7mdra / Connectivity.java
Created August 24, 2016 20:00 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
package com.emil.android.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil